pax_global_header00006660000000000000000000000064146511477000014517gustar00rootroot0000000000000052 comment=b28fa5618bee94d2a22862c29693d0d636161c69 lbdb-0.54/000077500000000000000000000000001465114770000123525ustar00rootroot00000000000000lbdb-0.54/ABQuery.m000066400000000000000000000055561465114770000140530ustar00rootroot00000000000000/* ABQuery * * Copyright 2003 Brendan Cully * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. */ #import #import int main (int argc, const char *argv[]) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; ABAddressBook *book = [ABAddressBook sharedAddressBook]; ABSearchElement *firstNameSearch, *lastNameSearch, *emailSearch, *search; NSArray *searchTerms; NSArray *results; NSEnumerator *addressEnum; ABPerson *person; NSString *key = [NSString stringWithCString:argv[1]]; firstNameSearch = [ABPerson searchElementForProperty:kABFirstNameProperty label:nil key:nil value:key comparison:kABContainsSubStringCaseInsensitive]; lastNameSearch = [ABPerson searchElementForProperty:kABLastNameProperty label:nil key:nil value:key comparison:kABContainsSubStringCaseInsensitive]; emailSearch = [ABPerson searchElementForProperty:kABEmailProperty label:nil key:nil value:key comparison:kABContainsSubStringCaseInsensitive]; searchTerms = [NSArray arrayWithObjects:firstNameSearch, lastNameSearch, emailSearch, nil]; search = [ABSearchElement searchElementForConjunction:kABSearchOr children:searchTerms]; results = [book recordsMatchingSearchElement:search]; addressEnum = [results objectEnumerator]; while (person = (ABPerson*)[addressEnum nextObject]) { NSString *fullName = [NSString stringWithFormat:@"%@ %@", [[person valueForProperty:kABFirstNameProperty] description], [[person valueForProperty:kABLastNameProperty] description]]; ABMultiValue *emails = [person valueForProperty:kABEmailProperty]; int count = [emails count]; int i; for (i = 0; i < count; i++) { NSString *email = [emails valueAtIndex:i]; printf("%s\t%s\t(AddressBook)\n", [email cString], [fullName UTF8String]); } } [pool release]; return 0; } lbdb-0.54/CHANGELOG.md000066400000000000000000000726751465114770000142040ustar00rootroot00000000000000# Changelog ## [0.54] - 2024-07-27 ### Changed - Rewrite of vcquey (m_vcf backend) in Perl to get rid of broken libraries libvc and libvformat). - Testsuite for m_vcf/vcquery extended. - Remove .git* from archives using .gitattributes. ## [0.53] - 2024-07-26 ### Changed - m_vcf (vcquery) can be build with libvc (--with-libvc=vc) as an alternative to libvformat (--with-libvc-vformat) now. In auto-mode libvc is preferred over libvformat. - Add scope option to mutt-ldap-query (m_ldap). Thanks to Ben Collerson (https://github.com/RolandRosenfeld/lbdb/pull/9) - Add testsuite for m_vcf. - Add support to m_vcf for running testsuite on local built code (via $USE_LOCAL_LIB). ## [0.52.1] - 2023-07-29 ### Fixed - Fix version information. ## [0.52] - 2023-07-29 ### Changed - The m_inmail DB is now located by default in $XDG_DATA_HOME/lbdb/m_inmail.db. For backward compatibility an already existing $HOME/.lbdb/m_inmail.utf-8 file is used as first preference (https://bugs.debian.org/843917) ### Added - Add $XDG_CONFIG_HOME/lbdb/config as additional ldbdrc file location, and $XDG_CONFIG_HOME/lbdb/ldap.rc as additional ldaprc file location (Thanks to Michael Tretter ) (https://github.com/RolandRosenfeld/lbdb/pull/5) ### Fixed - lbdb-fetchaddr: discard stdin at the end to avoid problems with tee(1) and command substitution (https://github.com/RolandRosenfeld/lbdb/issues/7) ## [0.51.1] - 2022-09-18 ### Fixed - Repair missing 7bit name part in rfc2047 on arm and mips architecture. ## [0.51] - 2022-09-17 ### Added - Add support for running testsuite on local built code (via $USE_LOCAL_LIB). - Add testsuite for m_inmail/lbdb-fetchaddr. ### Fixed - Fix example of MUNGE_LIMITDATE in lbdb.rc. - Ignore case and non alphanumeric chars in SORT_OUTPUT=name. - Update dotlock code from mutt 2.2.1 (uses snprintf now). - Update rfc822 code from mutt 2.2.1. - Fix quoting of grep Regex in m_muttalias. ## [0.50] - 2022-02-25 ### Changed - Split Debian package (hosted on salsa.debian.org) and upstream package (hosted on github.com) ## [0.49.1] - 2021-10-09 ### Fixed - Create empty config.rpath to make autoconf 2.71 happy (https://bugs.debian.org/995983). ## [0.49] - 2020-11-13 ### Changed - Move mutt_ldap_query from libdir to bindir, since it can be called separately. ### Fixed - lbdbq: re-add $exec_prefix, which may be used in libdir. - Forward INMAIL_DB default from m_inmail to lbdb-munge. ## [0.48.1] - 2019-01-07 ### Fixed - Fix wrong quoting in lbdb-fetchaddr (https://bugs.debian.org/918594) ## [0.48] - 2019-01-04 ### Added - Add tests for m_abook. ### Fixed - m_inmail/lbdb-munge: Use INMAIL_DB if set in config (https://bugs.debian.org/916282) ### Changed - m_muttalias: Fix some shellcheck warnings. - m_abook: Fix a shellcheck warning. - lbdbq, lbdb-fetchaddr: Fix some shellcheck warnings. - Change project homepage URL to https. - Use literal tab characters in order to make m_abook and m_goobook modules work without requiring GNU sed(1). Thanks to Raf Czlonka. - Add update-version target to update version in all autotool files. ## [0.47] - 2018-04-02 ### Added - Add a test suite. - Add a test for m_muttalias. - Make the database file for m_inmail/lbdb-fetchaddr configurable. ### Changed - Add .gitignore based on code by Lucas Hoffmann. - Replace legacy `...` by $(...) in sh scripts. - Update copyright notice. - Add test_perl to check perl syntax. - Replace undefined $rv by $?. - Add LBDB_OVERRIDE_METHODS, OVERRIDE_MUTTALIAS_FILES variables for testing. - m_muttalias: rewrite sed regex as ERE, which should be more POSIX compatible and should work on non GNU sed, too. - lbdbq: Remove whitespace from number of matches to become more portable. ## [0.46] - 2018-01-14 ### Added - Add new module m_mu (maildir-utils), provided by Timothy Bourke. ## [0.45.2] - 2017-11-12 ### Fixed - Rename configure.in to configure.ac to make autoconf happy. - lbdb.el: Replace obsolete (as of 23.2) function interactive-p. - lbdb_bbdb_query.el: Fix emacs warning. ## [0.44] - 2017-09-11 ### Fixed - Fix count in m_inmail munge. - Stop adding trailing spaces to date in m_inmail.utf-8. - Remove unwanted trailing spaces from date field in m_imail.utf-8. Thanks to Peter P. for reporting this issue. ## [0.43] - 2017-07-01 ### Added - m_khard: New CardDAV module using khard. Thanks to Colin Watson for providing the patch (https://bugs.debian.org/866178). ### Changed - Rebuild aclocal with version 1.15. - Update config.guess and config.sub from autotools-dev 20161112.1 ## [0.42.1] - 2016-12-11 ### Fixed - lbdb-munge: fix autoconf libdir path (https://bugs.debian.org/84773). ## [0.42] - 2016-11-07 ### Added - m_gpg, m_pgp[25]: extend allowed real name length from 27 to 47 chars (https://bugs.debian.org/825333). - Add new module m_goobook, which reads addresses from Google contacts using goobook package. Thanks for providing this to François Charlier. - Allow one to remove outdated or infrequently used entries from m_inmail. Thanks to Yaroslav Halchenko for providing a patch (https://bugs.debian.org/406232). ### Changed - Change lbdb-fetchaddr/m_inmail default charset to UTF-8 (https://bugs.debian.org/600462). To avoid problems on upgrading, the database file name was changed from $HOME/.lbdb/m_inmail.list to $HOME/.lbdb/m_inmail.utf-8. If you want to keep your old (ISO-8859-15 encoded) database, you can just append it to the new file by cd $HOME/.lbdb iconv -f iso-8859-15 -t utf-8 < m_inmail.list >> m_inmail.utf-8 ### Fixed - Update autotools. - Merge changes from mutt 1.7.1 dotlock.c. - Get rid of warn_unused_resuld from dotlock.c. ## [0.41] - 2016-03-05 ### Changed - fetchaddr: change real name length limit from 30 to 70. Thanks to Andrey Skvortsov for providing a patch (https://bugs.debian.org/780532). ### Fixed - Remove CVS $Id$ tags and the like, which don't work with git. - Apply several patches by Lucas Hoffmann: - m_wanderlust: Fix variable name. - m_gnomecard, m_pine: Remove needless backslashes from embedded AWK. - lbdbq: Optimize counting lines. - lbdbq: Remove unreached break after exit. - fetchaddr: avoid segfault on empty lines (https://bugs.debian.org/715901). - vcquery: order N: field: Prefixes GivenName AddName FamilyName Suffix (https://bugs.debian.org/578155). - Remove lbdb.spec on clean target. - Move LIBICONV linking to the end of the cc call to make cygwin happy. - Substitute ${prefix} in @sysconfdir@ in mutt_ldap_query.pl. - Fix more bashisms (Thanks to Thorsten Glaser). - Update config.guess and config.sub. ## [0.40] - 2016-01-30 ### Fixed - Avoid gpg trustdb check in m_gpg, since this may take a long time while lbdb is not responsible. Thanks to Gregor Zattler for providing a patch (https://bugs.debian.org/805235). - mutt_ldap_query: escape parentheses, since perl 5.22 complains about this otherwise. Thanks to Olivier Mehani and Francois Charlier. (https://bugs.debian.org/812785). This also solves Ubuntu https://bugs.launchpad.net/ubuntu/+source/lbdb/+bug/1539774 RedHat https://bugzilla.redhat.com/show_bug.cgi?id=1259881 - Fix several man page typos. ## [0.39] - 2014-05-10 ### Added - mutt-ldap-query: Add parameters for TLS and SASL_MECH (Thanks to Alexandra N. Kossovsky) (https://bugs.debian.org/512074). ### Fixed - Update packaged autotools files. - Rebuild aclocal/autoconf. - Add $CPPFLAGS to $CFLAGS to really use hardening. - m_vcf: Optimize missing names handling (Thanks to Jamey Sharp) (https://bugs.debian.org/633920). - m_abook: fix formatting (Thanks to Alfredo Finelli) (https://bugs.debian.org/681526). - Mention user mutt-ldap-query configuration files in lbdbq(1) man page (https://bugs.debian.org/534710). - Update ABQuery build mechanism (Thanks to Brendan Cully). ## [0.38] - 2011-06-25 ### Added - m_vcf: Apply patch by Jamey Sharp to support VCF contacts without real name (https://bugs.debian.org/624590). - vcquery: Apply patch by martin f krafft to search in NICKNAME field, too. (https://bugs.debian.org/586300). ### Fixed - m_evolution: Try to evaluate the location of evolution-addressbook-export at runtime, since it is no longer available in /usr/bin since evolution 2.30.1.2-3 (https://bugs.debian.org/583851, #598380). ## [0.37] - 2010-05-18 ### Added - m_evolution: support line breaks and long lines. Thanks to Jan Larres for providing a patch (https://bugs.debian.org/505540). ### Fixed - Fix bashisms in m_bbdb (https://bugs.debian.org/530113). - Fix query shell functions to catch non-zero exit status in case they get invoked in set -e context. Thanks to martin f. krafft for providing a patch (https://bugs.debian.org/515076). - Fix documentation concerning the quotes on lbdbq call (https://bugs.debian.org/542012). ## [0.36] - 2008-06-14 ### Fixed - Remove duplicate "See also: mutt" from lbdbq.man (https://bugs.debian.org/441588). - Update configure using autconf 2.61. - Apply charset conversation patch by Peter Colberg based on code by Tobias Schlemmer (https://bugs.debian.org/355678). - Remove duplicate declaration of $ignorant (https://bugs.debian.org/480356, https://bugs.debian.org/483701). - Handle mail addresses in mutt_ldap_query correct. Thanks to Colin Watson for providing a patch (https://bugs.debian.org/469288). - Mention ldapi URIs in mutt_ldap_query man page (https://bugs.debian.org/422730). - Protect "make distclean" by checking whether makefile exists. ## [0.35.1+nmu1] - 2008-04-12 ### Fixed - Fix m_evolution to work also with recent Evolution which exports cards with different FN/EMAIL fields ordering. Thanks to Brian M. Carlson for the patch (https://bugs.debian.org/462573). ## [0.35.1] - 2007-05-28 ### Fixed - Get rid of the SSL code from the previous version and add a comment to the man page instead how you can use SSL (and also different ports) using ldap[s]://foo[:port] URLs (https://bugs.debian.org/426316). ## [0.35] - 2007-05-20 ### Added - Update mutt_ldap_query.pl from http://www.courville.org/mediawiki/index.php/Mutt_ldap_query which adds SSL support. ### Fixed - Avoid loosing the first entry from VCF file. Thanks to Tino Keitel for providing a patch (https://bugs.debian.org/405312). - Remove vcquery in distclean target (https://bugs.debian.org/405321). - Use defaults for $KEEP_DUPES and $SORT_OUTPUT in lbdbq (https://bugs.debian.org/422214). ## [0.34] - 2006-11-12 ### Added - vcquery: Use value of concatenated N fields if FN field is missing. Thanks to Gregor Jasny for providing a patch (https://bugs.debian.org/395422). ### Fixed - vcquery: avoid free() on unallocated memory if fullname is not set. Thanks to Gregor Jasny for finding and providing a patch (https://bugs.debian.org/395421). ## [0.33] - 2006-10-14 ### Added - Add SORT_OUTPUT=reverse_comment to do reverse sort by the third column (most recent m_inmail timestamp at the top). Thanks to Marco d'Itri for this suggestion. ### Fixed - Comment out LDAP_NICKS in lbdb.rc because this should only be an example and if it is set there it overrides other LDAP settings (https://bugs.debian.org/391320). ## [0.32] - 2006-08-13 ### Added - New version of mutt_ldap_query by Marc de Courville and other contributors. - Extend lbdb_hostname() to get the domain name from resolv.conf. Thanks to Gary Johnson for providing this patch. - m_muttalias: Allow \"...\" around real names of aliases. Thanks to Erik Shirokoff for providing this patch. ### Fixed - Change sort(1) syntax to cope with new versions of coreutils (https://bugs.debian.org/368917). ## [0.31.1] - 2006-01-15 ### Fixed - It seems, that evolution-addressbook-export now also has EMAIL entries without subtype "EMAIL;TYPE=INTERNET:" vs. "EMAIL:" in it. m_evolution now supports both variants (https://bugs.debian.org/347971). - Remove backslash from comment in m_evolution. ## [0.31] - 2005-10-29 ### Added - Add m_vcf module for querying vcard files provided by Brendan Cully. - Add authentication (bind_dn, bind_password) to mutt_ldap_query. Based on an idea of Jan-Benedict Glaw (https://bugs.debian.org/324655, https://bugs.debian.org/286163). ### Fixed - m_pine: Double-quote parentheses. Thanks to Stefan Mätje for reporting this bug and sending a patch. - Apply patch by Brendan Cully to follow the Apple build system changes used to build ABQuery module. - Update FSF address in nearly all files. ## [0.30] - 2005-04-30 ### Fixed - Get rid of strict aliasing warnings in gcc. Thanks to Ludwig Nussel for providing a patch. - Add line breaks to POD part of mutt_ldap_query.pl to make man page more readable. - Replace "grep" with "grep -a" to avoid error messages on non-ascii output (https://bugs.debian.org/284119). - mutt_ldap_query: Stop returning entries without email address (https://bugs.debian.org/290148). - m_gpg: Add support for gpg 1.4 (not only 1.2.5) (https://bugs.debian.org/294113). - m_gpg: Stop showing revoked user ids (https://bugs.debian.org/259212). - Rebuild configure with autoconf 2.59a. - Make the paths of several binaries configurable in configure as --with-foo - Replace hyphens (-) by minus signs (\-) in the man pages. ## [0.29] - 2004-02-23 ### Added - Add new module m_evolution to access Ximian Evolution addressbook. Thanks to Guido Guenther (https://bugs.debian.org/234345). ## [0.28.2] - 2004-02-07 ### Added - Another upgrade of m_bbdb by Aaron Kaplan . - mutt_ldap_query: Apply patch from Max Kutny , which allows to override config file settings via command line options (https://bugs.debian.org/231261). ### Fixed - Quote $GNUCLIENT in m_bbdb to avoid error message when this variable is not defined (https://bugs.debian.org/231061). ## [0.28.1] - 2004-01-18 ### Added - Allow sorting the output by "comment" field (column 3) by setting SORT_OUTPUT=comment (https://bugs.debian.org/225104). - Add gnuclient support to m_bbdb module. Thanks to Aaron Kaplan for providing this patch. ### Fixed - Make m_osx_addressbook compile on MacOS 10.3 and XCode, too. Thanks to Yuval Kogman and Brendan Cully for the patch. - Remove "set -e" from lbdbq, which causes trouble if grep doesn't find a match in some of the modules (https://bugs.debian.org/222647). - m_passwd: Ignore system accounts (UIDs, which aren't in the range 1000-29999 on a Debian system), if PASSWD_IGNORESYS=true is set (https://bugs.debian.org/188085). ## [0.28] - 2003-09-09 ### Changed - m_abook: Search for $HOME/.abook/addressbook in addition to $HOME/.abook.addressbook to honor the fact that this file was moved in abook 0.5 (https://bugs.debian.org/205418). ### Fixed - Fix bug in ABQuery module, which crashes when it finds results in non-latin character sets. Now returns UTF8 results instead. Thanks to Brendan Cully . - Correct delimiter of vcard to END:VCARD in m_gnomecard and allow encodings etc. in the FN field, thanks to Rogerio Brito (https://bugs.debian.org/198633). - Search for .gnome/GnomeCard.gcd in $HOME instead of current directory. - Add a new version of mutt_ldap_query.pl by Marc de Courville: - activated pod2usage (now contained in all the decent distributions) - cleaned pod section to comply better with the pod formatting standard - change contact address - fixed typos - m_palm: Use only "email" entries as e-mail addresses and not everything including "@". Thanks to Nikolaus Rath for providing the patch (https://bugs.debian.org/196888). ## [0.27] - 2003-03-22 ### Added - New module m_osx_addressbook, which queries the OS X AddressBook (only on OS X with the Developer tools installed) written by Brendan Cully . ## [0.26.2] - 2003-02-09 ### Added - mutt_ldap_query: Add new config option $ignorant (and also 7th field in NICK array) to enable ignorant searching (search for *foo* instead of foo) (https://bugs.debian.org/179861). ### Fixed - Optimized manual page in mutt_ldap_query.pl, to look less corrupted. -- Roland Rosenfeld Sun, 9 Feb 2003 13:19:49 +0100 ## [0.26.1] - 2003-02-08 ### Added - Support multiple address book files with abook. Thanks to Etienne PIERRE for providing this patch. ### Fixed - Rebuild configure with autoconf 2.57. - Add long options --version and --help to ldbdq and man page. - New mail address of Brian Salter-Duke . - Use /etc/mailname as mail domain name in lbdb_hostname() (https://bugs.debian.org/165159). ## [0.26] - 2002-02-11 ### Added - m_wanderlust: new module to read ~/.addesses file from WanderLust MUA. Module provided by Gergely Nagy . (https://bugs.debian.org/133209). ### Fixed - m_finger: Suppress lines where real name is '???' (some versions of finger seem to use this for non existing users) (https://bugs.debian.org/112127). - Quote the search string in m_yppasswd, m_nispasswd and m_getent as mentioned by Gary Johnson . - Add CVS Id tags to all modules. ## [0.25.2] - 2001-09-01 ### Added - Add m_getent by Adrian Likins , which can replace m_passwd and m_yppasswd on systems where getent(1) is installed. ### Fixed - New version (1.10) of lbdb.el by Dave Pearson : Fixes the fact that, when in an emacs that doesn't have `line-{beginning,end}-position' available (xemacs, for example) I wasn't defining fully compatible versions. - Add short description to mutt_ldap_query in NAME section. - Add option -a to fetchaddr and lbdb-fetchaddr to fetch also addresses without realname. ## [0.25.1] - 2001-07-24 ### Fixed - Add ">" to pod2man call in Makefile, because older versions of perl come with a pod2man which dies otherwise. ## [0.25] - 2001-07-22 ### Added - Add m_ldap and mutt_ldap_query provided by Marc de Courville, . - Module m_nispasswd added by Utz-Uwe Haus . ### Changed - Added variable MAIL_DOMAIN_NAME to override other settings of mail domain. ### Fixed - Fix problem in mutt_ldap_query, which ignored the content of the config file before. - Remove <> from email address in mutt_ldap_query output. - lbdb-munge didn't honor SORT_OUTPUT when called from m_inmail, so export this variable in m_inmail (https://bugs.debian.org/92767). ## [0.24] - 2001-02-10 ### Added - Add new module m_bbdb to access a (X)Emacs big brother database (bbdb) from lbdb using (x)emacs as the backend. Thanks to Utz-Uwe Haus for providing this. ### Changed - Add a new variable KEEP_DUPES, which allows to see duplicate mail addresses (with different real names or comment fields) (https://bugs.debian.org/83908). ### Fixed - s/MODULE_PATH/MODULES_PATH/ in documentation to match the behavior of the program (https://bugs.debian.org/83933). - m_gpg: stop using --with-colons, because this outputs utf8 instead of your local charset, which causes problems with non 7bit characters (https://bugs.debian.org/83936). ## [0.23] - 2001-01-23 ### Added - Add new module m_gnomecard based on an idea by Rick Frankel . - Upgrade lbdb.el to version 1.9 (Thanks Dave!). ### Fixed - Add a second grep to m_pgp5 and m_gpg to remove UIDs, which don't match the search string, but are only generated, because a different UID of this key matches. - Add $(install_prefix) to Makefile.in. Thanks to Rob Payne for providing the idea and a patch. - Update lbdb.spec.in, patch provided by Rob Payne . ## [0.22] - 2000-10-17 ### Added - Add new module m_addr_email to request data from addressbook program (http://red.roses.de/~clemens/addressbook/) by Torsten Jerzembeck . - Update lbdb.el to version 1.8: - Fixes the problem with spaces in query strings (https://bugs.debian.org/74818). - New commands lbdb-region and lbdb-maybe-region to query lbdb for the content of the current region. - Autoload lbdb-region and lbdb-maybe-region from startup file. ### Fixed - Some optimizations on m_addr_email to handle city name correct and to junk entries without email address. - Use sort without -u option, because duplicates are already removed by munge before. - Do not overwrite m_inmail.list on munging, if file system is full. ## [0.21.1] - 2000-10-09 ### Added - SORT_OUTPUT now can be "name" or "address" to sort output by mail real names or addresses (still the default). ### Fixed - Update lbdb.el to version 1.4 to avoid problems with status line of lbdbq. - Correct behavior of variable SORT_OUTPUT (did the inverse of what it should do). - Correct output of number of matching entries (count after munging instead before). ## [0.21] - 2000-10-08 ### Added - Update lbdb.el to version 1.3 (thanks Dave). - m_muttalias: Add support for "alias foo (Foo Bar)" style aliases. ### Fixed - Don't fail in m_palm, if no database is available. - Correct typo in m_muttalias, which stopped to work when your HOME is your MUTT_DIRECTORY (https://bugs.debian.org/71975). - Correct README (we have more than two modules now :-) - Create sysconfdir, if it doesn't already exist. - lbdbq: write information about number of matching entries into status line and exit with return value 1, if no matching entries were found. - Correct exit value of lbdbq (trap command). ## [0.20.1] - 2000-08-24 ### Fixed - Fix name conflicts (m_palm_lsaddr now completely renamed to palm_lsaddr). ## [0.20] - 2000-08-21 ### Added - Add emacs interface lbdb.el 1.2 by Dave Pearson - Add m_palm module and palm_lsaddr by Dave Pearson . ### Fixed - Update documentation. - Rename $p to $CURRENT_MODULE_DIR in lbdbq, so a module can access the directory where it is placed itself for accessing some helper applications. ## [0.19.9] - 2000-08-16 ### Fixed - Remove erroneous quotes from lbdb-fetchaddr, which caused fetchaddr to write "`' wrong parameter" error message to procmail log file. - Correct the getopt behavior in lbdb-fetchaddr. - s/strfcpy/strncpy/ in fetchaddr.c. ## [0.19.8] - 2000-08-08 ### Fixed - Renamed option -h to -x, because -h is already used for "help". ## [0.19.7] - 2000-08-07 ### Added - Add a new option -h to lbdb-fetchaddr and fetchaddr, which allows you to add a colon separated list of header fields to search for mail addresses. If this option isn't given, we fall back to "from:to:cc:resent-from:resent-to" (https://bugs.debian.org/54169). ## [0.19.6] - 2000-08-05 ### Added - New version of m_pine by Gabor Fleischer : Now handles aliases without real names correct (by using a single space as the realname, so Mutt has not problem with this. - Add new helper program qpto8bit, which converts quoted-printable (according to RFC2047) to plain 8bit (without MIME header). This is used by m_pine to decode quoted-printable in addressbooks to 8bit. ## [0.19.5] - 2000-06-23 ### Added - Add new module m_pine, provided by Gabor FLEISCHER to search pine address books. ### Fixed - Remove "-f" option from configure @AWK@ variable and manually add it, where it is needed, otherwise @AWK@ cannot be used for inline scripts. - Fixed m_muttalias to additionally accept "foo@bar (Foo Bar)" style addresses and to ignore group aliases. ## [0.19.4] - 2000-05-28 ### Fixed - Make dotlock.c compile on systems without snprintf() again. - Don't remove Makefile in clean target but only in distclean. ## [0.19.3] - 2000-05-27 ### Added - Add new module m_muttalias, provided by Brian Salter-Duke to search mutt alias files for aliases. ## [0.19.2] - 2000-05-22 ### Changed - Give the dateformat to fetchaddr(1) using the -d option (instead of simply using argv[1]). - Give the dateformat to lbdb-fetchaddr(1) using the -d option. If there is only one parameter, this is used as dateformat for backward compatibility. Manpage adapted to this. ### Fixed - Remove DOTLOCK=/usr/bin/mutt_dotlock from ./configure environment. This is superfluous since --enable-lbdb-dotlock is used, but it doesn't cause problems (neither with mutt installed or deinstalled) (https://bugs.debian.org/64134). - Fixed typo in m_abook ("@$" instead of "$@"). ## [0.19] - 2000-05-08 ### Added - Add abook support based on an idea by Ross Campbell . - Add NIS support based on an idea by Ross Campbell . - Add lbdb.spec by Horms . - Update the version number in lbdb.spec via configure. - Add option SORT_OUTPUT to lbdb.rc, which can be set to "false" or "no". This implies that lbdbq doesn't sort the output but reverts its order, so the most recent addresses from m_inmail.list will be shown first. Thanks to Andrew Over for this idea. ### Fixed - use safe_strdup() instead of strdup() which isn't available on Ultrix. - Add --enable-lbdb-dotlock to configure options to force using of lbdb_dotlock (instead of using mutt_dotlock) and use this option for the Debian package (https://bugs.debian.org/58188). - Update FSF address in copyrights. - Update dotlock code from mutt 1.1.12. - Speed up munge (nearly two times as fast as previous version). -- Roland Rosenfeld Mon, 8 May 2000 19:23:16 +0200 ## [0.18.5] - 1999-11-07 ### Fixed - Optimized m_gpg to use --with-colons. ## [0.18.4] - 1999-10-24 ### Fixed - Fixed typo in lbdb-fetchaddr.man. - Fixed typo on lbdbq.man (https://bugs.debian.org/48143). ## [0.18.3] - 1999-09-18 ### Fixed - m_gpg no longer writes error messages to stderr, when the given search string does not exist (https://bugs.debian.org/45422). ## [0.18.2] - 1999-09-15 ### Added - Added HP-UX support (by David Ellement ): - Try awk (in addition to mawk, gawk, nawk). - Don't use "if ! ..." in shell scripts, because ksh in HP-UX doesn't support this. - Add -v and -h options to lbdbq and lbdb-fetchaddr which display the version of lbdb and a short help. ### Fixed - Make dotlock.c more portable. - Make Makefile.in much more portable. - Merge in changes of dotlock program from Mutt 0.96.6. ## [0.18.1] - 1999-08-04 ### Security - Merged in changes from Mutt's dotlock (CVS as of 1999-08-01). ### Fixed - Use "$@" instead of $1 in m_* files to allow `lbdb First Last' without quotes around "First Last" (https://bugs.debian.org/42417). ## [0.18] - 1999-06-23 ### Added - Added Fido module m_fido and nodelist2lbdb. ### Changed - Splited lbdb-fetchaddr.man off from lbdbq.man. - Moved lbdb-fetchaddr from $bindir to $libdir. ## [0.17.1] - 1999-05-25 ### Fixed - Upgraded autoconf from 2.12 to 2.13. Get rid of `echo $PATH | sed "s/:/ /g"` in AC_PATH_PROC() macro, because this isn't needed and doesn't work with autoconf 2.13. - Removed word boundary check in m_inmail, because this is only available in GNU grep. ## [0.17] - 1999-04-07 ### Added - Delay munging of mails when using lbdb-fetchaddr/m_inmail by adding a new script lbdb-munge, which is run by lbdbq and can be run by cron additionally. Thanks to Enrico Zini for the base idea of this. ### Changed - Made lbdb-fetchaddr Y2K compliant by changing the date format which is written to the 3rd column of m_inmail.list to "%Y-%m-%d %H:%M" (e.g. "1999-04-29 14:33"). - Made date format in lbdb-fetchaddr runtime configurable as a command line parameter. If no date format is specified, "%Y-%m-%d %H:%M" is used as the default. ### Fixed - include getopt.h only if it is existing (using autoconf). ## [0.16.2] - 1999-04-06 ### Fixed - Removed some bash, GNU-make, and GNU libc specials. ## [0.16.1] - 1999-04-05 ### Fixed - lbdb-fetchaddr: Create directory $HOME/.lbdb if it does not exist. ## [0.16] - 1999-04-04 ### Fixed - Added dotlock command from mutt 0.96.1 sources (without the SGID mail stuff) which is installed as lbdb_dotlock, when no mutt_dotlock can be found. ## [0.15.1] - 1999-02-21 ### Added - m_passwd: give UID in comment field. ### Fixed - m_gpg: now only return addresses which match query. https://bugs.debian.org/33672. ## [0.15] - 1999-02-18 ### Added - Added new modules: - m_passwd: looks into /etc/passwd for addresses - m_pgp2: scans your PGP 2.* keyring for addresses - m_pgp5: scans your PGP 5.* keyring for addresses - m_gpg: scans your GnuPG keyring for addresses ### Fixed - Made config directory autoconf configureable as @sysconfdir@ - Fixed trouble in configure.in noted by Fabrice Noilhan . ## [0.14] - 1999-01-16 ### Fixed - fetchaddr converts the domain part of mail addresses to lowercase, to beware of duplicates in m_inmail.list. https://bugs.debian.org/31989 ## [0.13] - 1999-01-12 ### Added - Upgraded lbdb.sl supplied by Thomas Roessler ### Changed - Moved lbdb.sl to /usr/doc/lbdb/examples - Create ~/.lbdb/m_inmail.list in lbdb-fetchaddr if it does not exist. ### Fixed - Fix manpage lbdb-fetchaddr(1) to refer to the correct db filename. ## [0.12] - 1998-11-11 ### Changed - Package maintenance transferred from Thomas Roessler to Roland Rosenfeld ### Fixed - lbdbq manpage moved to main packet. - made @libdir@ configurable in lbdbq manpage. - fixed some "-Wall" warnings. - several typos and nits fixed. lbdb-0.54/COPYING000066400000000000000000000431051465114770000134100ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. lbdb-0.54/INSTALL000066400000000000000000000011301465114770000133760ustar00rootroot00000000000000Installation notes ------------------ To install the Little Brother's database, type: ./configure make make test make install Note that this will put quite a few auxiliary files into /usr/local/lib. You may want to put lbdb into a separate directory hierarchy such as /usr/local/lbdb (use the --prefix switch), or you may want to give it a different libdir, such as /usr/local/lib/lbdb (use the --libdir switch). You need to have the Palm::PDB and Palm::Address Perl modules installed to use the m_palm module. You need to have the Net::LDAP Perl module installed to use the m_ldap module. lbdb-0.54/Makefile.in000066400000000000000000000135141465114770000144230ustar00rootroot00000000000000# Copyright (C) 1998 Thomas Roessler # Copyright (C) 1999-2024 Roland Rosenfeld # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. CC=@CC@ LDFLAGS=@LDFLAGS@ CPPFLAGS=@CPPFLAGS@ CFLAGS=@CFLAGS@ $(CPPFLAGS) DEFS=@DEFS@ INSTALL=@INSTALL@ MODULES=@MODULES@ DOTLOCKBASE=@DOTLOCKBASE@ DOTLOCK_TARGET=@DOTLOCK_TARGET@ TACTARGET=@TACTARGET@ PERL=@PERL@ XCODEBUILD=@XCODEBUILD@ PBXBUILD=@PBXBUILD@ LIBICONV=@LIBICONV@ prefix=@prefix@ exec_prefix=@exec_prefix@ bindir=@bindir@ srcdir=@srcdir@ libdir=@libdir@ mandir=@mandir@ sysconfdir=@sysconfdir@ SUBDIRS=tests ALL=lbdbq lbdb_lib lbdb-fetchaddr lbdb-munge fetchaddr qpto8bit munge \ nodelist2lbdb palm_lsaddr mutt_ldap_query vcquery lbdbq.man \ lbdb-fetchaddr.man nodelist2lbdb.man mutt_ldap_query.man lbdb.rc \ $(MODULES) $(DOTLOCK_TARGET) $(TACTARGET) all: Makefile $(ALL) test: all test_perl $(MAKE) -C tests check-local testinstalled: $(MAKE) -C tests installcheck-local test_perl: [ "$(PERL)" = "no" ] || perl -wc nodelist2lbdb [ "$(PERL)" = "no" ] || perl -wc palm_lsaddr [ "$(PERL)" = "no" ] || perl -wc mutt_ldap_query [ "$(PERL)" = "no" ] || perl -wc vcquery install: all $(srcdir)/mkinstalldirs $(install_prefix)$(bindir) $(srcdir)/mkinstalldirs $(install_prefix)$(libdir) $(srcdir)/mkinstalldirs $(install_prefix)$(sysconfdir) $(srcdir)/mkinstalldirs $(install_prefix)$(mandir) $(srcdir)/mkinstalldirs $(install_prefix)$(mandir)/man1 $(INSTALL) -m 755 fetchaddr $(install_prefix)$(libdir) $(INSTALL) -m 755 qpto8bit $(install_prefix)$(libdir) $(INSTALL) -m 755 lbdbq $(install_prefix)$(bindir) $(INSTALL) -m 755 lbdb-fetchaddr $(install_prefix)$(bindir) $(INSTALL) -m 755 lbdb-munge $(install_prefix)$(libdir) $(INSTALL) -m 755 lbdb_lib $(install_prefix)$(libdir) $(INSTALL) -m 755 munge $(install_prefix)$(libdir) $(INSTALL) -m 644 lbdb_bbdb_query.el $(install_prefix)$(libdir) if [ "$(PERL)" != "no" ]; then \ $(INSTALL) -m 755 nodelist2lbdb $(install_prefix)$(bindir); \ $(INSTALL) -m 644 nodelist2lbdb.man \ $(install_prefix)$(mandir)/man1/nodelist2lbdb.1; \ $(INSTALL) -m 755 palm_lsaddr $(install_prefix)$(libdir); \ $(INSTALL) -m 755 mutt_ldap_query $(install_prefix)$(bindir); \ $(INSTALL) -m 644 mutt_ldap_query.man \ $(install_prefix)$(mandir)/man1/mutt_ldap_query.1; \ $(INSTALL) -m 644 lbdb_ldap.rc \ $(install_prefix)$(sysconfdir)/lbdb_ldap.rc; \ $(INSTALL) -m 755 vcquery $(install_prefix)$(libdir); \ fi if [ "$(XCODEBUILD)" != "no" -o "$(PBXBUILD)" != "no" ]; then \ $(INSTALL) -m 755 ABQuery $(install_prefix)$(libdir); \ fi for i in $(MODULES); do \ $(INSTALL) -m 755 $$i $(install_prefix)$(libdir); \ done $(INSTALL) -m 644 lbdbq.man $(install_prefix)$(mandir)/man1/lbdbq.1 $(INSTALL) -m 644 lbdb-fetchaddr.man \ $(install_prefix)$(mandir)/man1/lbdb-fetchaddr.1 $(INSTALL) -m 644 lbdb.rc $(install_prefix)$(sysconfdir)/lbdb.rc if [ "$(DOTLOCK_TARGET)" != "" ]; then \ $(INSTALL) -m 755 lbdb_dotlock $(install_prefix)$(bindir); \ $(INSTALL) -m 644 dotlock.man \ $(install_prefix)$(mandir)/man1/lbdb_dotlock.1; \ fi if [ "$(TACTARGET)" != "" ]; then \ $(INSTALL) -m 755 tac $(install_prefix)$(libdir)/tac; \ fi fetchaddr: $(srcdir)/fetchaddr.o $(srcdir)/rfc822.o $(srcdir)/helpers.o \ $(srcdir)/rfc2047.o $(CC) $(CFLAGS) $(LDFLAGS) $? -o $@ $(LIBICONV) qpto8bit: $(srcdir)/qpto8bit.o $(srcdir)/rfc822.o $(srcdir)/helpers.o \ $(srcdir)/rfc2047.o $(CC) $(CFLAGS) $(LDFLAGS) $? -o $@ $(LIBICONV) fetch: $(srcdir)/fetch.sh query: $(srcdir)/query.sh lbdb-query: $(srcdir)/lbdb-query.sh nodelist2lbdb: $(srcdir)/nodelist2lbdb.pl cat nodelist2lbdb.pl > $@ palm_lsaddr: $(srcdir)/palm_lsaddr.pl cat palm_lsaddr.pl > $@ mutt_ldap_query: $(srcdir)/mutt_ldap_query.pl cat mutt_ldap_query.pl > $@ lbdb_dotlock: $(srcdir)/dotlock.o $(srcdir)/helpers.o $(CC) $(CFLAGS) $(LDFLAGS) $? -o $@ dotlock.o: $(srcdir)/dotlock.h $(srcdir)/dotlock.c tac: $(srcdir)/tac.awk cat tac.awk > $@ chmod a+x $@ munge: $(srcdir)/munge.awk cat munge.awk > $@ chmod a+x $@ mutt_ldap_query.man: $(srcdir)/mutt_ldap_query.pl if [ "$(PERL)" != "no" ]; then \ pod2man mutt_ldap_query.pl > $@; \ else \ touch mutt_ldap_query.man; \ fi m_vcf: vcquery vcquery: $(srcdir)/vcquery.pl $(INSTALL) vcquery.pl $@ m_osx_addressbook: ABQuery ABQuery: ABQuery.m $(CC) $(CFLAGS) $(DEFS) -framework Foundation -framework AddressBook -o $@ $^ update-version: -rm -f configure tests/package.m4 tests/testsuite autoconf ./configure $(MAKE) test $(MAKE) distclean clean: -rm -f *.o *~ $(ALL) munge.awk tac.awk ABQuery \ nodelist2lbdb.pl palm_lsaddr.pl mutt_ldap_query.pl \ lbdb_dotlock lbdb.spec lbdb-pkg.el vcquery.pl -rm -rf ABQuery.dSYM autom4te.cache $(MAKE) -C tests clean distclean: clean -rm -f config.status config.cache config.log Makefile -rm -f *.sh $(MAKE) -C tests distclean Makefile: Makefile.in ./config.status %.sh: %.sh.in ./config.status %.pl: %.pl.in ./config.status %.awk: %.awk.in ./config.status %.man: %.man.in sed -e 's!@''libdir@!$(libdir)!' \ -e 's!@''sysconfdir@!$(sysconfdir)!' \ -e 's!@''dotlock@!$(DOTLOCKBASE)!' $@.in > $@ %.o: %.c $(CC) $(CFLAGS) $(DEFS) -c $< .PHONY: test test_perl update-version lbdb-0.54/README.md000066400000000000000000000237101465114770000136340ustar00rootroot00000000000000The Little Brother's Database (lbdb) ==================================== - Roland Rosenfeld (current maintainer) - Thomas Roessler (initial author) This package was inspired by the [Big Brother Database](http://bbdb.sourceforge.net/) package available for various Emacs mailers, and by Brandon Long's ["external query"](http://www.mutt.org/doc/manual/#query) patch for the [Mutt](http://www.mutt.org/) mail user agent. (Note that this patch has been incorporated into the main-line mutt versions as of mutt 0.93.) The package doesn't use any formal database libraries or languages, although it should be quite easy to extend it to use, e.g., an installed PostgreSQL server as it's back end. For querying the Little Brother, just type `lbdbq `. lbdbq will now attempt to invoke various modules to gather information about persons matching ``. E.g., it may look at a list of addresses from which you have received mail, it may look at YP maps, or it may try to finger `@`. The behavior is configurable: Upon startup, lbdbq will source the shell scripts - `/usr/local/etc/lbdb.rc` (or where your sysconfdir points to) - `$XDG_CONFIG_HOME/lbdb/config` - `$HOME/.lbdbrc` - `$HOME/.lbdb/lbdbrc` - `$HOME/.lbdb/rc` if they exist. They can be used to set the following global variables: - `MODULES_PATH`: Where lbdbq should look for modules - `METHODS`: What modules to use. - `SORT_OUTPUT`: Set this to "false" or "no" and lbdbq won't sort the addresses but returns them in reverse order (which means that the most recent address in m_inmail database is first). If you set this to "name", lbdbq sorts the output by real name. If you set this to "comment", it sort the output by the comment (for example the date in m_inmail). If you set this to "address", lbdbq sorts the output by addresses (that's the default). Note that there _are_ defaults, so you should most probably modify these variables using constructs like this: ``` MODULES_PATH="MODULES_PATH $HOME/lbdb_modules" ``` Additionally, modules may have configuration variables of their own. Currently the following modules are supplied with lbdb: Modules ------- ### m_finger This module will use finger to find out something more about a person. The list of hosts do be asked is configurable; use the `M_FINGER_HOSTS` variable. Note that "localhost" will mean an invocation of your local finger(1) binary, and should thus work even if you don't provide the finger service to the network. m_finger tries to find out the machines mail domain name in /etc/mailname, by parsing a sendmail.cf file (if it finds one) and by reading /etc/hostname and /etc/HOSTNAME. ### m_inmail This module will look up user name fragments in a list of mail addresses. To create this list, put the following lines into your \$HOME/.procmailrc: ``` :0hc | lbdb-fetchaddr ``` This will pipe a copy of every mail message you receive through a small C program lbdb-fetchaddr(1) which grabs that message's "From:" header. ### m_passwd This module searches for matching entries in your local /etc/passwd file. It evaluates the local machine mail domain in the same way m_finger does. If you set PASSWD_IGNORESYS=true, this module ignores all system accounts and only finds UIDs between 1000 and 29999 (all other UIDs are reserved on a Debian system). ### m_yppasswd This module searches for matching entries in the NIS password database using the command `ypcat passwd`. ### m_nispasswd This module searches for matching entries in the NIS+ password database using the command `niscat passwd.org_dir`. ### m_getent This module searches for matching entries in whatever password database is configured using the command `getent passwd`. ### m_pgp2, m_pgp5, m_gpg These modules scan your PGP 2.*, PGP 5.* or GnuPG public key ring for data. They use the programs pgp, pgpk, or [gpg](http://www.gnupg.org) to get the data. ### m_fido This module searches your Fido nodelist, stored in $HOME/.lbdb/nodelist created by nodelist2lbdb(1). ### m_abook This module uses the program [abook](http://abook.sourceforge.net/), a text based address book application to search for addresses. You can define multiple abook address books by setting the variable ABOOK_FILES to a space separated list. ### m_goobook This module uses the program [goobook](https://pypi.python.org/pypi/goobook), a program to access your Google contacts via command line client. ### m_addr_email This module uses the program addr-email from the [addressbook](https://web.archive.org/web/20121020003335/http://www.red.roses.de:80/~clemens/addressbook/) Tk address database program to search for addresses. ### m_muttalias This module searches the variable `$MUTTALIAS_FILES` (a space separated list) of files in `$MUTT_DIRECTORY` that contain [Mutt](../mutt/) aliases. File names without leading slash will have `$MUTT_DIRECTORY` (defaults to `$HOME/.mutt` or `$HOME`, if `$HOME/.mutt` does not exist) prepended before the file name. Absolute file names (beginning with `/`) will be taken direct. ### m_pine This module searches [pine](http://www.washington.edu/pine/) addressbook files for aliases. To realize this it first inspects the variable `$PINERC`. If it isn't set, the default `"/etc/pine.conf /etc/pine.conf.fixed .pinerc"` is used. To suppress inspecting the `$PINERC` variable, set it to `"no"`. It than takes all `address-book` and `global-address-book` entries from these pinerc files and adds the contents of the variable `$PINE_ADDRESSBOOKS` to the list, which defaults to `"/etc/addressbook .addressbook"`. Then these addressbooks are searched for aliases. All filenames without leading slash are searched in `$HOME`. ### m_palm This module searches the Palm address database using the Palm::PDB and Palm::Address Perl modules from [CPAN](http://www.cpan.org/). It searches in the variable `$PALM_ADDRESS_DATABASE` or if this isn't set in `$HOME/.jpilot/AddressDB.pdb`. ### m_gnomecard This module searches for addresses in your GnomeCard database files. The variable `GNOMECARD_FILES` is a whitespace separated list of GnomeCard data files. If this variable isn't defined, the module searches in `$HOME/.gnome/GnomeCard` for the GnomeCard database or at least falls back to `$HOME/.gnome/GnomeCard.gcrd`. If a filename does not start with a slash, it is prefixed with `$HOME/`. ### m_bbdb This module searches for addresses in your (X)Emacs [BBDB](http://bbdb.sourceforge.net/) (big brother database). It doesn't access `~/.bbdb` directly (yet) but calls (x)emacs with a special mode to get the information (so don't expect too much performance in this module). You can configure the `EMACS` variable to tell this module which emacsen to use. Otherwise it will fall back to emacs or xemacs. ### m_ldap This module queries an LDAP server using the Net::LDAP Perl modules from [CPAN](http://www.cpan.org/). It can be configured using an external resource file (for more details please refer to the mutt_ldap_query(1) manual page). ### m_wanderlust This module searches for addresses stored in your `$WANDERLUST_ADDRESSES` (or by default in `$HOME/.addresses`) file, an addressbook of [WanderLust](http://www.gohome.org/wl/). ### m_osx_addressbook This module queries the OS X AddressBook. It is only available on OS X systems. ### m_evolution This module queries the Ximian Evolution address book using the evolution-addressbook-export application. ### m_vcf This module uses a bundled little perl program named vcquery to search for addresses from the space-separated set of vCard files defined in `$VCF_FILES`. ### m_khard This module searches a CardDAV address book via [khard](https://github.com/scheibler/khard). ### m_mu This module uses the program [mu](http://www.djcbsoftware.nl/code/mu/), a tool for indexing and searching Maildir directories. You can set `MU_AFTER` to a timestamp value and `MU_PERSONAL` to "yes" or "true" to filter the results. ----- Feel free to create your own modules to query other kind of databases. `m_finger` should be a good example of how to do it. If you create your own modules or have other changes and feel that they could be helpful for others, don't hesitate to submit them to me for inclusion in later releases. For more information have a look at the lbdbq(1) man page, which is included in the package. Download and Repository: ------------------------ - [Download page](https://www.spinnaker.de/lbdb/download) - [Changelog](https://www.spinnaker.de/lbdb/changelog) - [Debian package](https://www.spinnaker.de/debian/lbdb.html) - [Git repository](https://github.com/RolandRosenfeld/lbdb) Credits: -------- This package was initially written by Thomas Roessler . Most of the really interesting code of this program (namely, the RFC 822 address parser used by lbdb-fetchaddr) was stolen from Michael Elkins [mutt](http://www.mutt.org) mail user agent. Additional credits go to Brandon Long for putting the [query](http://www.mutt.org/doc/manual/#query) functionality into mutt. Many thanks to the authors of the several modules and extensions: - Ross Campbell (m_abook, m_yppasswd) - Marc de Courville (m_ldap, mutt_ldap_query) - Brendan Cully (m_osx_addressbook, m_vcf) - Gabor Fleischer (m_pine) - Rick Frankel (m_gnomecard) - Guido Guenther (m_evolution) - Utz-Uwe Haus (m_bbdb, m_nispasswd) - Torsten Jerzembeck (m_addr_email) - Gergely Nagy (m_wanderlust) - Dave Pearson (m_palm, lbdb.el) - Brian Salter-Duke (m_muttalias) - François Charlier (m_goobook) - Colin Watson (m_khard) - Timothy Bourke (m_mu) lbdb-0.54/TODO000066400000000000000000000016361465114770000130500ustar00rootroot00000000000000- fetchaddr: Find out why fetchaddr sometimes runs forever on Solaris 2.6. - Add man page for configuration file lbdbrc(5) or something like this. - Think about a debug/log mechanism for lbdbq and the modules, so an error in a module doesn't imply lbdbq to fail but all other modules work as usual and the error messages (and debug informations) are written to the logfile (maybe ~/.lbdb/debug). - replace m_passwd and m_yppasswd by m_getent, if getent(1) is supported by all UNIXes. Otherwise we need some autoconf magic to do the right thing... - Optimize munge/munge-keeporder to work case-insensitive (at least on the domain part of the addresses). - Add support for "notmuchmail". - Add testsuite. - Run shellcheck on all sh scripts and fix warnings. - Support DEB_BUILD_OPTIONS nodoc (using debhelper >= 10.6) - Write tests for lbdb-fetchaddr / m_inmail. Roland Rosenfeld lbdb-0.54/aclocal.m4000066400000000000000000001535561465114770000142310ustar00rootroot00000000000000# generated automatically by aclocal 1.15 -*- Autoconf -*- # Copyright (C) 1996-2014 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) # iconv.m4 serial 19 (gettext-0.18.2) dnl Copyright (C) 2000-2002, 2007-2014, 2016 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], [ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_LIB_LINKFLAGS_BODY([iconv]) ]) AC_DEFUN([AM_ICONV_LINK], [ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and dnl those with the standalone portable GNU libiconv installed). AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) dnl Add $INCICONV to CPPFLAGS before performing the following checks, dnl because if the user has installed libiconv and not disabled its use dnl via --without-libiconv-prefix, he wants to use it. The first dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed. am_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include #include ]], [[iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);]])], [am_cv_func_iconv=yes]) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include #include ]], [[iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);]])], [am_cv_lib_iconv=yes] [am_cv_func_iconv=yes]) LIBS="$am_save_LIBS" fi ]) if test "$am_cv_func_iconv" = yes; then AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [ dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11, dnl Solaris 10. am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi am_cv_func_iconv_works=no for ac_iconv_const in '' 'const'; do AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[ #include #include #ifndef ICONV_CONST # define ICONV_CONST $ac_iconv_const #endif ]], [[int result = 0; /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 1; iconv_close (cd_utf8_to_88591); } } /* Test against Solaris 10 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); if (cd_ascii_to_88591 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\263"; char buf[10]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_ascii_to_88591, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 2; iconv_close (cd_ascii_to_88591); } } /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ { iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\304"; static char buf[2] = { (char)0xDE, (char)0xAD }; ICONV_CONST char *inptr = input; size_t inbytesleft = 1; char *outptr = buf; size_t outbytesleft = 1; size_t res = iconv (cd_88591_to_utf8, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) result |= 4; iconv_close (cd_88591_to_utf8); } } #if 0 /* This bug could be worked around by the caller. */ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ { iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) result |= 8; iconv_close (cd_88591_to_utf8); } } #endif /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is provided. */ if (/* Try standardized names. */ iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) /* Try IRIX, OSF/1 names. */ && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) /* Try AIX names. */ && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) /* Try HP-UX names. */ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) result |= 16; return result; ]])], [am_cv_func_iconv_works=yes], , [case "$host_os" in aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; *) am_cv_func_iconv_works="guessing yes" ;; esac]) test "$am_cv_func_iconv_works" = no || break done LIBS="$am_save_LIBS" ]) case "$am_cv_func_iconv_works" in *no) am_func_iconv=no am_cv_lib_iconv=no ;; *) am_func_iconv=yes ;; esac else am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then AC_DEFINE([HAVE_ICONV], [1], [Define if you have the iconv() function and it works.]) fi if test "$am_cv_lib_iconv" = yes; then AC_MSG_CHECKING([how to link with libiconv]) AC_MSG_RESULT([$LIBICONV]) else dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV dnl either. CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi AC_SUBST([LIBICONV]) AC_SUBST([LTLIBICONV]) ]) dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to dnl avoid warnings like dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required". dnl This is tricky because of the way 'aclocal' is implemented: dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN. dnl Otherwise aclocal's initial scan pass would miss the macro definition. dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions. dnl Otherwise aclocal would emit many "Use of uninitialized value $1" dnl warnings. m4_define([gl_iconv_AC_DEFUN], m4_version_prereq([2.64], [[AC_DEFUN_ONCE( [$1], [$2])]], [m4_ifdef([gl_00GNULIB], [[AC_DEFUN_ONCE( [$1], [$2])]], [[AC_DEFUN( [$1], [$2])]])])) gl_iconv_AC_DEFUN([AM_ICONV], [ AM_ICONV_LINK if test "$am_cv_func_iconv" = yes; then AC_MSG_CHECKING([for iconv declaration]) AC_CACHE_VAL([am_cv_proto_iconv], [ AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif ]], [[]])], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"]) am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` AC_MSG_RESULT([ $am_cv_proto_iconv]) AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1], [Define as const if the declaration of iconv() needs const.]) dnl Also substitute ICONV_CONST in the gnulib generated . m4_ifdef([gl_ICONV_H_DEFAULTS], [AC_REQUIRE([gl_ICONV_H_DEFAULTS]) if test -n "$am_cv_proto_iconv_arg1"; then ICONV_CONST="const" fi ]) fi ]) # lib-ld.m4 serial 6 dnl Copyright (C) 1996-2003, 2009-2016 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Subroutines of libtool.m4, dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid dnl collision with libtool.m4. dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no. AC_DEFUN([AC_LIB_PROG_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld], [# I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 /dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. 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([acl_cv_path_LD], [if test -z "$LD"; then acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$acl_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 = 1.10 to complain if config.rpath is missing. m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done ]) wl="$acl_cv_wl" acl_libext="$acl_cv_libext" acl_shlibext="$acl_cv_shlibext" acl_libname_spec="$acl_cv_libname_spec" acl_library_names_spec="$acl_cv_library_names_spec" acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" acl_hardcode_direct="$acl_cv_hardcode_direct" acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" dnl Determine whether the user wants rpath handling at all. AC_ARG_ENABLE([rpath], [ --disable-rpath do not hardcode runtime library paths], :, enable_rpath=yes) ]) dnl AC_LIB_FROMPACKAGE(name, package) dnl declares that libname comes from the given package. The configure file dnl will then not have a --with-libname-prefix option but a dnl --with-package-prefix option. Several libraries can come from the same dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar dnl macro call that searches for libname. AC_DEFUN([AC_LIB_FROMPACKAGE], [ pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) define([acl_frompackage_]NAME, [$2]) popdef([NAME]) pushdef([PACK],[$2]) pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) define([acl_libsinpackage_]PACKUP, m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1]) popdef([PACKUP]) popdef([PACK]) ]) dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_LINKFLAGS_BODY], [ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])]) pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])]) dnl Autoconf >= 2.61 supports dots in --with options. pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_ARG_WITH(P_A_C_K[-prefix], [[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" if test "$acl_libdirstem2" != "$acl_libdirstem" \ && ! test -d "$withval/$acl_libdirstem"; then additional_libdir="$withval/$acl_libdirstem2" fi fi fi ]) dnl Search the library and its dependencies in $additional_libdir and dnl $LDFLAGS. Using breadth-first-seach. LIB[]NAME= LTLIB[]NAME= INC[]NAME= LIB[]NAME[]_PREFIX= dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been dnl computed. So it has to be reset here. HAVE_LIB[]NAME= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='$1 $2' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" dnl See if it was already located by an earlier AC_LIB_LINKFLAGS dnl or AC_LIB_HAVE_LINKFLAGS call. uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" else dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined dnl that this library doesn't exist. So just drop it. : fi else dnl Search the library lib$name in $additional_libdir and $LDFLAGS dnl and the already constructed $LIBNAME/$LTLIBNAME. found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" dnl The same code as in the loop below: dnl First look for a shared library. if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi dnl Then look for a static library. if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` dnl First look for a shared library. if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi dnl Then look for a static library. if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then dnl Found the library. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then dnl Linking with a shared library. We attempt to hardcode its dnl directory into the executable's runpath, unless it's the dnl standard /usr/lib. if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then dnl No hardcoding is needed. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl Use an explicit option to hardcode DIR into the resulting dnl binary. dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi dnl The hardcoding into $LIBNAME is system dependent. if test "$acl_hardcode_direct" = yes; then dnl Using DIR/libNAME.so during linking hardcodes DIR into the dnl resulting binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode DIR into the resulting dnl binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else dnl Rely on "-L$found_dir". dnl But don't add it if it's already contained in the LDFLAGS dnl or the already constructed $LIBNAME haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH dnl here, because this doesn't fit in flags passed to the dnl compiler. So give up. No hardcoding. This affects only dnl very old systems. dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then dnl Linking with a static library. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" else dnl We shouldn't come here, but anyway it's good to have a dnl fallback. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" fi fi dnl Assume the include files are nearby. additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` if test "$name" = '$1'; then LIB[]NAME[]_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem2 | */$acl_libdirstem2/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` if test "$name" = '$1'; then LIB[]NAME[]_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then dnl Potentially add $additional_includedir to $INCNAME. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's /usr/local/include and we are using GCC on Linux, dnl 3. if it's already present in $CPPFLAGS or the already dnl constructed $INCNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INC[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $INCNAME. INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" fi fi fi fi fi dnl Look for dependencies. if test -n "$found_la"; then dnl Read the .la file. It defines the variables dnl dlname, library_names, old_library, dependency_libs, current, dnl age, revision, installed, dlopen, dlpreopen, libdir. save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" dnl We use only dependency_libs. for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's /usr/local/lib and we are using GCC on Linux, dnl 3. if it's already present in $LDFLAGS or the already dnl constructed $LIBNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LIBNAME. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LTLIBNAME. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) dnl Handle this in the next round. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) dnl Handle this in the next round. Throw away the .la's dnl directory; it is already contained in a preceding -L dnl option. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) dnl Most likely an immediate library name. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" ;; esac done fi else dnl Didn't find the library; assume it is in the system directories dnl known to the linker and runtime loader. (All the system dnl directories known to the linker should also be known to the dnl runtime loader, otherwise the system is severely misconfigured.) LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user must dnl pass all path elements in one option. We can arrange that for a dnl single library, but not when more than one $LIBNAMEs are used. alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl. acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" else dnl The -rpath options are cumulative. for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then dnl When using libtool, the option that works for both libraries and dnl executables is -R. The -R options are cumulative. for found_dir in $ltrpathdirs; do LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" done fi popdef([P_A_C_K]) popdef([PACKLIBS]) popdef([PACKUP]) popdef([PACK]) popdef([NAME]) ]) dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, dnl unless already present in VAR. dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes dnl contains two or three consecutive elements that belong together. AC_DEFUN([AC_LIB_APPENDTOVAR], [ for element in [$2]; do haveit= for x in $[$1]; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then [$1]="${[$1]}${[$1]:+ }$element" fi done ]) dnl For those cases where a variable contains several -L and -l options dnl referring to unknown libraries and directories, this macro determines the dnl necessary additional linker options for the runtime path. dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL]) dnl sets LDADDVAR to linker options needed together with LIBSVALUE. dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed, dnl otherwise linking without libtool is assumed. AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], [ AC_REQUIRE([AC_LIB_RPATH]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) $1= if test "$enable_rpath" != no; then if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode directories into the resulting dnl binary. rpathdirs= next= for opt in $2; do if test -n "$next"; then dir="$next" dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem" \ && test "X$dir" != "X/usr/$acl_libdirstem2"; then rpathdirs="$rpathdirs $dir" fi next= else case $opt in -L) next=yes ;; -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem" \ && test "X$dir" != "X/usr/$acl_libdirstem2"; then rpathdirs="$rpathdirs $dir" fi next= ;; *) next= ;; esac fi done if test "X$rpathdirs" != "X"; then if test -n ""$3""; then dnl libtool is used for linking. Use -R options. for dir in $rpathdirs; do $1="${$1}${$1:+ }-R$dir" done else dnl The linker is used for linking directly. if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user dnl must pass all path elements in one option. alldirs= for dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="$flag" else dnl The -rpath options are cumulative. for dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="${$1}${$1:+ }$flag" done fi fi fi fi fi AC_SUBST([$1]) ]) # lib-prefix.m4 serial 7 (gettext-0.18) dnl Copyright (C) 2001-2005, 2008-2016 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't dnl require excessive bracketing. ifdef([AC_HELP_STRING], [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed dnl to access previously installed libraries. The basic assumption is that dnl a user will want packages to use other packages he previously installed dnl with the same --prefix option. dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate dnl libraries, but is otherwise very convenient. AC_DEFUN([AC_LIB_PREFIX], [ AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_LIB_ARG_WITH([lib-prefix], [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib --without-lib-prefix don't search for libraries in includedir and libdir], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" fi fi ]) if test $use_additional = yes; then dnl Potentially add $additional_includedir to $CPPFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's already present in $CPPFLAGS, dnl 3. if it's /usr/local/include and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= for x in $CPPFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $CPPFLAGS. CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" fi fi fi fi dnl Potentially add $additional_libdir to $LDFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's already present in $LDFLAGS, dnl 3. if it's /usr/local/lib and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then haveit= for x in $LDFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LDFLAGS. LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" fi fi fi fi fi ]) dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, dnl acl_final_exec_prefix, containing the values to which $prefix and dnl $exec_prefix will expand at the end of the configure script. AC_DEFUN([AC_LIB_PREPARE_PREFIX], [ dnl Unfortunately, prefix and exec_prefix get only finally determined dnl at the end of configure. if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" ]) dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the dnl variables prefix and exec_prefix bound to the values they will have dnl at the end of the configure script. AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], [ acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" $1 exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" ]) dnl AC_LIB_PREPARE_MULTILIB creates dnl - a variable acl_libdirstem, containing the basename of the libdir, either dnl "lib" or "lib64" or "lib/64", dnl - a variable acl_libdirstem2, as a secondary possible value for dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or dnl "lib/amd64". AC_DEFUN([AC_LIB_PREPARE_MULTILIB], [ dnl There is no formal standard regarding lib and lib64. dnl On glibc systems, the current practice is that on a system supporting dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine dnl the compiler's default mode by looking at the compiler's library search dnl path. If at least one of its elements ends in /lib64 or points to a dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI. dnl Otherwise we use the default, namely "lib". dnl On Solaris systems, the current practice is that on a system supporting dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib. AC_REQUIRE([AC_CANONICAL_HOST]) acl_libdirstem=lib acl_libdirstem2= case "$host_os" in solaris*) dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment dnl . dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link." dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the dnl symlink is missing, so we set acl_libdirstem2 too. AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit], [AC_EGREP_CPP([sixtyfour bits], [ #ifdef _LP64 sixtyfour bits #endif ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no]) ]) if test $gl_cv_solaris_64bit = yes; then acl_libdirstem=lib/64 case "$host_cpu" in sparc*) acl_libdirstem2=lib/sparcv9 ;; i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; esac fi ;; *) searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test -n "$searchpath"; then acl_save_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; */../ | */.. ) # Better ignore directories of this form. They are misleading. ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib64 ) acl_libdirstem=lib64 ;; esac ;; esac fi done IFS="$acl_save_IFS" fi ;; esac test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" ]) lbdb-0.54/config.guess000077500000000000000000001256441465114770000147060ustar00rootroot00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2016 Free Software Foundation, Inc. timestamp='2016-10-02' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; esac # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ /sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || \ echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` machine=${arch}${endian}-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. case "${UNAME_MACHINE_ARCH}" in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # Determine ABI tags. case "${UNAME_MACHINE_ARCH}" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; *:Sortix:*:*) echo ${UNAME_MACHINE}-unknown-sortix exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") UNAME_MACHINE=alpha ;; "EV5 (21164)") UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/lslpp ] ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = hppa2.0w ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH=hppa2.0w else HP_ARCH=hppa64 fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; e2k:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; k1om:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; mips64el:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-${LIBC} exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; riscv32:Linux:*:* | riscv64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; SX-ACE:SUPER-UX:*:*) echo sxace-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; amd64:Isilon\ OneFS:*:*) echo x86_64-unknown-onefs exit ;; esac cat >&2 </dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: lbdb-0.54/config.rpath000066400000000000000000000000001465114770000146450ustar00rootroot00000000000000lbdb-0.54/config.sub000077500000000000000000001067631465114770000143520ustar00rootroot00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2016 Free Software Foundation, Inc. timestamp='2016-11-04' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ kopensolaris*-gnu* | cloudabi*-eabi* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | ba \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | e2k | epiphany \ | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pru \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; leon|leon[3-9]) basic_machine=sparc-$basic_machine ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pru-* \ | pyramid-* \ | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; asmjs) basic_machine=asmjs-unknown ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; e500v[12]) basic_machine=powerpc-unknown os=$os"spe" ;; e500v[12]-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` os=$os"spe" ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; leon-*|leon[3-9]-*) basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; moxiebox) basic_machine=moxie-unknown os=-moxiebox ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ | -onefs* | -tirtos* | -phoenix* | -fuchsia*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -ios) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: lbdb-0.54/configure000077500000000000000000007336321465114770000142770ustar00rootroot00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.71 for lbdb 0.54. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, # Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="as_nop=: if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else \$as_nop case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ) then : else \$as_nop exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 blah=\$(echo \$(echo blah)) test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null then : as_have_required=yes else $as_nop as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$as_shell as_have_required=yes if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null then : break 2 fi fi done;; esac as_found=false done IFS=$as_save_IFS if $as_found then : else $as_nop if { test -f "$SHELL" || test -f "$SHELL.exe"; } && as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes fi fi if test "x$CONFIG_SHELL" != x then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno then : printf "%s\n" "$0: This script requires a shell more modern than all" printf "%s\n" "$0: the shells that I found on your system." if test ${ZSH_VERSION+y} ; then printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and $0: roland@spinnaker.de about your system, including any $0: error possibly output before this message. Then install $0: a modern shell, or manually run the script under such a $0: shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_nop # --------- # Do nothing but, unlike ":", preserve the value of $?. as_fn_nop () { return $? } as_nop=as_fn_nop # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else $as_nop as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null then : eval 'as_fn_arith () { as_val=$(( $* )) }' else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_nop # --------- # Do nothing but, unlike ":", preserve the value of $?. as_fn_nop () { return $? } as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" 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='lbdb' PACKAGE_TARNAME='lbdb' PACKAGE_VERSION='0.54' PACKAGE_STRING='lbdb 0.54' PACKAGE_BUGREPORT='roland@spinnaker.de' PACKAGE_URL='https://www.spinnaker.de/lbdb/' ac_unique_file="fetchaddr.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_header_c_list= ac_subst_vars='LTLIBOBJS LIBOBJS AUTOM4TE MODULES LBDB_ELPA_VERSION LBDB_VERSION SYSCONF_DIR PBXBUILD XCODEBUILD PERL MU KHARD EVOLUTION_ADDRESSBOOK_EXPORT PGP PGPK GPG GETENT NISCAT YPCAT ADDR_EMAIL GOOBOOK ABOOK FINGER path_fetchaddr DOTLOCKBASE DOTLOCK_TARGET DOTLOCK DOTLOCK_OLD TACTARGET TAC NAWK GAWK MAWK AWK SH BINSH KSH BASH LTLIBICONV LIBICONV EGREP GREP CPP host_os host_vendor host_cpu host build_os build_vendor build_cpu build INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking with_gnu_ld enable_rpath with_libiconv_prefix enable_lbdb_dotlock with_finger with_abook with_goobook with_addr_email with_ypcat with_niscat with_getent with_gpg with_pgpk with_pgp with_evolution_addressbook_export with_khard with_mu ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures lbdb 0.54 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/lbdb] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of lbdb 0.54:";; 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] --disable-rpath do not hardcode runtime library paths (--enable-lbdb-dotlock, Force use of lbdb_dotlock program) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib --without-libiconv-prefix don't search for libiconv in includedir and libdir --with-finger with finger support --with-abook with abook support --with-goobook with goobook support --with-addr-email with addressbook support --with-ypcat with ypcat passwd support --with-niscat with niscat passwd support --with-getent with getent passwd support --with-gpg with GnuPG support --with-pgpk with PGP 5.* support --with-pgp with PGP 2.* support --with-evolution-addressbook-export with Evolution support ('auto' searchs at runtime) --with-khard with khard support --with-mu with mu (maildir-utils) support 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 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 . lbdb home page: . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for configure.gnu first; this name is used for a wrapper for # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF lbdb configure 0.54 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" else $as_nop eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err } then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext } then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_try_run LINENO # ---------------------- # Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that # executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: program exited with status $ac_status" >&5 printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run ac_configure_args_raw= for ac_arg do case $ac_arg in *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append ac_configure_args_raw " '$ac_arg'" done case $ac_configure_args_raw in *$as_nl*) ac_safe_unquote= ;; *) ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. ac_unsafe_a="$ac_unsafe_z#~" ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; esac cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by lbdb $as_me 0.54, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Sanitize IFS. IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && printf "%s\n" "$as_me: caught signal $ac_signal" printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi for ac_site_file in $ac_site_files do case $ac_site_file in #( */*) : ;; #( *) : ac_site_file=./$ac_site_file ;; esac if test -f "$ac_site_file" && test -r "$ac_site_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Test code for whether the C compiler supports C89 (global declarations) ac_c_conftest_c89_globals=' /* Does the compiler advertise C89 conformance? Do not test the value of __STDC__, because some compilers set it to 0 while being otherwise adequately conformant. */ #if !defined __STDC__ # error "Compiler does not advertise C89 conformance" #endif #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not \xHH hex character constants. These do not provoke an error unfortunately, instead are silently treated as an "x". The following induces an error, until -std is added to get proper ANSI mode. Curiously \x00 != x always comes out true, for an array size at least. It is necessary to write \x00 == 0 to get something that is true only with -std. */ int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) '\''x'\'' int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), int, int);' # Test code for whether the C compiler supports C89 (body of main). ac_c_conftest_c89_main=' ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); ' # Test code for whether the C compiler supports C99 (global declarations) ac_c_conftest_c99_globals=' // Does the compiler advertise C99 conformance? #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L # error "Compiler does not advertise C99 conformance" #endif #include extern int puts (const char *); extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare // FILE and stderr. #define debug(...) dprintf (2, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK #error "your preprocessor is broken" #endif #if BIG_OK #else #error "your preprocessor is broken" #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) continue; return 0; } // Check varargs and va_copy. static bool test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str = ""; int number = 0; float fnumber = 0; while (*format) { switch (*format++) { case '\''s'\'': // string str = va_arg (args_copy, const char *); break; case '\''d'\'': // int number = va_arg (args_copy, int); break; case '\''f'\'': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); return *str && number && fnumber; } ' # Test code for whether the C compiler supports C99 (body of main). ac_c_conftest_c99_main=' // Check bool. _Bool success = false; success |= (argc != 0); // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[0] = argv[0][0]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' || dynamic_array[ni.number - 1] != 543); ' # Test code for whether the C compiler supports C11 (global declarations) ac_c_conftest_c11_globals=' // Does the compiler advertise C11 conformance? #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L # error "Compiler does not advertise C11 conformance" #endif // Check _Alignas. char _Alignas (double) aligned_as_double; char _Alignas (0) no_special_alignment; extern char aligned_as_int; char _Alignas (0) _Alignas (int) aligned_as_int; // Check _Alignof. enum { int_alignment = _Alignof (int), int_array_alignment = _Alignof (int[100]), char_alignment = _Alignof (char) }; _Static_assert (0 < -_Alignof (int), "_Alignof is signed"); // Check _Noreturn. int _Noreturn does_not_return (void) { for (;;) continue; } // Check _Static_assert. struct test_static_assert { int x; _Static_assert (sizeof (int) <= sizeof (long int), "_Static_assert does not work in struct"); long int y; }; // Check UTF-8 literals. #define u8 syntax error! char const utf8_literal[] = u8"happens to be ASCII" "another string"; // Check duplicate typedefs. typedef long *long_ptr; typedef long int *long_ptr; typedef long_ptr long_ptr; // Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. struct anonymous { union { struct { int i; int j; }; struct { int k; long int l; } w; }; int m; } v1; ' # Test code for whether the C compiler supports C11 (body of main). ac_c_conftest_c11_main=' _Static_assert ((offsetof (struct anonymous, i) == offsetof (struct anonymous, w.k)), "Anonymous union alignment botch"); v1.i = 2; v1.w.k = 5; ok |= v1.i != 5; ' # Test code for whether the C compiler supports C11 (complete). ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} ${ac_c_conftest_c11_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} ${ac_c_conftest_c11_main} return ok; } " # Test code for whether the C compiler supports C99 (complete). ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} return ok; } " # Test code for whether the C compiler supports C89 (complete). ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} return ok; } " as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" # Auxiliary files required by this configure script. ac_aux_files="config.rpath config.guess config.sub install-sh" # Locations in which to look for auxiliary files. ac_aux_dir_candidates="${srcdir}${PATH_SEPARATOR}${srcdir}/..${PATH_SEPARATOR}${srcdir}/../.." # Search for a directory containing all of the required auxiliary files, # $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. # If we don't find one directory that contains all the files we need, # we report the set of missing files from the *first* directory in # $ac_aux_dir_candidates and give up. ac_missing_aux_files="" ac_first_candidate=: printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in $ac_aux_dir_candidates do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac as_found=: printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 ac_aux_dir_found=yes ac_install_sh= for ac_aux in $ac_aux_files do # As a special case, if "install-sh" is required, that requirement # can be satisfied by any of "install-sh", "install.sh", or "shtool", # and $ac_install_sh is set appropriately for whichever one is found. if test x"$ac_aux" = x"install-sh" then if test -f "${as_dir}install-sh"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 ac_install_sh="${as_dir}install-sh -c" elif test -f "${as_dir}install.sh"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 ac_install_sh="${as_dir}install.sh -c" elif test -f "${as_dir}shtool"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 ac_install_sh="${as_dir}shtool install -c" else ac_aux_dir_found=no if $ac_first_candidate; then ac_missing_aux_files="${ac_missing_aux_files} install-sh" else break fi fi else if test -f "${as_dir}${ac_aux}"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 else ac_aux_dir_found=no if $ac_first_candidate; then ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" else break fi fi fi done if test "$ac_aux_dir_found" = yes; then ac_aux_dir="$as_dir" break fi ac_first_candidate=false as_found=false done IFS=$as_save_IFS if $as_found then : else $as_nop as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. if test -f "${ac_aux_dir}config.guess"; then ac_config_guess="$SHELL ${ac_aux_dir}config.guess" fi if test -f "${ac_aux_dir}config.sub"; then ac_config_sub="$SHELL ${ac_aux_dir}config.sub" fi if test -f "$ac_aux_dir/configure"; then ac_configure="$SHELL ${ac_aux_dir}configure" fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for prefix" >&5 printf %s "checking for prefix... " >&6; } if test x$prefix = xNONE; then lbdb_cv_prefix=$ac_default_prefix else lbdb_cv_prefix=$prefix fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lbdb_cv_prefix" >&5 printf "%s\n" "$lbdb_cv_prefix" >&6; } ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. set dummy ${ac_tool_prefix}clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "clang", so it can be a program name with args. set dummy clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi fi test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 printf %s "checking whether the C compiler works... " >&6; } ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else $as_nop ac_file='' fi if test -z "$ac_file" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 printf %s "checking for C compiler default output file name... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 printf "%s\n" "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else $as_nop { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 printf "%s\n" "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 printf %s "checking for suffix of object files... " >&6; } if test ${ac_cv_objext+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes else $as_nop ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 else $as_nop ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes else $as_nop CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else $as_nop ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi ac_prog_cc_stdc=no if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c11_program _ACEOF for ac_arg in '' -std=gnu11 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } CC="$CC $ac_cv_prog_cc_c11" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 ac_prog_cc_stdc=c11 fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c99_program _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } CC="$CC $ac_cv_prog_cc_c99" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 ac_prog_cc_stdc=c99 fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c89_program _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } CC="$CC $ac_cv_prog_cc_c89" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 ac_prog_cc_stdc=c89 fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 printf %s "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test ${ac_cv_path_install+y} then : printf %s "(cached) " >&6 else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac # Account for fact that we put trailing slashes in our PATH walk. case $as_dir in #(( ./ | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test ${ac_cv_path_install+y}; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 printf "%s\n" "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' ac_header= ac_cache= for ac_item in $ac_header_c_list do if test $ac_cache; then ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then printf "%s\n" "#define $ac_item 1" >> confdefs.h fi ac_header= ac_cache= elif test $ac_header; then ac_cache=$ac_item else ac_header=$ac_item fi done if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes then : printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "getopt.h" "ac_cv_header_getopt_h" "$ac_includes_default" if test "x$ac_cv_header_getopt_h" = xyes then : printf "%s\n" "#define HAVE_GETOPT_H 1" >>confdefs.h fi # Make sure we can run config.sub. $SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 printf %s "checking build system type... " >&6; } if test ${ac_cv_build+y} then : printf %s "(cached) " >&6 else $as_nop ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 printf "%s\n" "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 printf %s "checking host system type... " >&6; } if test ${ac_cv_host+y} then : printf %s "(cached) " >&6 else $as_nop if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 printf "%s\n" "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" # Check whether --with-gnu-ld was given. if test ${with_gnu_ld+y} then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else $as_nop with_gnu_ld=no fi # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which # contains only /bin. Note that ksh looks also at the FPATH variable, # so we have to set that as well for the test. PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 printf %s "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'` while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 printf %s "checking for GNU ld... " >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 printf %s "checking for non-GNU ld... " >&6; } fi if test ${acl_cv_path_LD+y} then : printf %s "(cached) " >&6 else $as_nop if test -z "$LD"; then acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$acl_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 &5 printf "%s\n" "$LD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 printf %s "checking if the linker ($LD) is GNU ld... " >&6; } if test ${acl_cv_prog_gnu_ld+y} then : printf %s "(cached) " >&6 else $as_nop # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 printf "%s\n" "$acl_cv_prog_gnu_ld" >&6; } with_gnu_ld=$acl_cv_prog_gnu_ld { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 printf %s "checking for shared library run path origin... " >&6; } if test ${acl_cv_rpath+y} then : printf %s "(cached) " >&6 else $as_nop CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 printf "%s\n" "$acl_cv_rpath" >&6; } wl="$acl_cv_wl" acl_libext="$acl_cv_libext" acl_shlibext="$acl_cv_shlibext" acl_libname_spec="$acl_cv_libname_spec" acl_library_names_spec="$acl_cv_library_names_spec" acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" acl_hardcode_direct="$acl_cv_hardcode_direct" acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" # Check whether --enable-rpath was given. if test ${enable_rpath+y} then : enableval=$enable_rpath; : else $as_nop enable_rpath=yes fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 printf %s "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test ${ac_cv_prog_CPP+y} then : printf %s "(cached) " >&6 else $as_nop # Double quotes because $CC needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO" then : else $as_nop # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else $as_nop # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 printf "%s\n" "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO" then : else $as_nop # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else $as_nop # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : else $as_nop { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 printf %s "checking for grep that handles long lines and -e... " >&6; } if test ${ac_cv_path_GREP+y} then : printf %s "(cached) " >&6 else $as_nop if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in grep ggrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 printf "%s\n" "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 printf %s "checking for egrep... " >&6; } if test ${ac_cv_path_EGREP+y} then : printf %s "(cached) " >&6 else $as_nop if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in egrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 printf "%s\n" "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" acl_libdirstem=lib acl_libdirstem2= case "$host_os" in solaris*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5 printf %s "checking for 64-bit host... " >&6; } if test ${gl_cv_solaris_64bit+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef _LP64 sixtyfour bits #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "sixtyfour bits" >/dev/null 2>&1 then : gl_cv_solaris_64bit=yes else $as_nop gl_cv_solaris_64bit=no fi rm -rf conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_solaris_64bit" >&5 printf "%s\n" "$gl_cv_solaris_64bit" >&6; } if test $gl_cv_solaris_64bit = yes; then acl_libdirstem=lib/64 case "$host_cpu" in sparc*) acl_libdirstem2=lib/sparcv9 ;; i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; esac fi ;; *) searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test -n "$searchpath"; then acl_save_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; */../ | */.. ) # Better ignore directories of this form. They are misleading. ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib64 ) acl_libdirstem=lib64 ;; esac ;; esac fi done IFS="$acl_save_IFS" fi ;; esac test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libiconv-prefix was given. if test ${with_libiconv_prefix+y} then : withval=$with_libiconv_prefix; if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" if test "$acl_libdirstem2" != "$acl_libdirstem" \ && ! test -d "$withval/$acl_libdirstem"; then additional_libdir="$withval/$acl_libdirstem2" fi fi fi fi LIBICONV= LTLIBICONV= INCICONV= LIBICONV_PREFIX= HAVE_LIBICONV= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='iconv ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" else : fi else found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$acl_hardcode_direct" = yes; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" else LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` if test "$name" = 'iconv'; then LIBICONV_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem2 | */$acl_libdirstem2/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` if test "$name" = 'iconv'; then LIBICONV_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INCICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" fi fi fi fi fi if test -n "$found_la"; then save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" ;; esac done fi else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" done fi am_save_CPPFLAGS="$CPPFLAGS" for element in $INCICONV; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 printf %s "checking for iconv... " >&6; } if test ${am_cv_func_iconv+y} then : printf %s "(cached) " >&6 else $as_nop am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : am_cv_lib_iconv=yes am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 printf "%s\n" "$am_cv_func_iconv" >&6; } if test "$am_cv_func_iconv" = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5 printf %s "checking for working iconv... " >&6; } if test ${am_cv_func_iconv_works+y} then : printf %s "(cached) " >&6 else $as_nop am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi am_cv_func_iconv_works=no for ac_iconv_const in '' 'const'; do if test "$cross_compiling" = yes then : case "$host_os" in aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; *) am_cv_func_iconv_works="guessing yes" ;; esac else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #ifndef ICONV_CONST # define ICONV_CONST $ac_iconv_const #endif int main (void) { int result = 0; /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 1; iconv_close (cd_utf8_to_88591); } } /* Test against Solaris 10 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); if (cd_ascii_to_88591 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\263"; char buf[10]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_ascii_to_88591, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 2; iconv_close (cd_ascii_to_88591); } } /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ { iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\304"; static char buf[2] = { (char)0xDE, (char)0xAD }; ICONV_CONST char *inptr = input; size_t inbytesleft = 1; char *outptr = buf; size_t outbytesleft = 1; size_t res = iconv (cd_88591_to_utf8, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) result |= 4; iconv_close (cd_88591_to_utf8); } } #if 0 /* This bug could be worked around by the caller. */ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ { iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) result |= 8; iconv_close (cd_88591_to_utf8); } } #endif /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is provided. */ if (/* Try standardized names. */ iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) /* Try IRIX, OSF/1 names. */ && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) /* Try AIX names. */ && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) /* Try HP-UX names. */ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) result |= 16; return result; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO" then : am_cv_func_iconv_works=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi test "$am_cv_func_iconv_works" = no || break done LIBS="$am_save_LIBS" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5 printf "%s\n" "$am_cv_func_iconv_works" >&6; } case "$am_cv_func_iconv_works" in *no) am_func_iconv=no am_cv_lib_iconv=no ;; *) am_func_iconv=yes ;; esac else am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then printf "%s\n" "#define HAVE_ICONV 1" >>confdefs.h fi if test "$am_cv_lib_iconv" = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 printf %s "checking how to link with libiconv... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 printf "%s\n" "$LIBICONV" >&6; } else CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi if test "$am_cv_func_iconv" = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iconv declaration" >&5 printf %s "checking for iconv declaration... " >&6; } if test ${am_cv_proto_iconv+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : am_cv_proto_iconv_arg1="" else $as_nop am_cv_proto_iconv_arg1="const" fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" fi am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_proto_iconv" >&5 printf "%s\n" " $am_cv_proto_iconv" >&6; } printf "%s\n" "#define ICONV_CONST $am_cv_proto_iconv_arg1" >>confdefs.h fi unset BASH if test "x$SH" = x ; then # Extract the first word of "bash", so it can be a program name with args. set dummy bash; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_BASH+y} then : printf %s "(cached) " >&6 else $as_nop case $BASH in [\\/]* | ?:[\\/]*) ac_cv_path_BASH="$BASH" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_BASH="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_BASH" && ac_cv_path_BASH="NONE" ;; esac fi BASH=$ac_cv_path_BASH if test -n "$BASH"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $BASH" >&5 printf "%s\n" "$BASH" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test ! "x$BASH" = xNONE ; then if $BASH -posix -c true ; then SH="$BASH -posix" elif $BASH --posix -c true ; then SH="$BASH --posix" fi echo "Using $SH". fi fi if test "x$SH" = x ; then # Extract the first word of "ksh", so it can be a program name with args. set dummy ksh; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_KSH+y} then : printf %s "(cached) " >&6 else $as_nop case $KSH in [\\/]* | ?:[\\/]*) ac_cv_path_KSH="$KSH" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_KSH="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_KSH" && ac_cv_path_KSH="NONE" ;; esac fi KSH=$ac_cv_path_KSH if test -n "$KSH"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $KSH" >&5 printf "%s\n" "$KSH" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test ! "x$KSH" = xNONE ; then SH="$KSH" echo "Using $SH". fi fi if test "x$SH" = x ; then # Extract the first word of "sh", so it can be a program name with args. set dummy sh; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_BINSH+y} then : printf %s "(cached) " >&6 else $as_nop case $BINSH in [\\/]* | ?:[\\/]*) ac_cv_path_BINSH="$BINSH" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_BINSH="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_BINSH" && ac_cv_path_BINSH="NONE" ;; esac fi BINSH=$ac_cv_path_BINSH if test -n "$BINSH"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $BINSH" >&5 printf "%s\n" "$BINSH" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$BINSH" = xNONE; then echo "ERROR: Can't find sh." >&2 exit 1 else SH="$BINSH" fi fi # Extract the first word of "awk", so it can be a program name with args. set dummy awk; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_AWK+y} then : printf %s "(cached) " >&6 else $as_nop case $AWK in [\\/]* | ?:[\\/]*) ac_cv_path_AWK="$AWK" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_AWK="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_AWK" && ac_cv_path_AWK="NONE" ;; esac fi AWK=$ac_cv_path_AWK if test -n "$AWK"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 printf "%s\n" "$AWK" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi # Extract the first word of "mawk", so it can be a program name with args. set dummy mawk; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_MAWK+y} then : printf %s "(cached) " >&6 else $as_nop case $MAWK in [\\/]* | ?:[\\/]*) ac_cv_path_MAWK="$MAWK" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_MAWK="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_MAWK" && ac_cv_path_MAWK="NONE" ;; esac fi MAWK=$ac_cv_path_MAWK if test -n "$MAWK"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAWK" >&5 printf "%s\n" "$MAWK" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi # Extract the first word of "gawk", so it can be a program name with args. set dummy gawk; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_GAWK+y} then : printf %s "(cached) " >&6 else $as_nop case $GAWK in [\\/]* | ?:[\\/]*) ac_cv_path_GAWK="$GAWK" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_GAWK="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GAWK" && ac_cv_path_GAWK="NONE" ;; esac fi GAWK=$ac_cv_path_GAWK if test -n "$GAWK"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GAWK" >&5 printf "%s\n" "$GAWK" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi # Extract the first word of "nawk", so it can be a program name with args. set dummy nawk; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_NAWK+y} then : printf %s "(cached) " >&6 else $as_nop case $NAWK in [\\/]* | ?:[\\/]*) ac_cv_path_NAWK="$NAWK" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_NAWK="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_NAWK" && ac_cv_path_NAWK="NONE" ;; esac fi NAWK=$ac_cv_path_NAWK if test -n "$NAWK"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NAWK" >&5 printf "%s\n" "$NAWK" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$AWK" != "xNONE" ; then AWK="$AWK" fi if test "x$NAWK" != "xNONE" ; then AWK="$NAWK" fi if test "x$GAWK" != "xNONE" ; then AWK="$GAWK" fi if test "x$MAWK" != "xNONE" ; then AWK="$MAWK" fi # Extract the first word of "tac", so it can be a program name with args. set dummy tac; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_TAC+y} then : printf %s "(cached) " >&6 else $as_nop case $TAC in [\\/]* | ?:[\\/]*) ac_cv_path_TAC="$TAC" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_TAC="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_TAC" && ac_cv_path_TAC="NONE" ;; esac fi TAC=$ac_cv_path_TAC if test -n "$TAC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $TAC" >&5 printf "%s\n" "$TAC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$TAC" = "xNONE"; then TACTARGET="tac" TACAWK="tac.awk" TAC="$libdir/tac" fi # Check whether --enable-lbdb_dotlock was given. if test ${enable_lbdb_dotlock+y} then : enableval=$enable_lbdb_dotlock; lbdb_cv_lbdb_dotlock="$enableval" fi # Extract the first word of "mutt.dotlock", so it can be a program name with args. set dummy mutt.dotlock; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_DOTLOCK_OLD+y} then : printf %s "(cached) " >&6 else $as_nop case $DOTLOCK_OLD in [\\/]* | ?:[\\/]*) ac_cv_path_DOTLOCK_OLD="$DOTLOCK_OLD" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_DOTLOCK_OLD="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_DOTLOCK_OLD" && ac_cv_path_DOTLOCK_OLD="no" ;; esac fi DOTLOCK_OLD=$ac_cv_path_DOTLOCK_OLD if test -n "$DOTLOCK_OLD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DOTLOCK_OLD" >&5 printf "%s\n" "$DOTLOCK_OLD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test x$ac_cv_path_DOTLOCK_OLD = xno ; then # Extract the first word of "mutt_dotlock", so it can be a program name with args. set dummy mutt_dotlock; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_DOTLOCK+y} then : printf %s "(cached) " >&6 else $as_nop case $DOTLOCK in [\\/]* | ?:[\\/]*) ac_cv_path_DOTLOCK="$DOTLOCK" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_DOTLOCK="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_DOTLOCK" && ac_cv_path_DOTLOCK="no" ;; esac fi DOTLOCK=$ac_cv_path_DOTLOCK if test -n "$DOTLOCK"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DOTLOCK" >&5 printf "%s\n" "$DOTLOCK" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi else ac_cv_path_DOTLOCK=$ac_cv_path_DOTLOCK_OLD fi if test x$ac_cv_path_DOTLOCK = xno || test x$lbdb_cv_lbdb_dotlock = xyes then DOTLOCK_TARGET="lbdb_dotlock" DOTLOCK="$bindir"/lbdb_dotlock fi DOTLOCKBASE=`basename $DOTLOCK` path_fetchaddr="$libdir/fetchaddr" # # LBDB_ARG_WITH(FOO, foo, m_foo, [with foo support]) # # several cases: # --with-foo - search for foo in PATH. error if not found # --with-foo=/foo - use /foo # --without-foo - completely disable this # none of the above - search for foo in PATH. disable if not found # MODULES="m_inmail m_passwd m_muttalias m_pine m_gnomecard m_bbdb m_wanderlust" withval="" # Check whether --with-finger was given. if test ${with_finger+y} then : withval=$with_finger; fi if test x$withval = xyes; then # Extract the first word of "finger", so it can be a program name with args. set dummy finger; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_FINGER+y} then : printf %s "(cached) " >&6 else $as_nop case $FINGER in [\\/]* | ?:[\\/]*) ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_FINGER="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER=""no"" ;; esac fi FINGER=$ac_cv_path_FINGER if test -n "$FINGER"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FINGER" >&5 printf "%s\n" "$FINGER" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test x$FINGER = xno; then as_fn_error $? "finger not in PATH" "$LINENO" 5 else MODULES="$MODULES m_finger" fi elif test x$withval = x; then # Extract the first word of "finger", so it can be a program name with args. set dummy finger; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_FINGER+y} then : printf %s "(cached) " >&6 else $as_nop case $FINGER in [\\/]* | ?:[\\/]*) ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_FINGER="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER=""no"" ;; esac fi FINGER=$ac_cv_path_FINGER if test -n "$FINGER"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FINGER" >&5 printf "%s\n" "$FINGER" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test x$FINGER != xno; then MODULES="$MODULES m_finger" fi elif test x$withval != xno; then FINGER=$withval MODULES="$MODULES m_finger" fi withval="" # Check whether --with-abook was given. if test ${with_abook+y} then : withval=$with_abook; fi if test x$withval = xyes; then # Extract the first word of "abook", so it can be a program name with args. set dummy abook; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_ABOOK+y} then : printf %s "(cached) " >&6 else $as_nop case $ABOOK in [\\/]* | ?:[\\/]*) ac_cv_path_ABOOK="$ABOOK" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_ABOOK="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ABOOK" && ac_cv_path_ABOOK=""no"" ;; esac fi ABOOK=$ac_cv_path_ABOOK if test -n "$ABOOK"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ABOOK" >&5 printf "%s\n" "$ABOOK" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test x$ABOOK = xno; then as_fn_error $? "abook not in PATH" "$LINENO" 5 else MODULES="$MODULES m_abook" fi elif test x$withval = x; then # Extract the first word of "abook", so it can be a program name with args. set dummy abook; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_ABOOK+y} then : printf %s "(cached) " >&6 else $as_nop case $ABOOK in [\\/]* | ?:[\\/]*) ac_cv_path_ABOOK="$ABOOK" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_ABOOK="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ABOOK" && ac_cv_path_ABOOK=""no"" ;; esac fi ABOOK=$ac_cv_path_ABOOK if test -n "$ABOOK"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ABOOK" >&5 printf "%s\n" "$ABOOK" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test x$ABOOK != xno; then MODULES="$MODULES m_abook" fi elif test x$withval != xno; then ABOOK=$withval MODULES="$MODULES m_abook" fi withval="" # Check whether --with-goobook was given. if test ${with_goobook+y} then : withval=$with_goobook; fi if test x$withval = xyes; then # Extract the first word of "goobook", so it can be a program name with args. set dummy goobook; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_GOOBOOK+y} then : printf %s "(cached) " >&6 else $as_nop case $GOOBOOK in [\\/]* | ?:[\\/]*) ac_cv_path_GOOBOOK="$GOOBOOK" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_GOOBOOK="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GOOBOOK" && ac_cv_path_GOOBOOK=""no"" ;; esac fi GOOBOOK=$ac_cv_path_GOOBOOK if test -n "$GOOBOOK"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GOOBOOK" >&5 printf "%s\n" "$GOOBOOK" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test x$GOOBOOK = xno; then as_fn_error $? "goobook not in PATH" "$LINENO" 5 else MODULES="$MODULES m_goobook" fi elif test x$withval = x; then # Extract the first word of "goobook", so it can be a program name with args. set dummy goobook; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_GOOBOOK+y} then : printf %s "(cached) " >&6 else $as_nop case $GOOBOOK in [\\/]* | ?:[\\/]*) ac_cv_path_GOOBOOK="$GOOBOOK" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_GOOBOOK="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GOOBOOK" && ac_cv_path_GOOBOOK=""no"" ;; esac fi GOOBOOK=$ac_cv_path_GOOBOOK if test -n "$GOOBOOK"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GOOBOOK" >&5 printf "%s\n" "$GOOBOOK" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test x$GOOBOOK != xno; then MODULES="$MODULES m_goobook" fi elif test x$withval != xno; then GOOBOOK=$withval MODULES="$MODULES m_goobook" fi withval="" # Check whether --with-addr-email was given. if test ${with_addr_email+y} then : withval=$with_addr_email; fi if test x$withval = xyes; then # Extract the first word of "addr-email", so it can be a program name with args. set dummy addr-email; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_ADDR_EMAIL+y} then : printf %s "(cached) " >&6 else $as_nop case $ADDR_EMAIL in [\\/]* | ?:[\\/]*) ac_cv_path_ADDR_EMAIL="$ADDR_EMAIL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_ADDR_EMAIL="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ADDR_EMAIL" && ac_cv_path_ADDR_EMAIL=""no"" ;; esac fi ADDR_EMAIL=$ac_cv_path_ADDR_EMAIL if test -n "$ADDR_EMAIL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ADDR_EMAIL" >&5 printf "%s\n" "$ADDR_EMAIL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test x$ADDR_EMAIL = xno; then as_fn_error $? "addr-email not in PATH" "$LINENO" 5 else MODULES="$MODULES m_addr_email" fi elif test x$withval = x; then # Extract the first word of "addr-email", so it can be a program name with args. set dummy addr-email; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_ADDR_EMAIL+y} then : printf %s "(cached) " >&6 else $as_nop case $ADDR_EMAIL in [\\/]* | ?:[\\/]*) ac_cv_path_ADDR_EMAIL="$ADDR_EMAIL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_ADDR_EMAIL="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ADDR_EMAIL" && ac_cv_path_ADDR_EMAIL=""no"" ;; esac fi ADDR_EMAIL=$ac_cv_path_ADDR_EMAIL if test -n "$ADDR_EMAIL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ADDR_EMAIL" >&5 printf "%s\n" "$ADDR_EMAIL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test x$ADDR_EMAIL != xno; then MODULES="$MODULES m_addr_email" fi elif test x$withval != xno; then ADDR_EMAIL=$withval MODULES="$MODULES m_addr_email" fi withval="" # Check whether --with-ypcat was given. if test ${with_ypcat+y} then : withval=$with_ypcat; fi if test x$withval = xyes; then # Extract the first word of "ypcat", so it can be a program name with args. set dummy ypcat; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_YPCAT+y} then : printf %s "(cached) " >&6 else $as_nop case $YPCAT in [\\/]* | ?:[\\/]*) ac_cv_path_YPCAT="$YPCAT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_YPCAT="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_YPCAT" && ac_cv_path_YPCAT=""no"" ;; esac fi YPCAT=$ac_cv_path_YPCAT if test -n "$YPCAT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $YPCAT" >&5 printf "%s\n" "$YPCAT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test x$YPCAT = xno; then as_fn_error $? "ypcat not in PATH" "$LINENO" 5 else MODULES="$MODULES m_yppasswd" fi elif test x$withval = x; then # Extract the first word of "ypcat", so it can be a program name with args. set dummy ypcat; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_YPCAT+y} then : printf %s "(cached) " >&6 else $as_nop case $YPCAT in [\\/]* | ?:[\\/]*) ac_cv_path_YPCAT="$YPCAT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_YPCAT="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_YPCAT" && ac_cv_path_YPCAT=""no"" ;; esac fi YPCAT=$ac_cv_path_YPCAT if test -n "$YPCAT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $YPCAT" >&5 printf "%s\n" "$YPCAT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test x$YPCAT != xno; then MODULES="$MODULES m_yppasswd" fi elif test x$withval != xno; then YPCAT=$withval MODULES="$MODULES m_yppasswd" fi withval="" # Check whether --with-niscat was given. if test ${with_niscat+y} then : withval=$with_niscat; fi if test x$withval = xyes; then # Extract the first word of "niscat", so it can be a program name with args. set dummy niscat; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_NISCAT+y} then : printf %s "(cached) " >&6 else $as_nop case $NISCAT in [\\/]* | ?:[\\/]*) ac_cv_path_NISCAT="$NISCAT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_NISCAT="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_NISCAT" && ac_cv_path_NISCAT=""no"" ;; esac fi NISCAT=$ac_cv_path_NISCAT if test -n "$NISCAT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NISCAT" >&5 printf "%s\n" "$NISCAT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test x$NISCAT = xno; then as_fn_error $? "niscat not in PATH" "$LINENO" 5 else MODULES="$MODULES m_nispasswd" fi elif test x$withval = x; then # Extract the first word of "niscat", so it can be a program name with args. set dummy niscat; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_NISCAT+y} then : printf %s "(cached) " >&6 else $as_nop case $NISCAT in [\\/]* | ?:[\\/]*) ac_cv_path_NISCAT="$NISCAT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_NISCAT="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_NISCAT" && ac_cv_path_NISCAT=""no"" ;; esac fi NISCAT=$ac_cv_path_NISCAT if test -n "$NISCAT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NISCAT" >&5 printf "%s\n" "$NISCAT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test x$NISCAT != xno; then MODULES="$MODULES m_nispasswd" fi elif test x$withval != xno; then NISCAT=$withval MODULES="$MODULES m_nispasswd" fi withval="" # Check whether --with-getent was given. if test ${with_getent+y} then : withval=$with_getent; fi if test x$withval = xyes; then # Extract the first word of "getent", so it can be a program name with args. set dummy getent; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_GETENT+y} then : printf %s "(cached) " >&6 else $as_nop case $GETENT in [\\/]* | ?:[\\/]*) ac_cv_path_GETENT="$GETENT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_GETENT="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GETENT" && ac_cv_path_GETENT=""no"" ;; esac fi GETENT=$ac_cv_path_GETENT if test -n "$GETENT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GETENT" >&5 printf "%s\n" "$GETENT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test x$GETENT = xno; then as_fn_error $? "getent not in PATH" "$LINENO" 5 else MODULES="$MODULES m_getent" fi elif test x$withval = x; then # Extract the first word of "getent", so it can be a program name with args. set dummy getent; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_GETENT+y} then : printf %s "(cached) " >&6 else $as_nop case $GETENT in [\\/]* | ?:[\\/]*) ac_cv_path_GETENT="$GETENT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_GETENT="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GETENT" && ac_cv_path_GETENT=""no"" ;; esac fi GETENT=$ac_cv_path_GETENT if test -n "$GETENT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GETENT" >&5 printf "%s\n" "$GETENT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test x$GETENT != xno; then MODULES="$MODULES m_getent" fi elif test x$withval != xno; then GETENT=$withval MODULES="$MODULES m_getent" fi withval="" # Check whether --with-gpg was given. if test ${with_gpg+y} then : withval=$with_gpg; fi if test x$withval = xyes; then # Extract the first word of "gpg", so it can be a program name with args. set dummy gpg; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_GPG+y} then : printf %s "(cached) " >&6 else $as_nop case $GPG in [\\/]* | ?:[\\/]*) ac_cv_path_GPG="$GPG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_GPG="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GPG" && ac_cv_path_GPG=""no"" ;; esac fi GPG=$ac_cv_path_GPG if test -n "$GPG"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GPG" >&5 printf "%s\n" "$GPG" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test x$GPG = xno; then as_fn_error $? "gpg not in PATH" "$LINENO" 5 else MODULES="$MODULES m_gpg" fi elif test x$withval = x; then # Extract the first word of "gpg", so it can be a program name with args. set dummy gpg; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_GPG+y} then : printf %s "(cached) " >&6 else $as_nop case $GPG in [\\/]* | ?:[\\/]*) ac_cv_path_GPG="$GPG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_GPG="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GPG" && ac_cv_path_GPG=""no"" ;; esac fi GPG=$ac_cv_path_GPG if test -n "$GPG"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GPG" >&5 printf "%s\n" "$GPG" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test x$GPG != xno; then MODULES="$MODULES m_gpg" fi elif test x$withval != xno; then GPG=$withval MODULES="$MODULES m_gpg" fi withval="" # Check whether --with-pgpk was given. if test ${with_pgpk+y} then : withval=$with_pgpk; fi if test x$withval = xyes; then # Extract the first word of "pgpk", so it can be a program name with args. set dummy pgpk; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_PGPK+y} then : printf %s "(cached) " >&6 else $as_nop case $PGPK in [\\/]* | ?:[\\/]*) ac_cv_path_PGPK="$PGPK" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_PGPK="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_PGPK" && ac_cv_path_PGPK=""no"" ;; esac fi PGPK=$ac_cv_path_PGPK if test -n "$PGPK"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PGPK" >&5 printf "%s\n" "$PGPK" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test x$PGPK = xno; then as_fn_error $? "pgpk not in PATH" "$LINENO" 5 else MODULES="$MODULES m_pgp5" fi elif test x$withval = x; then # Extract the first word of "pgpk", so it can be a program name with args. set dummy pgpk; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_PGPK+y} then : printf %s "(cached) " >&6 else $as_nop case $PGPK in [\\/]* | ?:[\\/]*) ac_cv_path_PGPK="$PGPK" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_PGPK="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_PGPK" && ac_cv_path_PGPK=""no"" ;; esac fi PGPK=$ac_cv_path_PGPK if test -n "$PGPK"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PGPK" >&5 printf "%s\n" "$PGPK" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test x$PGPK != xno; then MODULES="$MODULES m_pgp5" fi elif test x$withval != xno; then PGPK=$withval MODULES="$MODULES m_pgp5" fi withval="" # Check whether --with-pgp was given. if test ${with_pgp+y} then : withval=$with_pgp; fi if test x$withval = xyes; then # Extract the first word of "pgp", so it can be a program name with args. set dummy pgp; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_PGP+y} then : printf %s "(cached) " >&6 else $as_nop case $PGP in [\\/]* | ?:[\\/]*) ac_cv_path_PGP="$PGP" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_PGP="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_PGP" && ac_cv_path_PGP=""no"" ;; esac fi PGP=$ac_cv_path_PGP if test -n "$PGP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PGP" >&5 printf "%s\n" "$PGP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test x$PGP = xno; then as_fn_error $? "pgp not in PATH" "$LINENO" 5 else MODULES="$MODULES m_pgp2" fi elif test x$withval = x; then # Extract the first word of "pgp", so it can be a program name with args. set dummy pgp; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_PGP+y} then : printf %s "(cached) " >&6 else $as_nop case $PGP in [\\/]* | ?:[\\/]*) ac_cv_path_PGP="$PGP" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_PGP="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_PGP" && ac_cv_path_PGP=""no"" ;; esac fi PGP=$ac_cv_path_PGP if test -n "$PGP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PGP" >&5 printf "%s\n" "$PGP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test x$PGP != xno; then MODULES="$MODULES m_pgp2" fi elif test x$withval != xno; then PGP=$withval MODULES="$MODULES m_pgp2" fi withval="" # Check whether --with-evolution-addressbook-export was given. if test ${with_evolution_addressbook_export+y} then : withval=$with_evolution_addressbook_export; fi if test x$withval = xyes; then # Extract the first word of "evolution-addressbook-export", so it can be a program name with args. set dummy evolution-addressbook-export; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_EVOLUTION_ADDRESSBOOK_EXPORT+y} then : printf %s "(cached) " >&6 else $as_nop case $EVOLUTION_ADDRESSBOOK_EXPORT in [\\/]* | ?:[\\/]*) ac_cv_path_EVOLUTION_ADDRESSBOOK_EXPORT="$EVOLUTION_ADDRESSBOOK_EXPORT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_EVOLUTION_ADDRESSBOOK_EXPORT="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_EVOLUTION_ADDRESSBOOK_EXPORT" && ac_cv_path_EVOLUTION_ADDRESSBOOK_EXPORT=""no"" ;; esac fi EVOLUTION_ADDRESSBOOK_EXPORT=$ac_cv_path_EVOLUTION_ADDRESSBOOK_EXPORT if test -n "$EVOLUTION_ADDRESSBOOK_EXPORT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $EVOLUTION_ADDRESSBOOK_EXPORT" >&5 printf "%s\n" "$EVOLUTION_ADDRESSBOOK_EXPORT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test x$EVOLUTION_ADDRESSBOOK_EXPORT = xno; then as_fn_error $? "evolution-addressbook-export not in PATH" "$LINENO" 5 else MODULES="$MODULES m_evolution" fi elif test x$withval = x; then # Extract the first word of "evolution-addressbook-export", so it can be a program name with args. set dummy evolution-addressbook-export; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_EVOLUTION_ADDRESSBOOK_EXPORT+y} then : printf %s "(cached) " >&6 else $as_nop case $EVOLUTION_ADDRESSBOOK_EXPORT in [\\/]* | ?:[\\/]*) ac_cv_path_EVOLUTION_ADDRESSBOOK_EXPORT="$EVOLUTION_ADDRESSBOOK_EXPORT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_EVOLUTION_ADDRESSBOOK_EXPORT="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_EVOLUTION_ADDRESSBOOK_EXPORT" && ac_cv_path_EVOLUTION_ADDRESSBOOK_EXPORT=""no"" ;; esac fi EVOLUTION_ADDRESSBOOK_EXPORT=$ac_cv_path_EVOLUTION_ADDRESSBOOK_EXPORT if test -n "$EVOLUTION_ADDRESSBOOK_EXPORT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $EVOLUTION_ADDRESSBOOK_EXPORT" >&5 printf "%s\n" "$EVOLUTION_ADDRESSBOOK_EXPORT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test x$EVOLUTION_ADDRESSBOOK_EXPORT != xno; then MODULES="$MODULES m_evolution" fi elif test x$withval != xno; then EVOLUTION_ADDRESSBOOK_EXPORT=$withval MODULES="$MODULES m_evolution" fi withval="" # Check whether --with-khard was given. if test ${with_khard+y} then : withval=$with_khard; fi if test x$withval = xyes; then # Extract the first word of "khard", so it can be a program name with args. set dummy khard; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_KHARD+y} then : printf %s "(cached) " >&6 else $as_nop case $KHARD in [\\/]* | ?:[\\/]*) ac_cv_path_KHARD="$KHARD" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_KHARD="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_KHARD" && ac_cv_path_KHARD=""no"" ;; esac fi KHARD=$ac_cv_path_KHARD if test -n "$KHARD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $KHARD" >&5 printf "%s\n" "$KHARD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test x$KHARD = xno; then as_fn_error $? "khard not in PATH" "$LINENO" 5 else MODULES="$MODULES m_khard" fi elif test x$withval = x; then # Extract the first word of "khard", so it can be a program name with args. set dummy khard; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_KHARD+y} then : printf %s "(cached) " >&6 else $as_nop case $KHARD in [\\/]* | ?:[\\/]*) ac_cv_path_KHARD="$KHARD" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_KHARD="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_KHARD" && ac_cv_path_KHARD=""no"" ;; esac fi KHARD=$ac_cv_path_KHARD if test -n "$KHARD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $KHARD" >&5 printf "%s\n" "$KHARD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test x$KHARD != xno; then MODULES="$MODULES m_khard" fi elif test x$withval != xno; then KHARD=$withval MODULES="$MODULES m_khard" fi withval="" # Check whether --with-mu was given. if test ${with_mu+y} then : withval=$with_mu; fi if test x$withval = xyes; then # Extract the first word of "mu", so it can be a program name with args. set dummy mu; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_MU+y} then : printf %s "(cached) " >&6 else $as_nop case $MU in [\\/]* | ?:[\\/]*) ac_cv_path_MU="$MU" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_MU="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_MU" && ac_cv_path_MU=""no"" ;; esac fi MU=$ac_cv_path_MU if test -n "$MU"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MU" >&5 printf "%s\n" "$MU" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test x$MU = xno; then as_fn_error $? "mu not in PATH" "$LINENO" 5 else MODULES="$MODULES m_mu" fi elif test x$withval = x; then # Extract the first word of "mu", so it can be a program name with args. set dummy mu; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_MU+y} then : printf %s "(cached) " >&6 else $as_nop case $MU in [\\/]* | ?:[\\/]*) ac_cv_path_MU="$MU" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_MU="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_MU" && ac_cv_path_MU=""no"" ;; esac fi MU=$ac_cv_path_MU if test -n "$MU"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MU" >&5 printf "%s\n" "$MU" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test x$MU != xno; then MODULES="$MODULES m_mu" fi elif test x$withval != xno; then MU=$withval MODULES="$MODULES m_mu" fi # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_PERL+y} then : printf %s "(cached) " >&6 else $as_nop case $PERL in [\\/]* | ?:[\\/]*) ac_cv_path_PERL="$PERL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_PERL="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_PERL" && ac_cv_path_PERL=""no"" ;; esac fi PERL=$ac_cv_path_PERL if test -n "$PERL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 printf "%s\n" "$PERL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$PERL" != xno ; then # m_fido needs nodelist2lbdb, which needs perl # m_palm needs palm_lsaddr, which needs perl # m_ldap needs mutt_ldap_query, which is written in perl # m_vcf needs vcquery, which is written in perl MODULES="$MODULES m_fido m_palm m_ldap m_vcf" fi # m_osx_addressbook requires xcode (10.3) or projectbuilder (<10.3) # Extract the first word of "xcodebuild", so it can be a program name with args. set dummy xcodebuild; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_XCODEBUILD+y} then : printf %s "(cached) " >&6 else $as_nop case $XCODEBUILD in [\\/]* | ?:[\\/]*) ac_cv_path_XCODEBUILD="$XCODEBUILD" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_XCODEBUILD="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_XCODEBUILD" && ac_cv_path_XCODEBUILD=""no"" ;; esac fi XCODEBUILD=$ac_cv_path_XCODEBUILD if test -n "$XCODEBUILD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $XCODEBUILD" >&5 printf "%s\n" "$XCODEBUILD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$XCODEBUILD" != xno; then MODULES="$MODULES m_osx_addressbook" else # Extract the first word of "pbxbuild", so it can be a program name with args. set dummy pbxbuild; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_PBXBUILD+y} then : printf %s "(cached) " >&6 else $as_nop case $PBXBUILD in [\\/]* | ?:[\\/]*) ac_cv_path_PBXBUILD="$PBXBUILD" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_PBXBUILD="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_PBXBUILD" && ac_cv_path_PBXBUILD=""no"" ;; esac fi PBXBUILD=$ac_cv_path_PBXBUILD if test -n "$PBXBUILD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PBXBUILD" >&5 printf "%s\n" "$PBXBUILD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$PBXBUILD" != xno ; then MODULES="$MODULES m_osx_addressbook" fi fi MODULES_SH="" for i in $MODULES ; do MODULES_SH="$MODULES_SH $i.sh" done # some voodoo to replace ${prefix} in perl script (mutt_ldap_query.pl): SYSCONF_DIR=`test "$prefix" = NONE && prefix=$ac_default_prefix; eval echo "${sysconfdir}"` LBDB_VERSION=$PACKAGE_VERSION LBDB_ELPA_VERSION=`echo $PACKAGE_VERSION|sed 's/+.*$//'` ac_config_commands="$ac_config_commands tests/atconfig" # Extract the first word of "autom4te", so it can be a program name with args. set dummy autom4te; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_AUTOM4TE+y} then : printf %s "(cached) " >&6 else $as_nop case $AUTOM4TE in [\\/]* | ?:[\\/]*) ac_cv_path_AUTOM4TE="$AUTOM4TE" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_AUTOM4TE="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_AUTOM4TE" && ac_cv_path_AUTOM4TE="autom4te" ;; esac fi AUTOM4TE=$ac_cv_path_AUTOM4TE if test -n "$AUTOM4TE"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AUTOM4TE" >&5 printf "%s\n" "$AUTOM4TE" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi ac_config_files="$ac_config_files Makefile lbdbq.sh munge.awk lbdb-fetchaddr.sh vcquery.pl lbdb-munge.sh lbdb_lib.sh nodelist2lbdb.pl palm_lsaddr.pl mutt_ldap_query.pl $MODULES_SH $TACAWK lbdb.spec lbdb.rc lbdb-pkg.el tests/Makefile tests/atlocal" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else $as_nop as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null then : eval 'as_fn_arith () { as_val=$(( $* )) }' else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by lbdb $as_me 0.54, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Configuration commands: $config_commands Report bugs to . lbdb home page: ." _ACEOF ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ lbdb config.status 0.54 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" Copyright (C) 2021 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX printf "%s\n" "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # ac_cv_exeext="$ac_cv_exeext" _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 "tests/atconfig") CONFIG_COMMANDS="$CONFIG_COMMANDS tests/atconfig" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "lbdbq.sh") CONFIG_FILES="$CONFIG_FILES lbdbq.sh" ;; "munge.awk") CONFIG_FILES="$CONFIG_FILES munge.awk" ;; "lbdb-fetchaddr.sh") CONFIG_FILES="$CONFIG_FILES lbdb-fetchaddr.sh" ;; "vcquery.pl") CONFIG_FILES="$CONFIG_FILES vcquery.pl" ;; "lbdb-munge.sh") CONFIG_FILES="$CONFIG_FILES lbdb-munge.sh" ;; "lbdb_lib.sh") CONFIG_FILES="$CONFIG_FILES lbdb_lib.sh" ;; "nodelist2lbdb.pl") CONFIG_FILES="$CONFIG_FILES nodelist2lbdb.pl" ;; "palm_lsaddr.pl") CONFIG_FILES="$CONFIG_FILES palm_lsaddr.pl" ;; "mutt_ldap_query.pl") CONFIG_FILES="$CONFIG_FILES mutt_ldap_query.pl" ;; "$MODULES_SH") CONFIG_FILES="$CONFIG_FILES $MODULES_SH" ;; "$TACAWK") CONFIG_FILES="$CONFIG_FILES $TACAWK" ;; "lbdb.spec") CONFIG_FILES="$CONFIG_FILES lbdb.spec" ;; "lbdb.rc") CONFIG_FILES="$CONFIG_FILES lbdb.rc" ;; "lbdb-pkg.el") CONFIG_FILES="$CONFIG_FILES lbdb-pkg.el" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "tests/atlocal") CONFIG_FILES="$CONFIG_FILES tests/atlocal" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 printf "%s\n" "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "tests/atconfig":C) cat >tests/atconfig </dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi lbdb-0.54/configure.ac000066400000000000000000000142411465114770000146420ustar00rootroot00000000000000dnl Copyright (c) 1998-2024 Roland Rosenfeld dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software Foundation, dnl Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. AC_INIT([lbdb], 0.54, [roland@spinnaker.de], [], [https://www.spinnaker.de/lbdb/]) AC_CONFIG_SRCDIR([fetchaddr.c]) AC_MSG_CHECKING(for prefix) if test x$prefix = xNONE; then lbdb_cv_prefix=$ac_default_prefix else lbdb_cv_prefix=$prefix fi AC_MSG_RESULT($lbdb_cv_prefix) AC_PROG_CC AC_PROG_INSTALL AC_CHECK_HEADER(getopt.h, AC_DEFINE(HAVE_GETOPT_H)) AM_ICONV dnl SH=NONE dnl If we are runnin bash right now, BASH is set. unset BASH if test "x$SH" = x ; then AC_PATH_PROG(BASH, bash, NONE) if test ! "x$BASH" = xNONE ; then if $BASH -posix -c true ; then SH="$BASH -posix" elif $BASH --posix -c true ; then SH="$BASH --posix" fi echo "Using $SH". fi fi if test "x$SH" = x ; then AC_PATH_PROG(KSH, ksh, NONE) if test ! "x$KSH" = xNONE ; then SH="$KSH" echo "Using $SH". fi fi if test "x$SH" = x ; then AC_PATH_PROG(BINSH, sh, NONE) if test "x$BINSH" = xNONE; then echo "ERROR: Can't find sh." >&2 exit 1 else SH="$BINSH" fi fi AC_SUBST(SH) AC_PATH_PROG(AWK, awk, NONE) AC_PATH_PROG(MAWK, mawk, NONE) AC_PATH_PROG(GAWK, gawk, NONE) AC_PATH_PROG(NAWK, nawk, NONE) if test "x$AWK" != "xNONE" ; then AWK="$AWK" fi if test "x$NAWK" != "xNONE" ; then AWK="$NAWK" fi if test "x$GAWK" != "xNONE" ; then AWK="$GAWK" fi if test "x$MAWK" != "xNONE" ; then AWK="$MAWK" fi AC_SUBST(AWK) AC_PATH_PROG(TAC, tac, NONE) if test "x$TAC" = "xNONE"; then TACTARGET="tac" AC_SUBST(TACTARGET) TACAWK="tac.awk" TAC="$libdir/tac" fi AC_SUBST(TAC) AC_ARG_ENABLE(lbdb_dotlock, AS_HELP_STRING ([--enable-lbdb-dotlock], [Force use of lbdb_dotlock program]), [lbdb_cv_lbdb_dotlock="$enableval"]) AC_PATH_PROG(DOTLOCK_OLD, mutt.dotlock, no) if test x$ac_cv_path_DOTLOCK_OLD = xno ; then AC_PATH_PROG(DOTLOCK, mutt_dotlock, no) else ac_cv_path_DOTLOCK=$ac_cv_path_DOTLOCK_OLD fi if test x$ac_cv_path_DOTLOCK = xno || test x$lbdb_cv_lbdb_dotlock = xyes then DOTLOCK_TARGET="lbdb_dotlock" AC_SUBST(DOTLOCK_TARGET) DOTLOCK="$bindir"/lbdb_dotlock fi AC_SUBST(DOTLOCK) DOTLOCKBASE=`basename $DOTLOCK` AC_SUBST(DOTLOCKBASE) path_fetchaddr="$libdir/fetchaddr" AC_SUBST(path_fetchaddr) # # LBDB_ARG_WITH(FOO, foo, m_foo, [with foo support]) # # several cases: # --with-foo - search for foo in PATH. error if not found # --with-foo=/foo - use /foo # --without-foo - completely disable this # none of the above - search for foo in PATH. disable if not found # AC_DEFUN([LBDB_ARG_WITH], [ withval="" AC_ARG_WITH($2,[AS_HELP_STRING([--with-$2],[$4])]) if test x$withval = xyes; then AC_PATH_PROG($1, $2, "no") if test x$$1 = xno; then AC_MSG_ERROR([$2 not in PATH]) else MODULES="$MODULES $3" AC_SUBST($1) fi elif test x$withval = x; then AC_PATH_PROG($1, $2, "no") if test x$$1 != xno; then MODULES="$MODULES $3" AC_SUBST($1) fi elif test x$withval != xno; then $1=$withval MODULES="$MODULES $3" AC_SUBST($1) fi ]) MODULES="m_inmail m_passwd m_muttalias m_pine m_gnomecard m_bbdb m_wanderlust" LBDB_ARG_WITH(FINGER, finger, m_finger, [with finger support]) LBDB_ARG_WITH(ABOOK, abook, m_abook, [with abook support]) LBDB_ARG_WITH(GOOBOOK, goobook, m_goobook, [with goobook support]) LBDB_ARG_WITH(ADDR_EMAIL, addr-email, m_addr_email, [with addressbook support]) LBDB_ARG_WITH(YPCAT, ypcat, m_yppasswd, [with ypcat passwd support]) LBDB_ARG_WITH(NISCAT, niscat, m_nispasswd, [with niscat passwd support]) LBDB_ARG_WITH(GETENT, getent, m_getent, [with getent passwd support]) LBDB_ARG_WITH(GPG, gpg, m_gpg, [with GnuPG support]) LBDB_ARG_WITH(PGPK, pgpk, m_pgp5, [with PGP 5.* support]) LBDB_ARG_WITH(PGP, pgp, m_pgp2, [with PGP 2.* support]) LBDB_ARG_WITH(EVOLUTION_ADDRESSBOOK_EXPORT, evolution-addressbook-export, m_evolution, [with Evolution support ('auto' searchs at runtime)]) LBDB_ARG_WITH(KHARD, khard, m_khard, [with khard support]) LBDB_ARG_WITH(MU, mu, m_mu, [with mu (maildir-utils) support]) AC_PATH_PROG(PERL, perl, "no") if test "x$PERL" != xno ; then # m_fido needs nodelist2lbdb, which needs perl # m_palm needs palm_lsaddr, which needs perl # m_ldap needs mutt_ldap_query, which is written in perl # m_vcf needs vcquery, which is written in perl MODULES="$MODULES m_fido m_palm m_ldap m_vcf" AC_SUBST(PERL) fi # m_osx_addressbook requires xcode (10.3) or projectbuilder (<10.3) AC_PATH_PROG(XCODEBUILD, xcodebuild, "no") if test "x$XCODEBUILD" != xno; then MODULES="$MODULES m_osx_addressbook" AC_SUBST(XCODEBUILD) else AC_PATH_PROG(PBXBUILD, pbxbuild, "no") if test "x$PBXBUILD" != xno ; then MODULES="$MODULES m_osx_addressbook" AC_SUBST(PBXBUILD) fi fi MODULES_SH="" for i in $MODULES ; do MODULES_SH="$MODULES_SH $i.sh" done # some voodoo to replace ${prefix} in perl script (mutt_ldap_query.pl): SYSCONF_DIR=`test "$prefix" = NONE && prefix=$ac_default_prefix; eval echo "${sysconfdir}"` AC_SUBST(SYSCONF_DIR) LBDB_VERSION=$PACKAGE_VERSION AC_SUBST(LBDB_VERSION) LBDB_ELPA_VERSION=`echo $PACKAGE_VERSION|sed 's/+.*$//'` AC_SUBST(LBDB_ELPA_VERSION) AC_SUBST(MODULES) AC_CONFIG_TESTDIR([tests]) AC_PATH_PROG(AUTOM4TE, autom4te, autom4te) AC_SUBST(AUTOM4TE) AC_CONFIG_FILES([Makefile lbdbq.sh munge.awk lbdb-fetchaddr.sh vcquery.pl \ lbdb-munge.sh lbdb_lib.sh nodelist2lbdb.pl palm_lsaddr.pl \ mutt_ldap_query.pl $MODULES_SH $TACAWK lbdb.spec lbdb.rc lbdb-pkg.el \ tests/Makefile tests/atlocal]) AC_OUTPUT lbdb-0.54/dotlock.c000066400000000000000000000265641465114770000141720ustar00rootroot00000000000000/* * Copyright (C) 1996-2000 Michael R. Elkins * Copyright (C) 1998-2001,2007 Thomas Roessler * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* * Completely stolen from the Mutt mailreader */ #include #include #include #include #include #include #include #include #include #include #include #include #ifndef _POSIX_PATH_MAX #include #endif #include "dotlock.h" #include "helpers.h" #ifdef HAVE_GETOPT_H #include #endif #define MAXLINKS 1024 /* maximum link depth */ #define LONG_STRING 1024 #define MAXLOCKATTEMPT 5 static int DotlockFlags; static int Retry = MAXLOCKATTEMPT; static char *Hostname; static int dotlock_dereference_symlink (char *, size_t, const char *); static int dotlock_prepare (char *, size_t, const char *, int fd); static int dotlock_check_stats (struct stat *, struct stat *); static int dotlock_dispatch (const char *, int fd); static void usage (const char *); static void dotlock_expand_link (char *, const char *, const char *); /* These functions work on the current directory. * Invoke dotlock_prepare () before and check their * return value. */ static int dotlock_try (void); static int dotlock_unlock (const char *); static int dotlock_unlink (const char *); static int dotlock_lock (const char *); #define check_flags(a) if (a & DL_FL_ACTIONS) usage (argv[0]) int main (int argc, char **argv) { int i; char *p; struct utsname utsname; /* determine the system's host name */ uname (&utsname); if (!(Hostname = safe_strdup (utsname.nodename))) return DL_EX_ERROR; if ((p = strchr (Hostname, '.'))) *p = '\0'; /* parse the command line options. */ DotlockFlags = 0; while ((i = getopt (argc, argv, "dtfur:")) != EOF) { switch (i) { /* actions, mutually exclusive */ case 't': check_flags (DotlockFlags); DotlockFlags |= DL_FL_TRY; break; case 'd': check_flags (DotlockFlags); DotlockFlags |= DL_FL_UNLINK; break; case 'u': check_flags (DotlockFlags); DotlockFlags |= DL_FL_UNLOCK; break; /* other flags */ case 'f': DotlockFlags |= DL_FL_FORCE; break; case 'r': DotlockFlags |= DL_FL_RETRY; Retry = atoi (optarg); break; default: usage (argv[0]); } } if (optind == argc || Retry < 0) usage (argv[0]); return dotlock_dispatch (argv[optind], -1); } static int dotlock_dispatch (const char *f, int fd) { char realpath[_POSIX_PATH_MAX]; /* If dotlock_prepare () succeeds [return value == 0], * realpath contains the basename of f, and we have * successfully changed our working directory to * `dirname $f`. Additionally, f has been opened for * reading to verify that the user has at least read * permissions on that file. * * For a more detailed explanation of all this, see the * lengthy comment below. */ if (dotlock_prepare (realpath, sizeof (realpath), f, fd) != 0) return DL_EX_ERROR; /* Actually perform the locking operation. */ if (DotlockFlags & DL_FL_TRY) return dotlock_try (); else if (DotlockFlags & DL_FL_UNLOCK) return dotlock_unlock (realpath); else if (DotlockFlags & DL_FL_UNLINK) return dotlock_unlink (realpath); else /* lock */ return dotlock_lock (realpath); } /* * Usage information. * * This function doesn't return. * */ static void usage (const char *av0) { fprintf (stderr, "usage: %s [-t|-f|-u|-d] [-r ] file\n", av0); fputs ("\noptions:" "\n -t\t\ttry" "\n -f\t\tforce" "\n -u\t\tunlock" "\n -d\t\tunlink" "\n -r \tRetry locking" "\n", stderr); exit (DL_EX_ERROR); } /* * Access checking: Let's avoid to lock other users' mail * spool files if we aren't permitted to read them. * * Some simple-minded access (2) checking isn't sufficient * here: The problem is that the user may give us a * deeply nested path to a file which has the same name * as the file he wants to lock, but different * permissions, say, e.g. * /tmp/lots/of/subdirs/var/spool/mail/root. * * He may then try to replace /tmp/lots/of/subdirs by a * symbolic link to / after we have invoked access () to * check the file's permissions. The lockfile we'd * create or remove would then actually be * /var/spool/mail/root. * * To avoid this attack, we proceed as follows: * * - First, follow symbolic links a la * dotlock_dereference_symlink (). * * - get the result's dirname. * * - chdir to this directory. If you can't, bail out. * * - try to open the file in question, only using its * basename. If you can't, bail out. * * - fstat that file and compare the result to a * subsequent lstat (only using the basename). If * the comparison fails, bail out. * * dotlock_prepare () is invoked from main () directly * after the command line parsing has been done. * * Return values: * * 0 - Evereything's fine. The program's new current * directory is the contains the file to be locked. * The string pointed to by bn contains the name of * the file to be locked. * * -1 - Something failed. Don't continue. * * tlr, Jul 15 1998 */ static int dotlock_check_stats (struct stat *fsb, struct stat *lsb) { /* S_ISLNK (fsb->st_mode) should actually be impossible, * but we may have mixed up the parameters somewhere. * play safe. */ if (S_ISLNK (lsb->st_mode) || S_ISLNK (fsb->st_mode)) return -1; if ((lsb->st_dev != fsb->st_dev) || (lsb->st_ino != fsb->st_ino) || (lsb->st_mode != fsb->st_mode) || (lsb->st_nlink != fsb->st_nlink) || (lsb->st_uid != fsb->st_uid) || (lsb->st_gid != fsb->st_gid) || (lsb->st_rdev != fsb->st_rdev) || (lsb->st_size != fsb->st_size)) { /* something's fishy */ return -1; } return 0; } static int dotlock_prepare (char *bn, size_t l, const char *f, int _fd) { struct stat fsb, lsb; char realpath[_POSIX_PATH_MAX]; char *basename, *dirname; char *p; int fd; int r; if (dotlock_dereference_symlink (realpath, sizeof (realpath), f) == -1) return -1; if ((p = strrchr (realpath, '/'))) { *p = '\0'; basename = p + 1; dirname = realpath; } else { basename = realpath; dirname = "."; } if (strlen (basename) + 1 > l) return -1; strfcpy (bn, basename, l); if (chdir (dirname) == -1) return -1; if (_fd != -1) fd = _fd; else if ((fd = open (basename, O_RDONLY)) == -1) return -1; r = fstat (fd, &fsb); if (_fd == -1) close (fd); if (r == -1) return -1; if (lstat (basename, &lsb) == -1) return -1; if (dotlock_check_stats (&fsb, &lsb) == -1) return -1; return 0; } /* * Expand a symbolic link. * * This function expects newpath to have space for * at least _POSIX_PATH_MAX characters. * */ static void dotlock_expand_link (char *newpath, const char *path, const char *link) { const char *lb = NULL; size_t len; /* link is full path */ if (*link == '/') { strfcpy (newpath, link, _POSIX_PATH_MAX); return; } if ((lb = strrchr (path, '/')) == NULL) { /* no path in link */ strfcpy (newpath, link, _POSIX_PATH_MAX); return; } len = lb - path + 1; memcpy (newpath, path, len); strfcpy (newpath + len, link, _POSIX_PATH_MAX - len); } /* * Dereference a chain of symbolic links * * The final path is written to d. * */ static int dotlock_dereference_symlink (char *d, size_t l, const char *path) { struct stat sb; char realpath[_POSIX_PATH_MAX]; const char *pathptr = path; int count = 0; while (count++ < MAXLINKS) { if (lstat (pathptr, &sb) == -1) { /* perror (pathptr); */ return -1; } if (S_ISLNK (sb.st_mode)) { char linkfile[_POSIX_PATH_MAX]; char linkpath[_POSIX_PATH_MAX]; int len; if ((len = readlink (pathptr, linkfile, sizeof (linkfile) - 1)) == -1) { /* perror (pathptr); */ return -1; } linkfile[len] = '\0'; dotlock_expand_link (linkpath, pathptr, linkfile); strfcpy (realpath, linkpath, sizeof (realpath)); pathptr = realpath; } else break; } strfcpy (d, pathptr, l); return 0; } /* * Dotlock a file. * * realpath is assumed _not_ to be an absolute path to * the file we are about to lock. Invoke * dotlock_prepare () before using this function! * */ #define HARDMAXATTEMPTS 10 static int dotlock_lock (const char *realpath) { char lockfile[_POSIX_PATH_MAX + LONG_STRING]; char nfslockfile[_POSIX_PATH_MAX + LONG_STRING]; size_t prev_size = 0; int fd; int count = 0; int hard_count = 0; struct stat sb; time_t t; snprintf (nfslockfile, sizeof (nfslockfile), "%s.%s.%d", realpath, Hostname, (int) getpid ()); snprintf (lockfile, sizeof (lockfile), "%s.lock", realpath); unlink (nfslockfile); while ((fd = open (nfslockfile, O_WRONLY | O_EXCL | O_CREAT, 0)) < 0) { if (errno != EAGAIN) { /* perror ("cannot open NFS lock file"); */ return DL_EX_ERROR; } } close (fd); while (hard_count++ < HARDMAXATTEMPTS) { link (nfslockfile, lockfile); if (stat (nfslockfile, &sb) != 0) { /* perror ("stat"); */ return DL_EX_ERROR; } if (sb.st_nlink == 2) break; if (count == 0) prev_size = sb.st_size; if (prev_size == sb.st_size && ++count > Retry) { if (DotlockFlags & DL_FL_FORCE) { unlink (lockfile); count = 0; continue; } else { unlink (nfslockfile); return DL_EX_EXIST; } } prev_size = sb.st_size; /* don't trust sleep (3) as it may be interrupted * by users sending signals. */ t = time (NULL); do { sleep (1); } while (time (NULL) == t); } unlink (nfslockfile); return DL_EX_OK; } /* * Unlock a file. * * The same comment as for dotlock_lock () applies here. * */ static int dotlock_unlock (const char *realpath) { char lockfile[_POSIX_PATH_MAX + LONG_STRING]; int i; snprintf (lockfile, sizeof (lockfile), "%s.lock", realpath); i = unlink (lockfile); if (i == -1) return DL_EX_ERROR; return DL_EX_OK; } /* remove an empty file */ static int dotlock_unlink (const char *realpath) { struct stat lsb; int i = -1; if (dotlock_lock (realpath) != DL_EX_OK) return DL_EX_ERROR; if ((i = lstat (realpath, &lsb)) == 0 && lsb.st_size == 0) unlink (realpath); dotlock_unlock (realpath); return (i == 0) ? DL_EX_OK : DL_EX_ERROR; } /* * Check if a file can be locked at all. * * The same comment as for dotlock_lock () applies here. * */ static int dotlock_try (void) { if (access (".", W_OK) == 0) return DL_EX_OK; return DL_EX_IMPOSSIBLE; } lbdb-0.54/dotlock.h000066400000000000000000000024021465114770000141600ustar00rootroot00000000000000/* * Copyright (C) 1996-2000 Michael R. Elkins * Copyright (C) 1998-2000 Thomas Roessler * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _DOTLOCK_H #define _DOTLOCK_H /* exit values */ #define DL_EX_OK 0 #define DL_EX_ERROR 1 #define DL_EX_EXIST 3 #define DL_EX_IMPOSSIBLE 5 /* flags */ #define DL_FL_TRY (1 << 0) #define DL_FL_UNLOCK (1 << 1) #define DL_FL_FORCE (1 << 3) #define DL_FL_RETRY (1 << 4) #define DL_FL_UNLINK (1 << 5) #define DL_FL_ACTIONS (DL_FL_TRY|DL_FL_UNLOCK|DL_FL_UNLINK) #endif lbdb-0.54/dotlock.man000066400000000000000000000073431465114770000145150ustar00rootroot00000000000000.\" -*-nroff-*- .\" .\" .\" Copyright (C) 1996-1998 Michael R. Elkins .\" Copyright (C) 1998-1999 Thomas Roessler .\" Copyright (C) 2005-2018 Roland Rosenfeld .\" .\" This program is free software; you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by .\" the Free Software Foundation; either version 2 of the License, or .\" (at your option) any later version. .\" .\" This program is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public License .\" along with this program; if not, write to the Free Software Foundation, .\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. .\" .TH dotlock 1 "JANUARY 2016" Unix "User Manuals" .SH NAME .PP lbdb_dotlock \- Lock mail spool files. .SH SYNOPSIS .PP .B lbdb_dotlock [\-t|\-f|\-u|\-d] [\-r \fIretries\fP] \fIfile\fP .SH DESCRIPTION .PP .B dotlock implements the traditional mail spool file locking method: To lock \fIfile\fP, a file named \fIfile\fP.lock is created. .SH OPTIONS .PP .IP "\-t" Just try. .B dotlock won't actually lock a file, but inform the invoking process if it's at all possible to lock \fIfile\fP. .IP "\-f" Force the lock. If another process holds a lock on \fIfile\fP longer than a certain amount of time, .B dotlock will break that lock by removing the lockfile. .IP "\-u" Unlock. .B dotlock will remove \fIfile\fP.lock. .IP "\-d" Delete. .B dotlock will lock \fIfile\fP, remove it if it has length 0, and afterwards remove \fIfile\fP.lock. .IP "\-r \fIretries\fP" This command line option tells .B dotlock to try locking \fIretries\fP times before giving up or (if invoked with the .B \-f command line option) break a lock. The default value is 5. .B dotlock waits one second between successive locking attempts. .SH FILES .PP .IP "\fIfile\fP.lock" The lock file .B dotlock generates. .SH SEE ALSO .PP .BR fcntl (2), .BR flock (2), .BR lockfile (1), .BR lbdb-fetchaddr (1) .SH DIAGNOSTICS .PP .B dotlock gives all diagnostics in its return values: .TP .B "0 \- DL_EX_OK" The program was successful. .TP .B "1 \- DL_EX_ERROR" An unspecified error such as bad command line parameters, lack of system memory and the like has occurred. .TP .B "3 \- DL_EX_EXIST" The user wants to lock a file which has been locked by another process already. If .B dotlock is invoked with the .B \-f command line option, .B dotlock won't generate this error, but break other processes' locks. .TP .B "4 \- DL_EX_NEED_RPIVS" This return value only occurs if .B dotlock has been invoked with the .B \-t command line option. It means that .B dotlock will have to use its group mail privileges to lock \fIfile\fP. .TP .B "5 \- DL_EX_IMPOSSIBLE" This return value only occurs if .B dotlock has been invoked with the .B \-t command line option. It means that .B dotlock is unable to lock \fIfile\fP. .SH NOTES .PP .B dotlock tries to implement an NFS-safe dotlocking method which was borrowed from .BR lockfile (1). .PP If the user can't open \fIfile\fP for reading with his normal privileges, dotlock will return the .B DL_EX_ERROR exit value to avoid certain attacks against other users' spool files. The code carefully avoids race conditions when checking permissions; for details of all this see the comments in dotlock.c. .SH HISTORY .PP .B dotlock is part of the Mutt mail user agent package. It has been created to avoid running mutt with group mail privileges. .SH AUTHOR Thomas Roessler lbdb-0.54/fetchaddr.c000066400000000000000000000125161465114770000144470ustar00rootroot00000000000000/* * Copyright (C) 1998-2000 Thomas Roessler * Copyright (C) 2000-2018 Roland Rosenfeld * * This program is free software; you can redistribute * it and/or modify it under the terms of the GNU * General Public License as published by the Free * Software Foundation; either version 2 of the License, * or (at your option) any later version. * * This program is distributed in the hope that it will * be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A * PARTICULAR PURPOSE. See the GNU General Public * License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. * */ #include #include #include #include #include "helpers.h" #include "rfc822.h" #include "rfc2047.h" #define MAXHDRS 21 /* max personal length in bytes */ #define MAX_PERSONAL_LENGTH 70 struct header { char *tag; char *value; size_t len; size_t taglen; }; struct header hdr[MAXHDRS] = { { "to:", NULL, 0, 3 }, { "from:", NULL, 0, 5 }, { "cc:", NULL, 0, 3 }, { "resent-from:", NULL, 0, 12 }, { "resent-to:", NULL, 0, 10 }, { NULL, NULL, 0, 0 } }; void chop(struct header *cur) { if(cur->len && cur->value[cur->len - 1] == '\n') cur->value[--cur->len] = '\0'; } int writeout(struct header *h, const char *datefmt, unsigned char create_real_name) { int rv = 0; ADDRESS *addr, *p; time_t timep; char timebuf[256]; char *c; if(!h->value) return 0; addr = rfc822_parse_adrlist(NULL, h->value); time(&timep); rfc2047_decode_adrlist(addr); for(p = addr; p; p = p->next) { if(create_real_name == 1 && (!p->personal || !*p->personal) && p->mailbox) { if(p->personal) FREE(p->personal); p->personal = safe_strdup(p->mailbox); c=strchr(p->personal, '@'); if (c) *c='\0'; } if(!p->group && p->mailbox && *p->mailbox && p->personal) { const char end[] = "..."; if(p->personal && strlen(p->personal) > MAX_PERSONAL_LENGTH) strcpy(p->personal + MAX_PERSONAL_LENGTH - strlen(end), end); if ((c=strchr(p->mailbox,'@'))) for(c++; *c; c++) *c=tolower(*c); strftime(timebuf, sizeof(timebuf), datefmt, localtime(&timep)); printf("%s\t%s\t%s\n", p->mailbox, p->personal && *p->personal ? p->personal : "no realname given", timebuf); rv = 1; } } rfc822_free_address(&addr); return rv; } int main(int argc, char* argv[]) { char buff[2048]; char *t; int i, rv; int partial = 0; struct header *cur_hdr = NULL; char *datefmt = NULL; char *headerlist = NULL; char *fieldname, *next; char create_real_name = 0; #ifdef HAVE_ICONV const char **charsetptr = &Charset; #endif /* process command line arguments: */ if (argc > 1) { i = 1; while (i < argc) { if (!strcmp (argv[i], "-d") && i+1 < argc) { datefmt = argv[++i]; } else if (!strcmp (argv[i], "-x") && i+1 < argc) { headerlist = argv[++i]; #ifdef HAVE_ICONV } else if (!strcmp (argv[i], "-c") && i+1 < argc) { *charsetptr = argv[++i]; #endif } else if (!strcmp (argv[i], "-a")) { create_real_name = 1; } else { fprintf (stderr, "%s: `%s' wrong parameter\n", argv[0], argv[i]); } i++; } } if (!datefmt) datefmt = safe_strdup("%Y-%m-%d %H:%M"); if (headerlist && strlen (headerlist) > 0 ) { fieldname = headerlist; i = 0; while ( i < MAXHDRS-1 && (next = strchr (fieldname, ':'))) { hdr[i].tag = safe_malloc (next - fieldname + 2); strncpy (hdr[i].tag, fieldname, next - fieldname); hdr[i].tag[next - fieldname] = ':'; hdr[i].tag[next - fieldname + 1] = '\0'; hdr[i].taglen = next - fieldname + 1; fieldname = next+1; i++; } if (i < MAXHDRS-1 && *fieldname != '\0') { hdr[i].tag = safe_malloc (strlen (fieldname) + 2); strcpy (hdr[i].tag, fieldname); hdr[i].tag[strlen (fieldname)] = ':'; hdr[i].tag[strlen (fieldname) + 1] = '\0'; hdr[i].taglen = strlen (fieldname) + 1; i++; } hdr[i].tag = NULL; /* end of hdr list */ } while(fgets(buff, sizeof(buff), stdin)) { if(!partial && *buff == '\n') break; if(cur_hdr && (partial || *buff == ' ' || *buff == '\t')) { size_t nl = cur_hdr->len + strlen(buff); safe_realloc((void **) &cur_hdr->value, nl + 1); strcpy(cur_hdr->value + cur_hdr->len, buff); cur_hdr->len = nl; chop(cur_hdr); } else if(!partial && *buff != ' ' && *buff != '\t') { cur_hdr = NULL; for(i = 0; hdr[i].tag; i++) { if(!strncasecmp(buff, hdr[i].tag, hdr[i].taglen)) { cur_hdr = &hdr[i]; break; } } if(cur_hdr) { safe_free(&cur_hdr->value); cur_hdr->value = safe_strdup(buff + cur_hdr->taglen); if (cur_hdr->value) { cur_hdr->len = strlen(cur_hdr->value); chop(cur_hdr); } } } if(!(t = strchr(buff, '\n'))) partial = 1; else partial = 0; } for(rv = 0, i = 0; hdr[i].tag; i++) { if(hdr[i].value) rv = writeout(&hdr[i], datefmt, create_real_name) || rv; } return (rv ? 0 : 1); } lbdb-0.54/helpers.c000066400000000000000000000060651465114770000141670ustar00rootroot00000000000000/* * The functions in this file have completely been stolen * from the Mutt mail user agent, with some slight * modifications by Thomas Roessler to * use them in the "little brother database". * * The following copyright notice applies: * * Copyright (C) 1996-8 Michael R. Elkins * * This program is free software; you can * redistribute it and/or modify it under the terms * of the GNU General Public License as published by * the Free Software Foundation; either version 2 of * the License, or (at your option) any later * version. * * This program is distributed in the hope that it * will be useful, but WITHOUT ANY WARRANTY; without * even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. */ #include #include #include #include #include "helpers.h" void *safe_calloc (size_t nmemb, size_t size) { void *p; if (!nmemb || !size) return NULL; if (!(p = calloc (nmemb, size))) { perror ("Out of memory"); sleep (1); exit (1); } return p; } void *safe_malloc (unsigned int siz) { void *p; if (siz == 0) return 0; if ((p = (void *) malloc (siz)) == 0) { perror ("Out of memory!"); sleep (1); exit (1); } return (p); } void safe_realloc (void **p, size_t siz) { void *r; if (siz == 0) { if (*p) { free (*p); *p = NULL; } return; } if (*p) r = (void *) realloc (*p, siz); else { /* realloc(NULL, nbytes) doesn't seem to work under SunOS 4.1.x */ r = (void *) malloc (siz); } if (!r) { perror ("Out of memory!"); sleep (1); exit (1); } *p = r; } void safe_free (void *ptr) { void **p = (void **)ptr; if (*p) { free (*p); *p = 0; } } char *safe_strdup (const char *s) { char *p; size_t l; if (!s || !*s) return 0; l = strlen (s) + 1; p = (char *)safe_malloc (l); memcpy (p, s, l); return (p); } size_t safe_strlen(const char *a) { return a ? strlen (a) : 0; } int safe_strcmp(const char *a, const char *b) { return strcmp(NONULL(a), NONULL(b)); } static inline int ascii_isupper (int c) { return (c >= 'A') && (c <= 'Z'); } static inline int ascii_tolower (int c) { if (ascii_isupper (c)) return c | 32; return c; } int ascii_strcasecmp (const char *a, const char *b) { int i; if (a == b) return 0; if (a == NULL && b) return -1; if (b == NULL && a) return 1; for (;; a++, b++) { if ((i = ascii_tolower (*a) - ascii_tolower (*b))) return i; /* test for NUL here rather that in the for loop in order to detect unqual * length strings (see http://dev.mutt.org/trac/ticket/3601) */ if (!*a) break; } return 0; } lbdb-0.54/helpers.h000066400000000000000000000044111465114770000141650ustar00rootroot00000000000000/* * Copyright (c) 1998 Thomas Roessler * * This file contains the prototypes for several of the * functions from helpers.c. It is part of the "little * brother database" packet. * * These functions have been stolen from the mutt mail * user agent. The copyright notice from there: * * Copyright (C) 1996-8 Michael R. Elkins * * This program is free software; you can * redistribute it and/or modify it under the terms * of the GNU General Public License as published by * the Free Software Foundation; either version 2 of * the License, or (at your option) any later * version. * * This program is distributed in the hope that it * will be useful, but WITHOUT ANY WARRANTY; without * even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. */ #ifndef _HELPERS_H #define _HELPERS_H #include #include #include #include "rfc822.h" char *safe_strdup (const char *); void *safe_calloc (size_t, size_t); void *safe_malloc (unsigned int); void safe_realloc (void **, size_t); void safe_free (void *); size_t safe_strlen (const char *); int safe_strcmp (const char *, const char *); #define FREE(x) safe_free(x) #define SKIPWS(c) while (*(c) && isspace ((unsigned char) *(c))) c++; #define strfcpy(A,B,C) strncpy(A,B,C), *((A)+(C)-1)=0 # define NONULL(x) x?x:"" #define STRING 256 #define LONG_STRING 1024 #define EMAIL_WSP " \t\r\n" /* skip over WSP as defined by RFC5322. This is used primarily for parsing * header fields. */ static inline char *skip_email_wsp(const char *s) { if (s) return (char *)(s + strspn(s, EMAIL_WSP)); return (char *)s; } static inline int is_email_wsp(char c) { return c && (strchr(EMAIL_WSP, c) != NULL); } #define ascii_strcmp(a,b) safe_strcmp(a,b) int ascii_strcasecmp (const char *a, const char *b); static inline const char *mutt_addr_for_display (ADDRESS *a) { return a->mailbox; } #endif lbdb-0.54/install-sh000077500000000000000000000127201465114770000143600ustar00rootroot00000000000000#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # 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 $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 lbdb-0.54/lbdb-fetchaddr.man.in000066400000000000000000000077531465114770000163150ustar00rootroot00000000000000.\" -*- nroff -*- .\" Copyright (c) 1998-2023 Roland Rosenfeld .\" .\" This program is free software; you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by .\" the Free Software Foundation; either version 2 of the License, or .\" (at your option) any later version. .\" .\" This program is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public License .\" along with this program; if not, write to the Free Software Foundation, .\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. .\" .TH LBDB-FETCHADDR 1 "March 2018" "Unix" "User Manuals" .SH NAME lbdb-fetchaddr \- grab addresses from mails and append them to lbdb database .SH SYNOPSIS .B lbdb-fetchaddr .RB [ -d .IR dateformat ] .RB [ -x .IR headerfieldlist ] .RB [ -c .IR charset ] .RB [ -a ] .RB [ -f .IR databasefile ] .br .B lbdb-fetchaddr .RB [ -v | -h ] .SH DESCRIPTION .B lbdb-fetchaddr is a shell script which reads a mail on stdin. It extracts the contents of some header fields (default: .RB ` From: ', .RB ` To: ', .RB ` Cc: ', .RB ` Resent-From: ', and .RB ` Resent-To: ') from the mail header (only addresses with a real name) and appends them to the database file, which defaults to .I $XDG_DATA_HOME/lbdb/m_inmail.db or .I $HOME/.lbdb/m_inmail.utf-8 if the latter already exists (backward compatibility). .PP For performance issues .B lbdb-fetchaddr appends new addresses to this file without removing duplicates. To get rid of duplicates, the program .B lbdb-munge exists, which is run by .B m_inmail if needed and removes duplicates. .PP To use this program, put the following lines into your .I $HOME/.procmailrc: .nf :0hc | lbdb-fetchaddr .fi .PP .B lbdb-fetchaddr writes the actual date to the third column of the database by using .BR strftime (3). It uses "%Y-%m-%d %H:%M" as the default date format (e.g. "1999-04-29 14:33"). You can change this by using the .B -d option to select a different date format string as parameter of lbdb-fetchaddr command like .nf :0hc | lbdb-fetchaddr \-d "%y-%m-%d" .fi which results in e.g. "99-04-29". .SH OPTIONS .TP .B -v Print version number of lbdb-fetchaddr. .TP .B -h Print short help of lbdb-fetchaddr. .TP .BI -d " dateformat" Use the given date format using .BR strftime (3) syntax. .TP .BI -x " headerfields" A colon separated list of header fields, which should be searched for mail addresses. If this option isn't given, we fall back to .RB ` from:to:cc:resent-from:resent-to '. .TP .BI -c " charset" The charset which will be used to write the database. This should be the charset which the application expects (normally the one from your current locale). If this option isn't given, we fall back to .RB ` utf-8 '. .TP .B -a Also grab addresses without a real name. Use the local part of the mail address as real name. .TP .BI -f " databasefile" Use the given file for storing the grabbed addresses instead of using the .I $XDG_DATA_HOME/lbdb/m_inmail.db resp. .I $HOME/.lbdb/m_inmail.utf-8 default. .SH FILES .I $XDG_DATA_HOME/lbdb/m_inmail.db .br .IR $HOME/.lbdb/m_inmail.utf-8 " (old version before using $XDG_DATA_HOME)" .br .IR $HOME/.lbdb/m_inmail.list " (old version used for ISO-8859-15 encoded addresses)" .br .I @libdir@/fetchaddr .br .I @libdir@/m_inmail .SH "SEE ALSO" .BR lbdbq (1), .BR @dotlock@ (1), .BR procmail (1), .BR procmailrc (5), .BR strftime (3). .SH CREDITS Most of the really interesting code of this program (namely, the RFC 822 address parser used by lbdb-fetchaddr) was stolen from Michael Elkins' mutt mail user agent. Additional credits go to Brandon Long for putting the query functionality into mutt. .SH AUTHOR The lbdb package was written by Thomas Roessler and is now maintained and extended by Roland Rosenfeld . lbdb-0.54/lbdb-fetchaddr.sh.in000066400000000000000000000064371465114770000161520ustar00rootroot00000000000000#! @SH@ # # -*-sh-*- # Copyright (C) 1998-2000 Thomas Roessler # 1999-2023 Roland Rosenfeld # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. LBDB_VERSION=@LBDB_VERSION@ umask 077 prefix=@prefix@ exec_prefix=@exec_prefix@ dotlock=@DOTLOCK@ [ -n "$USE_LOCAL_LIB" ] && [ -x $USE_LOCAL_LIB/lbdb_dotlock ] && dotlock=$USE_LOCAL_LIB/lbdb_dotlock fetchaddr=${USE_LOCAL_LIB:-@libdir@}/fetchaddr db=${XDG_DATA_HOME:-$HOME/.local/share}/lbdb/m_inmail.db [ -f $HOME/.lbdb/m_inmail.utf-8 ] && db=$HOME/.lbdb/m_inmail.utf-8 datefmt='%Y-%m-%d %H:%M' additional_param="" usage() { echo "Usage: $0 [OPTIONS]" echo " dig addresses from stdin with formatted timestamp" echo "Options:" echo " -v print version of lbdbq" echo " -h this short help" echo " -d 'dateformat' select date format using strftime(3)" echo " -x 'from:to:cc' colon separated list of header fields" echo " -c 'charset' charset for the database storage" echo " -a also grep addresses without realname" echo " -f 'filename' database filename defaults to" echo " \$XDG_DATA_HOME/lbdb/m_inmail.db or" echo " \$HOME/.lbdb/m_inmail.utf-8 if already exists" } while [ $# -gt 0 ] do case "$1" in -v) echo "lbdb-fetchaddr version $LBDB_VERSION" exit 0 ;; -h) usage exit 0 ;; -d) if [ $# -gt 1 ] then shift datefmt="$1" fi ;; -x) if [ $# -gt 1 ] then shift hdrlist="-x $1" fi ;; -c) if [ $# -gt 1 ] then shift charset="-c $1" fi ;; -f) if [ $# -gt 1 ] then shift db="$1" fi ;; -a) additional_param="$additional_param $1" ;; *) if [ $# -eq 1 ] then # backward compatibility: # only one parameter means, that this is the selected datefmt datefmt="$1" else echo "Wrong number of parameters!" usage exit 1 fi ;; esac shift done if [ ! -f "$db" ]; then dbdir=$(dirname "$db") if [ ! -d "$dbdir" ]; then mkdir -p "$dbdir" if [ ! -d "$dbdir" ]; then echo "Can't create $dbdir" >&2 exit 1 fi fi touch "$db" if [ ! -f "$db" ]; then echo "Can't create $db" >&2 exit 1 fi fi if $dotlock -r 10 -f "$db" then : # okay, do nothing else echo "Can't lock $db [dotlock returned $?]." >&2 exit 1 fi if $fetchaddr $additional_param -d "$datefmt" $hdrlist $charset >> "$db" then touch "$db.dirty" fi # drop unused stdin cat > /dev/null $dotlock -u "$db" lbdb-0.54/lbdb-munge.sh.in000066400000000000000000000036261465114770000153360ustar00rootroot00000000000000#! @SH@ # # -*-sh-*- # # Copyright (C) 1999-2022 Roland Rosenfeld # Copyright (C) 2007 Yaroslav Halchenko # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. LBDB_VERSION=@LBDB_VERSION@ umask 077 prefix=@prefix@ exec_prefix=@exec_prefix@ dotlock=@DOTLOCK@ [ -n "$USE_LOCAL_LIB" ] && [ -x $USE_LOCAL_LIB/lbdb_dotlock ] && dotlock=$USE_LOCAL_LIB/lbdb_dotlock db=$M_INMAIL_DB munge=${USE_LOCAL_LIB:-@libdir@}/munge if [ ! -f $db.dirty ] then # Nothing to do exit 0 fi if [ "$SORT_OUTPUT" = "false" -o "$SORT_OUTPUT" = "no" ] then munge_options="keeporder=1" fi if [ -z "$MUNGE_LIMITCOUNT" ] then munge_options="$munge_options limitcount=1" else munge_options="$munge_options limitcount=$MUNGE_LIMITCOUNT" fi if [ ! -z "$MUNGE_LIMITDATE" ] then munge_options="$munge_options limitdate='$MUNGE_LIMITDATE'" fi if $dotlock -r 10 -f $db then : # okay, do nothing else echo "Can't lock $db [dotlock returned $?]." >&2 exit 1 fi if $munge ${munge_options} < $db > $db.$$.tmp then # only move, if munge successful: mv -f $db.$$.tmp $db rm -f $db.dirty else rm -f $db.$$.tmp # maybe write a debug log here... fi $dotlock -u $db lbdb-0.54/lbdb-pkg.el.in000066400000000000000000000001411465114770000147570ustar00rootroot00000000000000(define-package "lbdb" "@LBDB_ELPA_VERSION@" "Little Brother's Database interface." nil) lbdb-0.54/lbdb.el000066400000000000000000000307241465114770000136050ustar00rootroot00000000000000;;; lbdb.el - Little Brother's Database interface. ;; Copyright 2000,2001 by Dave Pearson ;; lbdb.el is free software distributed under the terms of the GNU ;; General Public Licence, version 2. For details see the file COPYING. ;;; Commentary: ;; ;; lbdb.el is an emacs interface to the Little Brother's Database. You can ;; find out more about LBDB at . ;; ;; A number of commands are provided, they are: ;; ;; +-------------------+---------------------------------------------+ ;; |Function |Description | ;; +-------------------+---------------------------------------------+ ;; | lbdb |Perform an interactive query. You will be | ;; | |prompted for the text to search for. | ;; +-------------------+---------------------------------------------+ ;; | lbdb-region |Perform a lbdb query using the content of the| ;; | |currently marked region as the text to search| ;; | |for. | ;; +-------------------+---------------------------------------------+ ;; | lbdb-maybe-region |If a mark is active do lbdb-region, if no | ;; | |mark is active do lbdb. | ;; +-------------------+---------------------------------------------+ ;; | lbdb-last |Recall and work with the results of the last | ;; | |query you performed. | ;; +-------------------+---------------------------------------------+ ;; ;; The latest lbdb.el is always available from: ;; ;; ;;; BUGS: ;; ;; o Mouse selection doesn't work in XEmacs. ;;; INSTALLATION: ;; ;; o Drop lbdb.el somwehere into your `load-path'. Try your site-lisp ;; directory for example (you might also want to byte-compile the file). ;; ;; o Add the following autoload statements to your ~/.emacs file: ;; ;; (autoload 'lbdb "lbdb" "Query the Little Brother's Database" t) ;; (autoload 'lbdb-region "lbdb" "Query the Little Brother's Database" t) ;; (autoload 'lbdb-maybe-region "lbdb" "Query the Little Brother's Database" t) ;;; Code: ;; Things we need: (eval-when-compile (require 'cl)) ;; Attempt to handle older/other emacs. (eval-and-compile ;; If customize isn't available just use defvar instead. (unless (fboundp 'defgroup) (defmacro defgroup (&rest rest) nil) (defmacro defcustom (symbol init docstring &rest rest) `(defvar ,symbol ,init ,docstring))) ;; If `line-beginning-position' isn't available provide one. (unless (fboundp 'line-beginning-position) (defun line-beginning-position (&optional n) "Return the `point' of the beginning of the current line." (save-excursion (beginning-of-line n) (point)))) ;; If `line-end-position' isn't available provide one. (unless (fboundp 'line-end-position) (defun line-end-position (&optional n) "Return the `point' of the end of the current line." (save-excursion (end-of-line n) (point))))) ;; Customize options. (defgroup lbdb nil "Little Brother's Database interface" :group 'external :prefix "lbdb-") (defcustom lbdb-query-command "lbdbq" "*Command for querying the Little Brother's Database." :type 'string :group 'lbdb) (defcustom lbdb-sort-display 'name "*The method used to sort the results display." :type '(choice (const :tag "Sort by name" name) (const :tag "Sort by email address" email) (const :tag "Don't sort" nil)) :group 'lbdb) (defcustom lbdb-mode-hook nil "*Hooks for `lbdb-mode'." :type 'hook :group 'lbdb) (defcustom lbdb-name-format-function (lambda (entry) (lbdb-name entry)) "*Function to format the name before insertion into the current buffer." :type 'function :group 'lbdb) (defcustom lbdb-address-format-function (lambda (entry) (format "" (lbdb-email entry))) "*Function to format the email address before insertion into the current buffer." :type 'function :group 'lbdb) (defcustom lbdb-full-format-function (lambda (entry) (format "\"%s\" <%s>" (lbdb-name entry) (lbdb-email entry))) "*Function to format the name and email address before insertion into the current buffer." :type 'function :group 'lbdb) (defcustom lbdb-mouse-select-action 'lbdb-insert-full "*Pointer to the function that is called when mouse-2 is pressed." :type '(choice (const :tag "Insert the name/address combination" lbdb-insert-full) (const :tag "Insert only the email address" lbdb-insert-address) (const :tag "Insert only the name" lbdb-insert-name)) :group 'lbdb) ;; Constants. (defconst lbdb-buffer-name "*lbdb*" "Name of the Little Brother's Database buffer.") ;; Non-customize variables. (defvar lbdb-mode-map nil "Local keymap for a `lbdb-mode' buffer.") (defvar lbdb-last-buffer nil "`current-buffer' when `lbdb' was called.") (defvar lbdb-results nil "The results of the current query.") ;; Data access functions. (defsubst lbdb-email (entry) "Return the email address of a lbdb entry." (nth 0 entry)) (defsubst lbdb-name (entry) "Return the name of a lbdb entry." (nth 1 entry)) (defsubst lbdb-method (entry) "Return the acquisition method of a lbdb entry." (nth 2 entry)) ;; Support functions. (defun lbdb-generate-format-string (results) "Generate a `format' string for displaying RESULTS." (loop for line in results for email-len = (length (lbdb-email line)) then (max email-len (length (lbdb-email line))) for name-len = (length (lbdb-name line)) then (max name-len (length (lbdb-name line))) finally return (format "%%-%ds %%-%ds %%s" name-len email-len))) (defun lbdb-line-as-list () "Split the current line into its component parts. The return value is a list, the component parts of that list are: (ADDRESS NAME METHOD) Where ADDRESS is the email address, NAME is the name associated with that email address and METHOD is the method lbdbq used to find that address." (split-string (buffer-substring-no-properties (point) (line-end-position)) "\t")) (defun lbdb-buffer-to-list () "Convert the current buffer into a lbdb result list. It is assumed that the current buffer contains the output of a call to lbdbq." (save-excursion (setf (point) (point-min)) (forward-line) ; Skip the message line. (loop until (eobp) unless (looking-at "^$") collect (lbdb-line-as-list) do (forward-line)))) (defun lbdb-sort (results) "Sort a lbdb result list. The type of sort is controlled by `lbdb-sort-display'." (if lbdb-sort-display (sort results (case lbdb-sort-display (name (lambda (x y) (string< (downcase (lbdb-name x)) (downcase (lbdb-name y))))) (email (lambda (x y) (string< (downcase (lbdb-email x)) (downcase (lbdb-email y))))))) results)) (defun lbdb-mark-active-p () "Is there a mark active? Because there's more than one true emacs." (if (boundp 'mark-active) ;; GNU Emacs. (symbol-value 'mark-active) ;; X Emacs. (funcall (symbol-function 'region-exists-p)))) (defun lbdb-deactivate-mark () "Deactivate any active mark. Because there's more than one true emacs." (when (fboundp 'deactivate-mark) ;; GNU emacs. (funcall (symbol-function 'deactivate-mark)))) ;; Main code. ;;;###autoload (defun lbdb (query) "Interactively query the Little Brother's Database." (interactive "sQuery: ") (lbdb-present-results (lbdbq query (called-interactively-p 'any)))) ;;;###autoload (defun lbdb-region (start end) "Look for the contents of regioning bounded by START and END." (interactive "r") (lbdb-deactivate-mark) (lbdb (buffer-substring-no-properties start end))) ;;;###autoload (defun lbdb-maybe-region () "If region is active search for content of region otherwise prompt." (interactive) (call-interactively (if (lbdb-mark-active-p) #'lbdb-region #'lbdb))) ;;;###autoload (defun lbdb-last () "Recall and use the results of the last successful query." (interactive) (lbdb-present-results lbdb-results)) (defun lbdb-present-results (results) "Present the results in a buffer and allow the user to interact with them." (if results (let ((format (lbdb-generate-format-string results))) (setq lbdb-results results) (unless (string= (buffer-name) lbdb-buffer-name) (setq lbdb-last-buffer (current-buffer))) (pop-to-buffer lbdb-buffer-name) (let ((buffer-read-only nil)) (setf (buffer-string) "") (loop for line in results do (let ((start (point))) (insert (format format (lbdb-name line) (lbdb-email line) (lbdb-method line)) "\n") (put-text-property start (1- (point)) 'mouse-face 'highlight)))) (setf (point) (point-min)) (lbdb-mode)) (error "No matches found in the Little Brother's Database"))) (defun lbdbq (query &optional interactive) "Query the Little Brother's Database and return a list of results. QUERY is the text to search for. If INTERACTIVE is non-nil the message area will be updated with the progress of the function. This parameter is optional and the deafult is nil." (with-temp-buffer (when interactive (message "Querying the Little Brother's Database...")) (call-process lbdb-query-command nil (current-buffer) nil query) (prog1 (lbdb-sort (lbdb-buffer-to-list)) (when interactive (message "Querying the Little Brother's Database...done"))))) ;; lbdb mode. (unless lbdb-mode-map (let ((map (make-sparse-keymap))) (suppress-keymap map t) (define-key map "a" #'lbdb-insert-address) (define-key map "n" #'lbdb-insert-name) (define-key map (kbd "RET") #'lbdb-insert-full) (define-key map "q" #'lbdb-mode-quit) (define-key map [(control g)] #'lbdb-mode-quit) (define-key map [mouse-2] #'lbdb-mouse-select) (define-key map "?" #'describe-mode) (setq lbdb-mode-map map))) (put 'lbdb-mode 'mode-class 'special) (defun lbdb-mode () "A mode for browsing the results a an `lbdb' query. The key bindings for `lbdb-mode' are: \\{lbdb-mode-map}" (interactive) (kill-all-local-variables) (use-local-map lbdb-mode-map) (setq major-mode 'lbdb-mode mode-name "lbdb") (run-hooks 'lbdb-mode-hook) (setq buffer-read-only t truncate-lines t) (buffer-disable-undo (current-buffer))) (defun lbdb-mode-quit () "Quit the current lbdb buffer." (interactive) (kill-buffer lbdb-buffer-name) (switch-to-buffer lbdb-last-buffer) (delete-other-windows)) (defun lbdb-insert (type) "Insert the details of the lbdb entry under the cursor. TYPE dictates what will be inserted, options are: `name' - Insert the name. `lbdb-name-format-function' is used to format the name. `address' - Insert the address. `lbdb-address-format-function' is used to format the address. `full' - Insert the name and the address. `lbdb-full-format-function' is used to format the name and address." (let ((line (nth (count-lines (point-min) (line-beginning-position)) lbdb-results))) (if line (with-current-buffer lbdb-last-buffer (insert (case type ('name (funcall lbdb-name-format-function line)) ('address (funcall lbdb-address-format-function line)) ('full (funcall lbdb-full-format-function line))))) (error "No details on that line")) line)) (defun lbdb-mouse-select (event) "Select the entry under the mouse click." (interactive "e") (setf (point) (posn-point (event-end event))) (funcall lbdb-mouse-select-action)) (defmacro lbdb-make-inserter (type) "Macro to make a key-response function for use in `lbdb-mode-map'." `(defun ,(intern (format "lbdb-insert-%S" type)) () ,(format "Insert the result of calling `lbdb-insert' with `%s'." type) (interactive) (when (lbdb-insert ',type) (lbdb-mode-quit)))) (lbdb-make-inserter name) (lbdb-make-inserter address) (lbdb-make-inserter full) (provide 'lbdb) ;;; lbdb.el ends here lbdb-0.54/lbdb.rc.in000066400000000000000000000203751465114770000142170ustar00rootroot00000000000000# # This is the main configuration file of the little brothers database lbdb # # Everything you configure here can be overridden by the users config # file which can be found at # $XDG_CONFIG_HOME/lbdb/config # ~/.lbdbrc # ~/.lbdb/lbdbrc # ~/.lbdb/rc # (evaluated with ascending priority!) # # (c) 1999-2023 Roland Rosenfeld # # # Select which methods you want to use in which order (ascending priority): # (a space separated list) # # - m_inmail search the database created by lbdb-fetchaddr(1) # - m_finger finger some hosts defined in variable M_FINGER_HOSTS # - m_passwd search the local /etc/passwd file. # - m_yppasswd search the NIS password database. # - m_nispasswd search the NIS+ password database. # - m_getent search the password database (whatever is configured). # - m_pgp2 search your PGP 2.* keyring # - m_pgp5 search your PGP 5.* keyring # - m_gpg search your GnuPG keyring # - m_fido search the Fido nodelist converted by nodelist2lbdb(1) # - m_abook query abook(1), the text based address book application. # - m_goobook query goobook(1), a command line interface to Google contacts. # - m_addr_email query addr-email(1) from addressbook Tk-program. # - m_mu query mu-cfind(1) from the mu Maildir indexer. # - m_muttalias search $MUTTALIAS_FILES for aliases. # - m_pine search pine(1) addressbook files for aliases. # - m_palm search your Palm addressbook file. # - m_gnomecard search your GnomeCard address database files. # - m_bbdb search your BBDB (big brother database). # - m_ldap query an LDAP server # - m_wanderlust search your wanderlust ~/.addresses file. # - m_osx_addressbook search the OS X addressbook (only available on OS X). # - m_evolution search in the Ximan Evolution addressbook. # - m_vcf search a vcard (according to RFC2426) file. # - m_khard search a CardDAV address book via khard METHODS="m_inmail m_passwd m_finger" # # If you want to use a different database file for m_inmail, you can # define it in INMAIL_DB (defaults to $XDG_DATA_HOME/lbdb/m_inmail.db or # $HOME/.lbdb/m_inmail.utf-8 if the latter exists) # #INMAIL_DB="${XDG_DATA_HOME:-$HOME/.local/share}/lbdb/m_inmail.db" # # If you want m_finger to ask other host then localhost, create a list here: # (a space separated list): # #M_FINGER_HOSTS="master.debian.org va.debian.org localhost" # # If it isn't possible to find out the correct mail domain name of # your system in /etc/mailname, by reading sendmail.cf, /etc/hostname # or /etc/HOSTNAME, you can specify it in the variable # MAIL_DOMAIN_NAME. This overrides all other mechanisms. # #MAIL_DOMAIN_NAME=does-not-exist.org # - m_muttalias query set of mutt alias files: # # Set MUTTALIAS_FILES below to list of files in MUTT_DIRECTORY that # contain mutt aliases. File names without leading slash will have # $MUTT_DIRECTORY (defaults to $HOME/.mutt or $HOME, if ~/.mutt does # not exist) prepended before the file name. Absolute file names # (beginning with /) will be taken direct. # #MUTT_DIRECTORY="$HOME/.mutt" #MUTTALIAS_FILES=".muttrc .mail_aliases muttrc aliases" # - m_pine search pine addressbook files for aliases: # # This module first inspects the variable PINERC. If it isn't set, the # default `/etc/pine.conf /etc/pine.conf.fixed .pinerc' is used. To # suppress inspecting the PINERC variable, set it to "no". It than # takes all address-book and global-address-book entries from these # pinerc files and adds the contents of the variable PINE_ADDRESSBOOKS # to the list, which defaults to `/etc/addressbook .addressbook'. Then # these addressbooks are searched for aliases. All filenames without # leading slash are searched in $HOME. # #PINERC="/etc/pine.conf /etc/pine.conf.fixed .pinerc" #PINE_ADDRESSBOOKS="/etc/addressbook .addressbook" # - m_wanderlust search your WanderLust addresses files: # # Set WANDERLUST_ADDRESSES below to point to your WanderLust address # book. If you don't set this variable, the default # ($HOME/.addresses) is used. # #WANDERLUST_ADDRESSES="$HOME/.addresses" # - m_palm search your Palm addressbook file: # # This module searches the Palm address database using the Palm::PDB # and Palm::Address Perl modules from CPAN. It searches in the # variable PALM_ADDRESS_DATABASE or if this isn't set in # $HOME/.jpilot/AddressDB.pdb. # #PALM_ADDRESS_DATABASE="$HOME/.jpilot/AddressDB.pdb" # - m_gnomecard search your GnomeCard address database files. # # This module searches for addresses in your GnomeCard database files. # The variable GNOMECARD_FILES is a whitespace separated list of # GnomeCard data files. If this variable isn't defined, the module # searches in $HOME/.gnome/GnomeCard for the GnomeCard database or at # least falls back to $HOME/.gnome/GnomeCard.gcrd. If a filename does # not start with a slash, it is prefixed with $HOME/. # #GNOMECARD_FILES="$HOME/.gnome/GnomeCard.gcrd" # - m_bbdb search your BBDB (big brother database). # # This module searches for addresses in your (X)Emacs BBDB (big # brother database). It doesn't access ~/.bbdb directly (yet) but # calls emacs(1) or xemacs(1) with a special mode to get the # information (so don't expect too much performance in this module). # You can configure the EMACS variable to tell this module which # emacsen to use. Otherwise it will fall back to emacs or xemacs. # #EMACS="emacs" # - m_ldap query an LDAP server. # # This module queries an LDAP server using the Net::LDAP Perl modules # from CPAN. It can be configured using an external resource file. You # can explicitly define a LDAP query in this file or you can use one or # more of the predefined queries from the %ldap_server_db in this # file. For this you have to define the selected entries as a space # separated list in the the variable LDAP_NICKS. # #LDAP_NICKS="debian bigfoot" # - m_abook query the abook(1) program # # if you have more than one abook addressbook, use the ABOOK_FILES # variable. It contains a space separated list of all your files. # Default is $HOME/.abook/addressbook $HOME/.abook.addressbook # ABOOK_FILES="$HOME/.abook/friends $HOME/.abook/work" # - m_passwd search in /etc/passwd # # On a Debian system only the UIDs 1000-29999 are used for normal # users. Setting PASSWD_IGNORESYS to "true" implies that lbdbq # ignores and UID, which isn't in that range: #PASSWD_IGNORESYS=true # - m_vcf search in vcard files # # You have to define the vcard files space separated in $VCF_FILES to # make this module work: #VCF_FILES=$HOME/my.vcf # # If you want to use private modules set the MODULES_PATH to find them: # (a space separated list): # #MODULES_PATH="/usr/lib/lbdb $HOME/.lbdb/modules" # # Do you want the output to be sorted? # If you set this to "false" or "no", lbdbq won't sort the addresses # but returns them in reverse order (which means that the most recent # address in m_inmail database is first). # If you set this to "name", lbdbq sorts the output by real name. # If you set this to "comment", lbdbq sorts the output by comment (column 3). # If you set this to "reverse_comment", lbdbq sorts the output by comment # but with reverse order (column 3). # If you set this to "address", lbdbq sorts the output by addresses # (that's the default). # #SORT_OUTPUT=address # # Do you want to see duplicate mail addresses (with multiple real # names or different comment fields)? Default is "no". # #KEEP_DUPES=no # # Do you want to automatically remove outdated and infrequently used # entries collected by m_inmail? # Following date parameter specify the date before which (ie being # older) only those entries survive, which were seen by m_inmail more # than a specified times. Since rc is parsed on every lbdbq # invocation, we can use date command to specify dynamic range as "-1 # month". By default we keep entries which were seen at 3 times, # or younger than 1 month # # Note: KEEP_DUPES must be "no" # #MUNGE_LIMITCOUNT=3 #MUNGE_LIMITDATE=$(date --date='-1 month' +"%F %R") # # If you only want to find addresses seen in messages where one of # 'my' e-mail addresses was seen in one of the address fields in m_mu, # set MU_PERSONAL to true or yes. # If you only want to see addresses seen in messages after a given # UNIX timestamp, set the limiting timestamp in MU_AFTER. # #MU_PERSONAL=true #MU_AFTER=$(date --date='-1 year' +%s) lbdb-0.54/lbdb.sl000066400000000000000000000043111465114770000136140ustar00rootroot00000000000000% % Query the little brother's database from within jed. % % activate this by adding the following line to your ~/.jedrc: % autoload ("lbdbq", "/some/path/to/your/jedfiles/lbdb"); % % Then you can use it by entering "M-x lbdbq" (or bind it on some key) % % Thomas Roessler % Mon Jul 27 23:27:57 MEST 1998 % variable lbdb_buf = "*lbdb*"; variable num_win; variable buf; variable old_buf; !if (keymap_p(lbdb_buf)) make_keymap(lbdb_buf); definekey ("lbdb_select", "\r", lbdb_buf); definekey ("lbdb_quit", "q", lbdb_buf); definekey ("next_line_cmd", "j", lbdb_buf); definekey ("previous_line_cmd", "k", lbdb_buf); define lbdb_select_str() { if(not(bolp())) go_left_1(); while(1) { if(looking_at_char(',')) break; if(looking_at_char(' ')) break; if(looking_at_char('\t')) break; if(bolp()) break; go_left_1(); } if(looking_at_char(',') or looking_at_char(' ') or looking_at_char('\t')) go_right_1(); push_mark(); while(1) { if(looking_at_char(',')) break; if(looking_at_char(' ')) break; if(looking_at_char('\t')) break; if(eolp()) break; go_right_1(); } } define lbdb_quit() { sw2buf(old_buf); pop2buf(buf); if(num_win == 1) onewindow(); delbuf(lbdb_buf); } define lbdb_select() { variable addr; bol(); push_mark_eol(); addr = bufsubstr(); lbdb_quit(); lbdb_select_str(); del_region(); insert(addr); } define lbdbq() { variable query; variable file, flags; buf = whatbuf(); push_spot(); lbdb_select_str(); query = bufsubstr(); pop_spot(); sw2buf(lbdb_buf); (file,,flags) = getbuf_info(); setbuf_info(file, query, lbdb_buf, flags); set_readonly(0); erase_buffer(); use_keymap(lbdb_buf); set_mode("lbdb", 0); shell_cmd(Sprintf("lbdbq \"%s\" | awk -F ' ' '{printf(\"%%s <%%s>\\n\", $2, $1);}' 2> err", query, 1)); bob(); push_mark_eol(); del_region(); del(); set_buffer_modified_flag(0); set_readonly(1); num_win = nwindows(); pop2buf(buf); old_buf = pop2buf_whatbuf(lbdb_buf); if(eobp()) { message("No matches."); lbdb_quit(); return; } eob(); go_up_1(); bol(); if(bobp()) { lbdb_select(); return; } else bob(); } lbdb-0.54/lbdb.spec.in000066400000000000000000000043121465114770000145360ustar00rootroot00000000000000%define ver @LBDB_VERSION@ %define rel 2 %define prefix /usr Summary: The Little Brother's Database Name: lbdb Version: %ver Release: %rel Copyright: GNU General Public Licence URL: https://www.spinnaker.de/lbdb/ Packager: Horms Vendor: Horms Group: Applications/Databases Source: https://www.spinnaker.de/lbdb/download/lbdb_%{ver}.tar.gz NoSource: 0 BuildRoot: /var/tmp/lbdb-%{PACKAGE_VERSION}-root Docdir: %{prefix}/doc %description This package was inspired by the Big Brother Database package available for various Emacs mailers, and by Brandon Long's "external query" patch for the Mutt mail user agent. (Note that this patch has been incorporated into the main-line mutt versions as of mutt 0.93.) The package doesn't use any formal database libraries or languages, although it should be quite easy to extend it to use, e.g., an installed PostgreSQL server as it's back end. %prep %setup -q %build %configure 2>&1 | tee -a Configurings-`date +%Y.%m.%d` #Funky NPROC code to speed things up courtesy of Red Hat's kernel rpm if [ -x /usr/bin/getconf ] ; then NRPROC=$(/usr/bin/getconf _NPROCESSORS_ONLN) if [ $NRPROC -eq 0 ] ; then NRPROC=1 fi else NRPROC=1 fi NRPROC=`expr $NRPROC + $NRPROC` make -j $NRPROC 2>&1 | tee -a Makings-`date +%Y.%m.%d` %install rm -rf $RPM_BUILD_ROOT mkdir -p ${RPM_BUILD_ROOT}/%{prefix}/etc make install_prefix=${RPM_BUILD_ROOT} install 2>&1 \ | tee -a Makings-Install-`date +%Y.%m.%d` %clean rm -rf ${RPM_BUILD_DIR}/lbdb-%{ver} rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,root) %doc README COPYING # Keep copies of the configure, build, install reports in the # documentation of the package. %doc Makings-Install-`date +%Y.%m.%d` %doc Makings-`date +%Y.%m.%d` %doc Configurings-`date +%Y.%m.%d` %{prefix} %changelog * Sat Dec 30 2000 Rob Payne - Changed to fit version 0.22 - Change installation process to include RPM_BUILD_ROOT - Removed auto-generated files list that did not take into account RPM 4's automatic compression of the man pages *after* the auto-generation was running. - Removed the empty post, postun, preun scripts. * Mon Apr 10 2000 Horms - created for version 0.18.5 lbdb-0.54/lbdb_bbdb_query.el000066400000000000000000000020601465114770000157730ustar00rootroot00000000000000;;; query the bbdb for all records matching a given string; return them ;;; in lbdb-suitable format ;;; ;;; This code is (c) Utz-Uwe Haus 2001 ;;; Use, reuse and deletion are permitted in any way you can up with. (require 'bbdb) (require 'bbdb-com) (defun lbdb-bbdb-query (string) "Display all entries in the BBDB matching STRING in the Name, Company or email fields in lbdb-usable format, i.e. [TAB][TAB] where is BBDB:timestamp." (let ((matches (bbdb-search (bbdb-records) string string string nil nil)) (result "")) (mapc (lambda (record) (let ((name (bbdb-record-name record)) (timestamp (bbdb-record-getprop record 'timestamp))) (mapcar (lambda (this-email) (setq result (concat result (format "%s\t%s\tBBDB:%s\n" this-email name timestamp)))) (bbdb-record-net record)))) matches) (princ result))) ;; the princ is for for emacs and xemacs, return value is for gnuclient (provide 'lbdb-bbdb-query) ; use like: ;(lbdb-bbdb-query "grae") lbdb-0.54/lbdb_ldap.rc000066400000000000000000000077031465114770000146120ustar00rootroot00000000000000# -*- perl -*- # # The format of each entry of the ldap server database is the following: # LDAP_NICKNAME => ['LDAP_SERVER', # 'LDAP_SEARCH_BASE', # 'LDAP_SEARCH_FIELDS', # 'LDAP_EXPECTED_ANSWERS', # 'LDAP_RESULT_EMAIL', # 'LDAP_RESULT_REALNAME', # 'LDAP_RESULT_COMMENT', # 'IGNORANT' (optional), # 'LDAP_BIND_DN' (optional), # 'LDAP_BIND_PASSWORD' (optional), # 'LDAP_TLS' (optional), # 'LDAP_SASL_MECH' (optional), # 'LDAP_SCOPE' (optional)], # (IGNORANT is an optional argument. If you set it to 1, mutt_ldap_query # uses wildcards *foo* for searching). # (LDAP_BIND_DN and LDAP_BIND_PASSWORD are optional arguments. Leave them # out or empty to use and anonymous bind) # (LDAP_TLS is optional, set it to 0 to disable) # (LDAP_SASL_MECH is optional, set it to '' to disable) # (LDAP_SCOPE is optional, set it to undef to use default scope) # A practical illustrating example being: # debian => ['db.debian.org', 'ou=users,dc=debian,dc=org', # 'uid cn sn ircnick', 'uid cn sn ircnick', # '${uid}@debian.org', '${cn} ${sn}', '${ircnick}'], # the output of the query will be then: # ${uid}@debian.org\t${cn} ${sn}\t${ircnick} (i.e.: email name comment) # warning this database will erase default script builtin %ldap_server_db = ( 'four11' => ['ldap.four11.com', 'c=US', 'givenname sn cn mail', 'givenname cn sn mail o', '${mail}', '${givenname} ${sn}', '${o}' ], 'infospace' => ['ldap.infospace.com', 'c=US', 'givenname sn cn mail', 'givenname cn sn mail o', '${mail}', '${givenname} ${sn}', '${o}' ], 'whowhere' => ['ldap.whowhere.com', 'c=US', 'givenname sn cn mail', 'givenname cn sn mail o', '${mail}', '${givenname} ${sn}', '${o}' ], 'bigfoot' => ['ldap.bigfoot.com', 'c=US', 'givenname surname cn mail', 'mail cn l', '${mail}', '${cn}', '${l}' ], 'switchboard' => ['ldap.switchboard.com', 'c=US', 'givenname sn cn mail', 'givenname cn sn mail o', '${mail}', '${givenname} ${sn}', '${o}' ], 'infospacebiz' => ['ldapbiz.infospace.com', 'c=US', 'givenname sn cn mail', 'givenname cn sn mail o', '${mail}', '${givenname} ${sn}', '${o}' ], 'debian' => ['db.debian.org', 'ou=users,dc=debian,dc=org', 'uid cn sn ircnick', 'uid cn sn ircnick', '${uid}@debian.org', '${cn} ${sn}', '${ircnick}' ], 'crm' => ['ldap.crm.mot.com', 'o=Motorola,c=US', 'cn mail sn fn uid', 'cn fn sn mail business_group telephonenumber', '${mail}', '${fn} ${sn}', '(${telephonenumber}) ${business_group}' ], 'motorola' => ['ldap.mot.com', 'ou=employees, o=Motorola,c=US', 'commonName gn sn cn uid', 'gn sn preferredRfc822Recipient ou c telephonenumber', '${preferredRfc822Recipient}', '${gn} ${sn}', '(${telephonenumber}) ${ou} ${c}' ] ); # hostname of your ldap server $ldap_server = 'db.debian.org'; # ldap base search $search_base = 'ou=users,dc=debian,dc=org'; # list of the fields that will be used for the query $ldap_search_fields = 'uid cn sn ircnick'; # list of the fields that will be used for composing the answer $ldap_expected_answers = 'uid cn sn ircnick'; # format of the email result based on the expected answers of the ldap query $ldap_result_email = '${uid}@debian.org'; # format of the realname result based on the expected answers of the ldap query $ldap_result_realname = '${cn} ${sn}'; # format of the comment result based on the expected answers of the ldap query $ldap_result_comment = '(${ircnick})'; # Don't use wildchars on searching $ignorant = 0; # Do an anonymous bind to the LDAP server: $ldap_bind_dn = ''; $ldap_bind_password = ''; # Don't use TLS: $ldap_tls = 0; $ldap_sasl_mech = ''; $ldap_scope = undef; 1; lbdb-0.54/lbdb_lib.sh.in000066400000000000000000000037241465114770000150520ustar00rootroot00000000000000#! @SH@ # # -*-sh-mode-*- # # Copyright (C) 1998 Thomas Roessler # Copyright (C) 1999-2018 Roland Rosenfeld # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. # # library routines # lbdb_hn_sendmail() { sendmail_cf="NONE" for p in /etc /etc/mail /etc/sendmail ; do if test -r $p/sendmail.cf ; then sendmail_cf=$p/sendmail.cf break; fi done if test "x$sendmail_cf" != "xNONE" ; then hn="$(sed -n -e 's/^DM\(.*\)$/\1/p' $sendmail_cf)" if test "x$hn" = x ; then hn="$(sed -n -e 's/^Dj\(.*\)$/\1/p' $sendmail_cf)" fi fi if test "x$hn" = x ; then echo "NONE" else echo "$hn" fi } lbdb_hostname() { if test "x$MAIL_DOMAIN_NAME" != "x" ; then hn=$MAIL_DOMAIN_NAME elif test -f /etc/mailname; then hn=$(cat /etc/mailname) else hn="" if test -r /etc/resolv.conf ; then hn="$(sed -n -e 's/^[ ]*domain[ ]\{1,\}\([^ ]*\)/\1/p' /etc/resolv.conf)" if test "x$hn" = "x" ; then hn="$(sed -n -e 's/^[ ]*search[ ]\{1,\}\([^ ]*\)/\1/p' /etc/resolv.conf)" fi fi if test "x$hn" = "x" ; then hn=$(lbdb_hn_sendmail) if test "x$hn" = "xNONE" ; then for i in /etc/HOSTNAME /etc/hostname ; do if test -f $i ; then hn="$(cat $i)" break; fi done fi fi fi echo "$hn" } lbdb-0.54/lbdbq.man.in000066400000000000000000000270611465114770000145460ustar00rootroot00000000000000.\" -*- nroff -*- .\" Copyright (c) 1998-2024 Roland Rosenfeld .\" .\" This program is free software; you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by .\" the Free Software Foundation; either version 2 of the License, or .\" (at your option) any later version. .\" .\" This program is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public License .\" along with this program; if not, write to the Free Software Foundation, .\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. .\" .TH LBDBQ 1 "July 2024" "Unix" "User Manuals" .SH NAME lbdbq \- query program for the little brother's database .SH SYNOPSIS .B lbdbq .I something .br .B lbdbq .RB [ -v | --version | -h | --help ] .SH DESCRIPTION .B lbdbq is the client program for the little brother's database. It will attempt to invoke various modules to gather information about persons matching .IR something . E.g., it may look at a list of addresses from which you have received mail, it may look at YP maps, or it may try to finger .IR something @ "" . .PP The behavior is configurable: Upon startup, .B lbdbq will source the shell scripts: .RS .I @sysconfdir@/lbdb.rc .br .I $XDG_CONFIG_HOME/lbdb/config .br .I $HOME/.lbdbrc .br .I $HOME/.lbdb/lbdbrc .br .I $HOME/.lbdb/rc .RE if they exist. .PP They can be used to set the following global variables: .TP .B MODULES_PATH a space separated list of directories, where .B lbdbq should look for modules. .TP .B METHODS a space separated list of the modules to use. .TP .B SORT_OUTPUT If you set this to .I false or .IR no , lbdbq won't sort the addresses but returns them in reverse order (which means that the most recent address in m_inmail database is first). If you set this to .IR name , lbdbq sorts the output by real name. If you set this to .IR comment , it sort the output by the comment (for example the date in .BR m_inmail ). .I reverse_comment realizes the same as .IR comment , but in reverse order, so the most recent timestamp of m_inmail may be on top. If you set SORT_OUTPUT to .IR address , lbdbq sorts the output by addresses (that's the default). .TP .B KEEP_DUPES If you set this to .I true or .IR yes , lbdbq won't remove duplicate addresses with different real name comment fields. .PP Note that there .I are defaults, so you should most probably modify these variables using constructs like this: .nf MODULES_PATH="$MODULES_PATH $HOME/lbdb_modules" .fi .PP Additionally, modules may have configuration variables of their own. .SH MODULES Currently, the following modules are supplied with lbdb: .TP .B m_finger This module will use finger to find out something more about a person. The list of hosts do be asked is configurable; use the .B M_FINGER_HOSTS variable. Note that "localhost" will mean an invocation of your local .BR finger (1) binary, and should thus work even if you don't provide the finger service to the network. .B m_finger tries to find out the machines mail domain name in .IR /etc/mailname , by parsing a .I sendmail.cf file (if it finds one) and by reading .I /etc/hostname and .IR /etc/HOSTNAME . If you know that this fails on your machine, or you want to force lbdbq to consider some other name to be the local mail domain name (misconfigured SUNs come to mind here), you can specify a name using the .B MAIL_DOMAIN_NAME variable. If this variable is set by you, no probing will be done by .BR lbdbq . .TP .B m_inmail This module will look up user name fragments in a list of mail addresses created by .BR lbdb-fetchaddr (1). By default this uses .IR $XDG_DATA_HOME/lbdb/m_inmail.db , which is overridden, if .I $HOME/.lbdb/m_inmail.utf-8 exists (the old default) as its database file, but this can be changed using .B INMAIL_DB variable (but do not forget to change this in the .BR lbdb-fetchaddr (1) call using option \-f, too). .TP .B m_passwd This module searches for matching entries in your local /etc/passwd file. It evaluates the local machine mail domain in the same way .B m_finger does. If you set .BR PASSWD_IGNORESYS=true , this module ignores all system accounts and only finds UIDs between 1000 and 29999 (all other UIDs are reserved on a Debian system). .TP .B m_yppasswd This module searches for matching entries in the NIS password database using the command ``ypcat passwd''. .TP .B m_nispasswd This module searches for matching entries in the NIS+ password database using the command ``niscat passwd.org_dir''. .TP .B m_getent This module searches for matching entries in whatever password database is configured using the command ``getent passwd''. .TP .BR m_pgp2 ", " m_pgp5 ", " m_gpg These modules scan your PGP 2.*, PGP 5.* or GnuPG public key ring for data. They use the programs .BR pgp (1), .BR pgpk (1), or .BR gpg (1) to get the data. .TP .B m_fido This module searches your Fido nodelist, stored in .I $HOME/.lbdb/nodelist created by .BR nodelist2lbdb (1). .TP .B m_abook This module uses the program .BR abook (1), a text based address book application to search for addresses. You can define multiple abook address books by setting the variable .B ABOOK_FILES to a space separated list. .TP .B m_goobook This module uses the program .BR goobook (1), a tool to access Google contacts via command line. .TP .B m_addr_email This module uses the program .BR addr-email (1), a text based frontend to the Tk .BR addressbook (1) application. .TP .B m_muttalias This module searches the variable .B MUTTALIAS_FILES (a space separated list) of files in .B MUTT_DIRECTORY that contain mutt aliases. File names without leading slash will have .B MUTT_DIRECTORY (defaults to .BI $HOME /.mutt or .BR $HOME , if .BI $HOME /.mutt does not exist) prepended before the file name. Absolute file names (beginning with .IR / ) will be taken direct. .TP .B m_pine This module searches .BR pine (1) addressbook files for aliases. To realize this it first inspects the variable .BR PINERC . If it isn't set, the default .RI ` "/etc/pine.conf /etc/pine.conf.fixed .pinerc" ' is used. To suppress inspecting the .B PINERC variable, set it to .IR no . It than takes all .B address-book and .B global-address-book entries from these pinerc files and adds the contents of the variable .B PINE_ADDRESSBOOKS to the list, which defaults to .RI ` "/etc/addressbook .addressbook" '. Then these addressbooks are searched for aliases. All filenames without leading slash are searched in .BR $HOME . .TP .B m_palm This module searches the Palm address database using the .BR Palm::PDB (3pm) and .BR Palm::Address (3pm) Perl modules from CPAN. It searches in the variable .B PALM_ADDRESS_DATABASE or if this isn't set in .IR $HOME/.jpilot/AddressDB.pdb . .TP .B m_gnomecard This module searches for addresses in your GnomeCard database files. The variable .B GNOMECARD_FILES is a whitespace separated list of GnomeCard data files. If this variable isn't defined, the module searches in .BI $HOME /.gnome/GnomeCard for the GnomeCard database or at least falls back to .BI $HOME /.gnome/GnomeCard.gcrd\fR. If a filename does not start with a slash, it is prefixed with .BR $HOME/ . .TP .B m_bbdb This module searches for addresses in your (X)Emacs BBDB (big brother database). It doesn't access ~/.bbdb directly (yet) but calls .BR emacs (1) or .BR xemacs (1) with a special mode to get the information (so don't expect too much performance in this module). You can configure the .B EMACS variable to tell this module which emacsen to use. Otherwise it will fall back to .B emacs or .BR xemacs. .TP .B m_ldap This module queries an LDAP server using the .BR Net::LDAP (3pm) Perl modules from CPAN. It can be configured using an external resource file .I @sysconfdir@/lbdb_ldap.rc or .I $XDG_CONFIG_HOME/lbdb/ldap.rc or .I $HOME/.lbdb/ldap.rc or .IR $HOME/.mutt_ldap_query.rc . You can explicitly define a LDAP query in this file or you can use one or more of the predefined queries from the .B %ldap_server_db in this file. For this you have to define a space separated list of nicknames from entries in the variable .BR LDAP_NICKS . .TP .B m_wanderlust This module searches for addresses stored in your .I $WANDERLUST_ADDRESSES (or by default in .IR $HOME/.addresses ) file, an addressbook of .BR WanderLust . .TP .B m_osx_addressbook This module queries the OS X AddressBook. It is only available on OS X systems. .TP .B m_evolution This module queries the Ximian Evolution address book. It depends on the program .BR evolution-addressbook-export , which is shipped with evolution. .TP .B m_vcf This module uses a bundled little perl program named vcquery to search for addresses from the space\-separated set of vCard files defined in .IR $VCF_FILES . .TP .B m_khard This module searches a CardDAV address book via .BR khard (1). .TP .B m_mu This module uses the program .BR mu-cfind (1), which searches in the index file generated by the mu tool. You can filter the results with the variables .B MU_AFTER (the number of seconds since 1970-01-01 UTC) and .B MU_PERSONAL (set to .I true or .IR yes , remember to invoke .BR mu-index (1) with .IR --my-address ) .PP Feel free to create your own modules to query other database resources, YP maps, and the like. .B m_finger should be a good example of how to do it. .PP If you create your own modules or have other changes and feel that they could be helpful for others, don't hesitate to submit them to the author for inclusion in later releases. .PP Finally, to use .B lbdbq from mutt, add the following line to your .I $HOME/.muttrc: .nf set query_command="lbdbq %s" .fi .SH OPTIONS .IP "-v | --version" Print version number of lbdbq. .IP "-h | --help" Print short help of lbdbq. .SH FILES .I @sysconfdir@/lbdb.rc .br .I $XDG_CONFIG_HOME/lbdb/config .br .I $HOME/.lbdbrc .br .I $HOME/.lbdb/lbdbrc .br .I $HOME/.lbdb/rc .br .I @libdir@/* .br .I $XDG_DATA_HOME/lbdb/m_inmail.db .br .I $HOME/.lbdb/m_inmail.utf-8 .br .I $HOME/.lbdb/nodelist .SH "SEE ALSO" .BR finger (1), .BR ypcat (1), .BR niscat (1), .BR getent (1), .BR pgp (1), .BR pgpk (1), .BR gpg (1), .BR lbdb-fetchaddr (1), .BR nodelist2lbdb (1), .BR mutt_ldap_query (1), .BR abook (1), .BR goobook (1), .BR addr-email (1), .BR addressbook (1), .BR mutt (1), .BR pine (1), .BR emacs (1), .BR xemacs (1), .BR Palm::PDB (3pm), .BR Palm::Address (3pm), .BR Net::LDAP (3pm). .SH CREDITS Most of the really interesting code of this program (namely, the RFC 822 address parser used by lbdb-fetchaddr) was stolen from Michael Elkins' mutt mail user agent. Additional credits go to Brandon Long for putting the query functionality into mutt. .PP Many thanks to the authors of the several modules and extensions: Ross Campbell (m_abook, m_yppasswd), Marc de Courville (m_ldap, mutt_ldap_query), Brendan Cully (m_osx_addressbook, m_vcf), Gabor Fleischer (m_pine), Rick Frankel (m_gnomecard), Utz-Uwe Haus (m_bbdb, m_nispasswd), Torsten Jerzembeck (m_addr_email), Adrian Likins (m_getent), Gergely Nagy (m_wanderlust), Dave Pearson (m_palm, lbdb.el), Brian Salter-Duke (m_muttalias), François Charlier (m_goobook), and Colin Watson (m_khard) .SH AUTHOR The lbdb package was initially written by Thomas Roessler and is now maintained and heavily extended by Roland Rosenfeld . lbdb-0.54/lbdbq.sh.in000066400000000000000000000057601465114770000144070ustar00rootroot00000000000000#! @SH@ # # Copyright (C) 1998-2000 Thomas Roessler # 1998-2022 Roland Rosenfeld # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. LBDB_VERSION=@LBDB_VERSION@ prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ sysconfdir=@sysconfdir@ METHODS="@MODULES@" MODULES_PATH=@libdir@ TAC=@TAC@ case "$1" in -v|--version) echo "lbdbq version $LBDB_VERSION" exit 0 ;; -h|--help) PROG=$(basename "$0") echo "Usage: $PROG 'something' search addresses matching 'something'" echo " $PROG -v|--version print version of lbdbq" echo " $PROG -h|--help this short help" exit 0 ;; esac libdir=${USE_LOCAL_LIB:-$libdir} . "$libdir"/lbdb_lib tmpdir=${TMPDIR-/tmp}/query.$(hostname).$$ mkdir "$tmpdir" || exit 1 trap "rm -rf $tmpdir ; trap '' 0; exit 1" HUP INT QUIT TERM trap "rm -rf $tmpdir ; trap '' 0" EXIT collection=$tmpdir/coll xdg_home=${XDG_CONFIG_HOME:=$HOME/.config} for conffile in $sysconfdir/lbdb.rc $xdg_home/lbdb/config $HOME/.lbdbrc \ $HOME/.lbdb/lbdbrc $HOME/.lbdb/rc ; do if test -f "$conffile" ; then . "$conffile" fi done METHODS=${LBDB_OVERRIDE_METHODS:-$METHODS} MODULES_PATH=${USE_LOCAL_LIB:-$MODULES_PATH} for method in $METHODS ; do for CURRENT_MODULE_DIR in $MODULES_PATH ; do if test -f "$CURRENT_MODULE_DIR/$method" ; then . "$CURRENT_MODULE_DIR/$method" break fi done done for method in $METHODS ; do eval ${method}_query \""$@"\" >> "$collection" || true done case "${KEEP_DUPES:-}" in true|yes) MUNGE=cat MUNGE_KEEPORDER=cat ;; *) MUNGE=${USE_LOCAL_LIB:-$libdir}/munge MUNGE_KEEPORDER="${USE_LOCAL_LIB:-$libdir}/munge keeporder=1" ;; esac case "${SORT_OUTPUT:-}" in false|no) $MUNGE_KEEPORDER "$collection" | $TAC > "$collection.uniq" ;; *name) $MUNGE "$collection" | sort -f -k2 -d -f > "$collection.uniq" ;; reverse_comment) $MUNGE "$collection" | sort -f -k3 -t' ' -r > "$collection.uniq" ;; comment) $MUNGE "$collection" | sort -f -k3 -t' ' > "$collection.uniq" ;; *) $MUNGE "$collection" | sort -f > "$collection.uniq" ;; esac lines=$(wc -l < "$collection.uniq" | sed -E 's/[[:blank:]]+//') if [ "$lines" -eq 0 ] then echo "lbdbq: no matches" exit 1 else echo "lbdbq: $lines matches" fi cat "$collection.uniq" lbdb-0.54/m_abook.sh.in000066400000000000000000000025341465114770000147260ustar00rootroot00000000000000#! @SH@ # # -*-sh-mode-*- # # Copyright (C) 2000 Ross Campbell # Copyright (C) 2000-2018 Roland Rosenfeld # Copyright (C) 2012 Alfredo Finelli <0x4146@gmail.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. m_abook_query() { ABOOK=@ABOOK@ if [ -x "$ABOOK" ] # check whether abook in installed then ABOOK_FILES=${OVERRIDE_ABOOK_FILES:-$ABOOK_FILES} for book in ${ABOOK_FILES:-$HOME/.abook/addressbook $HOME/.abook.addressbook} do if [ -f "$book" ] then $ABOOK --datafile "$book" --mutt-query "$@" \ | sed -e '1d;s/\([^ ]* [^ ]*\).*/\1 abook/' fi done fi } lbdb-0.54/m_addr_email.sh.in000066400000000000000000000026141465114770000157130ustar00rootroot00000000000000#! @SH@ # # -*-sh-mode-*- # # Copyright (C) 2000 Torsten Jerzembeck # Copyright (C) 2000 Ross Campbell # Copyright (C) 2000-2018 Roland Rosenfeld # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. # # This is a frontend to addr-email(1) from the addressbook(1) package, # which can be found at http://red.roses.de/~clemens/addressbook/. m_addr_email_query() { ADDR_EMAIL=@ADDR_EMAIL@ if [ -x "$ADDR_EMAIL" ] # check whether addr-email in installed then $ADDR_EMAIL "$@" \ | sed -e 's/^\([^,]*\), \([^:]*\): \(.*\)$/\3 \1 \2/' \ | grep -a '@' || : # | sed -e 's/\(.*\):[ ]\([^ ].*$\)/\2 \1 addr-email/' fi } lbdb-0.54/m_bbdb.sh.in000066400000000000000000000036001465114770000145170ustar00rootroot00000000000000#! @SH@ # # -*-sh-mode-*- # # Copyright (c) 2001 Utz-Uwe Haus 2001 # Copyright (c) 2003 Aaron Kaplan # Copyright (c) 2005-2018 Roland Rosenfeld # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ m_bbdb_query() { if [ -f ${LBDB_BBDB_SCRIPT:=$libdir/lbdb_bbdb_query.el} ] then form="(progn (require (quote lbdb-bbdb-query) \"$LBDB_BBDB_SCRIPT\") (lbdb-bbdb-query \"$@\"))" if [ -z "$GNUCLIENT" ] then if which gnuclient >/dev/null 2>&1; then GNUCLIENT=gnuclient fi fi if [ "$GNUCLIENT" = "no" ]; then GNUCLIENT= fi success=0 if [ -n "$GNUCLIENT" ] ; then if $GNUCLIENT -batch -eval "$form" 2> /dev/null; then success=1 fi fi if [ $success = 0 ]; then if [ -z "$EMACS" ] then if which emacs >/dev/null 2>&1; then EMACS=emacs elif which xemacs >/dev/null 2>&1; then EMACS=xemacs fi fi if [ -n "$EMACS" ] ; then $EMACS -nw --no-site-file --no-init-file -batch \ --eval "$form" 2>/dev/null fi fi fi | grep -va '^$' || : } lbdb-0.54/m_evolution.sh.in000066400000000000000000000056601465114770000156620ustar00rootroot00000000000000#! @SH@ # # -*-sh-*- # # m_evolution - Evolution Address book module for lbdb # Copyright (C) 2004 Guido Guenther # Copyright (C) 2004-2018 Roland Rosenfeld # Copyright (C) 2008 brian m. carlson # Copyright (C) 2009 Jan Larres # # loosely based on m_gnomecard # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # m_evolution_query () { AWK=@AWK@ EVOLUTION_ADDRESSBOOK_EXPORT=@EVOLUTION_ADDRESSBOOK_EXPORT@ if [ "$EVOLUTION_ADDRESSBOOK_EXPORT" = "auto" ]; then for e in /usr/lib/evolution/*/evolution-addressbook-export do if [ -x $e ]; then EVOLUTION_ADDRESSBOOK_EXPORT=$e fi done fi if [ -x $EVOLUTION_ADDRESSBOOK_EXPORT ]; then $EVOLUTION_ADDRESSBOOK_EXPORT 2>/dev/null \ | $AWK 'BEGIN { FS = ":" RS = "\r\n" name = "" emails = "" last_email = 0 } /^END:VCARD/ { if ((name != "" || fileas != "") && emails != "") { sub("^#", "", emails) split(emails, emails_arr, "#") for (email in emails_arr) printf("%s\t%s\tEV:%s\n",emails_arr[email],name,fileas) } name = ""; fileas = ""; emails = "" } /^FN:/ { name = $2 } /^X-EVOLUTION-FILE-AS:/ { fileas = $2 gsub("\\\\", "", fileas) } # DEST-EMAIL is needed to skip addresses in list contacts /^EMAIL[;:]/ && ! /X-EVOLUTION-DEST-EMAIL/ { emails = emails "#" $2 last_email = 1 } # only join email lines for performance reasons /^ [^ ]/ && last_email == 1 { cont = $1 sub("^ ", "", cont) emails = emails cont } ! /^EMAIL[;:]/ && ! /^ [^ ]/ { last_email = 0 }' \ | grep -ia "$@" || : fi } lbdb-0.54/m_fido.sh.in000066400000000000000000000017041465114770000145520ustar00rootroot00000000000000#! @SH@ # # -*-sh-*- # # Copyright (C) 1998-2018 Roland Rosenfeld # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. m_fido_db=$HOME/.lbdb/nodelist m_fido_query() { test -f $m_fido_db || return grep -ia "$@." $m_fido_db || : } lbdb-0.54/m_finger.sh.in000066400000000000000000000030651465114770000151050ustar00rootroot00000000000000#! @SH@ # -*-sh-mode-*- # Copyright (C) 1998 Thomas Roessler # Copyright (C) 2005-2018 Roland Rosenfeld # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. m_finger_query() { FINGER=@FINGER@ if [ -x "$FINGER" ] # check whether finger in installed then f_user="$(echo \"$@\" | sed 's/@.*//')" if test "x$M_FINGER_HOSTS" = x ; then M_FINGER_HOSTS="localhost" fi for host in $M_FINGER_HOSTS ; do if test "$host" = "localhost" ; then athost="" mailhost="$(lbdb_hostname)" else athost="@$host" mailhost="$host" fi $FINGER $f_user$athost 2> /dev/null \ | sed -n -e "s/^Login: *\([^ ]*\)[ ]*Name: \(.*\)$/\1@$mailhost \2 (finger)/p" \ -e "s/^Login name: *\([^ ]*\)[ ]*In real life: \(.*\)$/\1@$mailhost \2 (finger)/p" \ | grep -av 'In real life: ???' || : done fi } lbdb-0.54/m_getent.sh.in000066400000000000000000000022731465114770000151210ustar00rootroot00000000000000#! @SH@ # # -*-sh-*- # # Copyright (C) 2000-2001 Ross Campbell # Copyright (C) 2000-2018 Roland Rosenfeld # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. m_getent_query() { GETENT=@GETENT@ if [ -x "$GETENT" ] #check for getent then f_user="$(echo \"$@\" | sed -e 's/@.*//')" HOST="$(lbdb_hostname)" $GETENT passwd \ | grep -ia "$f_user" \ | sed -e "s/^\([^:]*\):[^:]*:\([^:]*\):[^:]*:\([^:,]*\)[,:].*\$/\1@$HOST \3 UID \2/" fi } lbdb-0.54/m_gnomecard.sh.in000066400000000000000000000034751465114770000155770ustar00rootroot00000000000000#! @SH@ # # -*-sh-*- # # m_gnomecard - GnomeCard Address book module for lbdb # Copyright (C) 2000 Rick Frankel # 2000-2018 Roland Rosenfeld # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ AWK=@AWK@ rcfile=$HOME/.gnome/GnomeCard m_gnomecard_query () { if [ -z "$GNOMECARD_FILES" ] then if [ -r "$rcfile" ] then GNOMECARD_FILES=$(\ $AWK 'BEGIN {FS="="; infile=0} \ /^\[.*\]/ {infile=0} \ /^\[file\]/ {infile=1} \ infile && /^open=/ {print $2}' \ < $rcfile) fi if [ -z "$GNOMECARD_FILES" ] then GNOMECARD_FILES="$HOME/.gnome/GnomeCard.gcrd" fi fi for file in $GNOMECARD_FILES do if [ $file = ${file#/} ] then file=$HOME/$file fi if [ -f $file ] then $AWK 'BEGIN {FS=":"; RS="\r\n"; name=""} /^END:VCARD/ {name=""} /^FN[:;]/ {name=$2} name!="" && /^EMAIL;/ { email=$2; type=substr($1,7); printf ("%s\t%s\tGC:%s\n", email, name, type) }' \ < $file | grep -ia "$@" || : fi done } lbdb-0.54/m_goobook.sh.in000066400000000000000000000023571465114770000152750ustar00rootroot00000000000000#! @SH@ # # -*-sh-mode-*- # # Copyright (C) 2000 Ross Campbell # Copyright (C) 2000-2018 Roland Rosenfeld # Copyright (C) 2012 Alfredo Finelli <0x4146@gmail.com> # Copyright (C) 2016 François Charlier # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. m_goobook_query() { GOOBOOK=@GOOBOOK@ if [ -x "$GOOBOOK" ] # check whether goobook in installed then $GOOBOOK query "$@" \ | sed -e '1d;s/\([^ ]* [^ ]*\).*/\1 goobook/' fi } lbdb-0.54/m_gpg.sh.in000066400000000000000000000023201465114770000144010ustar00rootroot00000000000000#! @SH@ # # -*-sh-*- # # Copyright (C) 1998-2018 Roland Rosenfeld # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. m_gpg_query() { GPG=@GPG@ if [ -x "$GPG" ] then $GPG --no-auto-check-trustdb --list-keys --with-colons "$@" 2>/dev/null \ | grep -a '^\(pub\|uid\):[^re]:\([^:]*:\)\{7,7\}[^<>:]* <[^<>@: ]*@[^<>@: ]*>[^<>@:]*:' \ | sed -e 's/^\([^:]*:\)\{9,9\}\([^<:]*\) <\([^>:]*\)>.*:.*$/\3 \2 (GnuPG)/' \ | sed -e 's/ \([^ ]\{47,47\}\)[^ ]* / \1... /' \ | grep -ia "$@" || : fi } lbdb-0.54/m_inmail.sh.in000066400000000000000000000030251465114770000151000ustar00rootroot00000000000000#! @SH@ # # Copyright (C) 1998-2000 Thomas Roessler # 1999-2022 Roland Rosenfeld # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ fallbackdb=${XDG_DATA_HOME:-$HOME/.local/share}/lbdb/m_inmail.db [ -f $HOME/.lbdb/m_inmail.utf-8 ] && fallbackdb=$HOME/.lbdb/m_inmail.utf-8 M_INMAIL_DB=${INMAIL_DB:-$fallbackdb} m_inmail_query() { M_INMAIL_DB=${OVERRIDE_M_INMAIL_DB:-$M_INMAIL_DB} MUNGE_LIMITDATE=${OVERRIDE_MUNGE_LIMITDATE:-$MUNGE_LIMITDATE} MUNGE_LIMITCOUNT=${OVERRIDE_MUNGE_LIMITCOUNT:-$MUNGE_LIMITCOUNT} SORT_OUTPUT=${OVERRIDE_SORT_OUTPUT:-$SORT_OUTPUT} export SORT_OUTPUT MUNGE_LIMITDATE MUNGE_LIMITCOUNT M_INMAIL_DB ${USE_LOCAL_LIB:-$libdir}/lbdb-munge test -f "$M_INMAIL_DB" || return grep -ia "$@." $M_INMAIL_DB || : } lbdb-0.54/m_khard.sh.in000066400000000000000000000020031465114770000147130ustar00rootroot00000000000000#! @SH@ # # -*-sh-mode-*- # # Copyright (C) 2017 Colin Watson # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. m_khard_query() { KHARD=@KHARD@ if [ -x "$KHARD" ] then "$KHARD" email \ --parsable --remove-first-line --search-in-source-files \ "$1" fi } lbdb-0.54/m_ldap.sh.in000066400000000000000000000023131465114770000145460ustar00rootroot00000000000000#! @SH@ # # -*-sh-*- # # m_ldap - ldap module for lbdb # Copyright (C) 2001 Marc de Courville # Copyright (C) 2020 Roland Rosenfeld # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. prefix=@prefix@ exec_prefix=@exec_prefix@ bindir=@bindir@ m_ldap_query () { if [ "$LDAP_NICKS" != "" ] then for NICK in $LDAP_NICKS do $bindir/mutt_ldap_query --lbdb_output --nickname=$NICK "$@" || : done else $bindir/mutt_ldap_query --lbdb_output "$@" || : fi } lbdb-0.54/m_mu.sh.in000066400000000000000000000024531465114770000142540ustar00rootroot00000000000000#! @SH@ # # -*-sh-mode-*- # # Copyright (C) 2018 Timothy Bourke # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. m_mu_query() { MU=@MU@ MU_OPTIONS= if [ "$MU_AFTER" -eq "$MU_AFTER" ] 2>/dev/null # test integer then MU_OPTIONS="$MU_OPTIONS --after=$MU_AFTER" fi if [ "$MU_PERSONAL" = "yes" ] || [ "$MU_PERSONAL" = "true" ] then MU_OPTIONS="$MU_OPTIONS --personal" fi if [ -x "$MU" ] # check whether mu is installed then $MU cfind --format=csv $MU_OPTIONS "$@" \ | sed -e '/^,/d' -e 's/\(.*\),\([^,]*\)/\2 \1 mu cfind/' fi } lbdb-0.54/m_muttalias.sh.in000066400000000000000000000036661465114770000156450ustar00rootroot00000000000000#! @SH@ # # -*-sh-*- # # Copyright (C) 2000 Brian Salter-Duke # 2000-2022 Roland Rosenfeld # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. m_muttalias_query() { [ -d "${MUTT_DIRECTORY:=$HOME/.mutt}" ] || MUTT_DIRECTORY=$HOME MUTTALIAS_FILES=${OVERRIDE_MUTTALIAS_FILES:-$MUTTALIAS_FILES} for file in ${MUTTALIAS_FILES:-.muttrc .mail_aliases muttrc aliases} ; do if [ "$file" = "${file#/}" ] then file=$MUTT_DIRECTORY/$file fi if [ -f "$file" ] then # sed Regexps: # 1. alias nick Foo Bar # 2. alias nick foo@example.com (Foo Bar) # 3. alias nick (Foo Bar) grep -ia "$@" "$file" \ | grep -a '^alias[ ][ ]*[^,][^,]*[ ][ ]*\([^,]\|".*"\)*$' \ | sed -E -e 's/^alias[[:blank:]]+([^[:blank:]]+)[[:blank:]]+("[^"]+"|[^<>()]+)[[:blank:]]+<([^<>()]+)>.*$/\3 \2 alias \1/' \ -e 's/^alias[[:blank:]]+([^[:blank:]]+)[[:blank:]]+([^<>()]+)[[:blank:]]+\(([^()<>]+)\).*$/\2 \3 alias \1/' \ -e 's/^alias[[:blank:]]+([^[:blank:]]+)[[:blank:]]+<([^<>()]+)>[[:blank:]]+\(([^()<>]+)\).*$/\2 \3 alias \1/' \ -e 's/"//g' \ | grep -va '^alias[ ][ ]*[^,][^,]*[ ][ ]*[^,]*$' || : fi done } lbdb-0.54/m_nispasswd.sh.in000066400000000000000000000023751465114770000156510ustar00rootroot00000000000000#! @SH@ # # -*-sh-mode-*- # # Copyright (C) 2000 Ross Campbell # Copyright (C) 2000-2018 Roland Rosenfeld # Copyright (C) 2001 Utz-Uwe Haus # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. m_nispasswd_query() { NISCAT=@NISCAT@ if [ -x "$NISCAT" ] #check for niscat then f_user="$(echo \"$@\" | sed -e 's/@.*//')" HOST="$(lbdb_hostname)" $NISCAT passwd.org_dir \ | grep -ia "$f_user" \ | sed -e "s/^\([^:]*\):[^:]*:\([^:]*\):[^:]*:\([^:,]*\)[,:].*\$/\1@$HOST \3 UID \2/" fi } lbdb-0.54/m_osx_addressbook.sh.in000066400000000000000000000017471465114770000170310ustar00rootroot00000000000000#! @SH@ # # -*-sh-*- # # Copyright (C) 2003 Brendan Cully # Copyright (C) 2005-2018 Roland Rosenfeld # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. # libdir=@libdir@ m_osx_addressbook_query() { $libdir/ABQuery "$@" | grep -ia "$@" || : } lbdb-0.54/m_palm.sh.in000066400000000000000000000022561465114770000145650ustar00rootroot00000000000000#! @SH@ # # -*-sh-*- # # m_palm - Palm address database module for lbdb # Copyright (C) 2000 Dave Pearson # Copyright (C) 2005-2018 Roland Rosenfeld # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ m_palm_query () { palmdatabase=${PALM_ADDRESS_DATABASE:-$HOME/.jpilot/AddressDB.pdb} test -f $palmdatabase || return $libdir/palm_lsaddr $palmdatabase | grep -ia "$@" || : } lbdb-0.54/m_passwd.sh.in000066400000000000000000000022411465114770000151270ustar00rootroot00000000000000#! @SH@ # # -*-sh-*- # # Copyright (C) 1999-2018 Roland Rosenfeld # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. m_passwd_query() { HOST="$(lbdb_hostname)" case "$PASSWD_IGNORESYS" in true|yes|1) IGNORESYS='UID \([12]....\|....\)$' ;; *) IGNORESYS='.' ;; esac sed -e "s/^\([^:]*\):[^:]*:\([^:]*\):[^:]*:\([^:,]*\)[,:].*\$/\1@$HOST \3 UID \2/" /etc/passwd \ | grep -ia "$@" | grep -a "$IGNORESYS" || : } lbdb-0.54/m_pgp2.sh.in000066400000000000000000000021531465114770000145000ustar00rootroot00000000000000#! @SH@ # # -*-sh-*- # # Copyright (C) 1998-2018 Roland Rosenfeld # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. m_pgp2_query() { PGP=@PGP@ if [ -x "$PGP" ] then $PGP +language=en -kv "$@" 2>/dev/null \ | grep -a '^[^<>]\{32,\} <[^<>@:/ ]*@[^<>@ ]*>[^<>@]*$' \ | sed -e 's/^.\{30,30\}\(.*\) <\([^:]*\)>.*$/\2 \1 (PGP2)/' \ | sed -e 's/ \([^ ]\{47,47\}\)[^ ]* / \1... /' fi } lbdb-0.54/m_pgp5.sh.in000066400000000000000000000021701465114770000145020ustar00rootroot00000000000000#! @SH@ # # -*-sh-*- # # Copyright (C) 1999-2018 Roland Rosenfeld # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. m_pgp5_query() { PGPK=@PGPK@ if [ -x "$PGPK" ] then $PGPK +language=en -l "$@" 2>/dev/null \ | grep -a '^uid ...* <[^<>@:/ ]*@[^<>@ ]*>[^<>@]*$' \ | sed -e 's/^uid \(.*\) <\(.*\)>.*$/\2 \1 (PGP5)/' \ | sed -e 's/ \([^ ]\{47,47\}\)[^ ]* / \1... /' \ | grep -ia "$@" || : fi } lbdb-0.54/m_pine.sh.in000066400000000000000000000076601465114770000145730ustar00rootroot00000000000000#! @SH@ # # -*-sh-*- # # Copyright (C) 2000 Gabor Fleischer # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. # m_pine for lbdb v0.9 by Gabor Fleischer # # Two variabled can be set in lbdbrc: PINERC, PINE_ADDRESSBOOKS # Here comes the explanation what are they for: # 1. First I look for $PINERC. If not set, then I use my defaults: # PINERC="/etc/pine.conf /etc/pine.conf.fixed .pinerc" # If you don't want me to look in the default PINERCs, then set PINERC=no # 2. I make a list of all the addressbooks in the PINERCs. # 3. Then the $PINE_ADDRESSBOOKS are added to this list. # 4. And if this list is still empty then add the default addressbooks: # PINE_ADDRESSBOOKS="/etc/addressbook .addressbook" # 5. Make the query in the listed addressbooks # # Changelog: # 0.9: Convert Quoted-Printable in the real names into plain 8bit. # 0.8: When the 'real name' is missing, put " " there, so mutt works fine. # 0.7: Fixed bugs: # * Search was case sensitive. Now it's insensitive. # * Lines with missing fields (i.e."nickaddr") were broken. # * Default didn't work if address-books in pinercs were "". # 0.6: The .addressbook format's multi-line addresses are supported. # 0.5: Initial release. # AWK=@AWK@ prefix=@prefix@ exec_prefix=@exec_prefix@ qpto8bit=@libdir@/qpto8bit m_pine_query() { addressbooks= if [ x$PINERC != xno ] ; then for pinerc in ${PINERC:-/etc/pine.conf /etc/pine.conf.fixed .pinerc} do if [ $pinerc = ${pinerc#/} ] ; then pinerc=$HOME/$pinerc fi if [ -f $pinerc ] ; then addressbook=$(\ $AWK 'BEGIN {SPACE="";} /^(global-)?address-book[ ]*=/ { sub("^(global-)?address-book[ ]*=",""); while (/[ ]*[^ ]+[ ]+([^ , ]+)[ ]*,/) { sub("[ ]*[^ ]+[ ]+",""); sub("[ , ].*",""); printf("%s%s",SPACE,$0); SPACE=" "; getline; } sub("[ ]*[^ ]+[ ]+",""); sub("[ ].*",""); printf("%s%s",SPACE,$0); SPACE=" "; }' < $pinerc) fi addressbooks="${addressbook# } ${addressbooks# }" done fi addressbooks="${PINE_ADDRESSBOOKS} ${addressbooks# }" addressbooks=${addressbooks# } for file in ${addressbooks:=/etc/addressbook .addressbook} ; do if [ $file = ${file#/} ] ; then file=$HOME/$file fi if [ -f $file ] then cat $file | $qpto8bit | $AWK -v find="$@" ' function out() { if (match(tolower(line),low_find)) { #order: nick full addr fcc comm R[1] = "^[^ ]*"; R[2] = "^[^ ]* [^ ]*"; R[3] = "^[^ ]* [^ ]* \\(?[^ ]*\\)?"; R[4] = "^[^ ]* [^ ]* [^ ]* [^ ]*"; R[5] = "^[^ ]* [^ ]* [^ ]* [^ ]* [^ ]*"; beg = 1; for (i=1;i<=5;i++) { match(line,R[i]); A[i] = substr(line,beg,RLENGTH-beg+1); beg = RLENGTH+2; } if (A[2] == "") {A[2] = " "} if (match(A[3],/\(.*\)/)) {A[3] = substr(A[3],2,length(A[3])-2)} if (A[5] != "") {A[5] = " [" A[5] "]"} printf "%s %s %s%s (pine)\n",A[3],A[2],A[1],A[5]; } } BEGIN { FS=" "; low_find = tolower(find); getline; while (/^#DELETED/) {getline} ; line = $0 } $0 !~ /^#DELETED/ { if (/^ /) { gsub(" ",""); line = line $0; } else { out(); line = $0; } } END { out() }' fi done } lbdb-0.54/m_vcf.sh.in000066400000000000000000000027421465114770000144120ustar00rootroot00000000000000#! @SH@ # # Copyright (C) 2005 Brendan Cully # Copyright (C) 2011 Jamey Sharp # 2024 Roland Rosenfeld # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ m_vcf_query() { VCQ=${USE_LOCAL_LIB:-$libdir}/vcquery QUERY="$1" for file in ${OVERRIDE_VCF_FILES:-$VCF_FILES} do if test -r $file.cache -a $file.cache -nt $file then cmd="cat $file.cache" else if $VCQ $file > $file.cache then cmd="cat $file.cache" else cmd="$VCQ $file" fi fi $cmd | grep -ie "$QUERY" | awk ' BEGIN { FS = OFS = "\t" } $2 == "(null)" { $2 = " " } { NF = 2; $3 = "(VCF)"; print }' done } lbdb-0.54/m_wanderlust.sh.in000066400000000000000000000021651465114770000160230ustar00rootroot00000000000000#! @SH@ ## -*- sh -*- ## ## Copyright (C) 2002 Gergely Nagy ## Copyright (C) 2002-2018 Roland Rosenfeld ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software Foundation, ## Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. m_wanderlust_query() { addresses=${WANDERLUST_ADDRESSES:-${HOME}/.addresses} if [ -f $addresses ] then grep -ia "$@" $addresses \ | sed -e 's,^\([^ ]\+\)[ ]\+"\([^"]*\)"[ ]\+"\([^"]\+\)",\1 \3 wl \2,g' \ | grep -a '^[^ ][^ ]* [^ ][^ ]* wl ' || : fi } lbdb-0.54/m_yppasswd.sh.in000066400000000000000000000022721465114770000155040ustar00rootroot00000000000000#! @SH@ # # -*-sh-mode-*- # # Copyright (C) 2000 Ross Campbell # Copyright (C) 2000-2018 Roland Rosenfeld # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. # m_yppasswd_query() { YPCAT=@YPCAT@ if [ -x "$YPCAT" ] #check for ypcat then f_user="$(echo \"$@\" | sed -e 's/@.*//')" HOST="$(lbdb_hostname)" $YPCAT passwd \ | grep -ia "$f_user" \ | sed -e "s/^\([^:]*\):[^:]*:\([^:]*\):[^:]*:\([^:,]*\)[,:].*\$/\1@$HOST \3 UID \2/" fi } lbdb-0.54/mkinstalldirs000077500000000000000000000012341465114770000151600ustar00rootroot00000000000000#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain errstatus=0 for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" 1>&2 mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr fi fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here lbdb-0.54/munge.awk.in000066400000000000000000000041731465114770000146030ustar00rootroot00000000000000#! @AWK@ -f # # -*-awk-*- # # Copyright (C) 1998-2000 Thomas Roessler # 2000-2018 Roland Rosenfeld # 2007 Yaroslav Halchenko # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. function print_line (line, lastdate, count) { if (line == "") return; if (limitdate != "" && lastdate < limitdate && count < limitcount) return; if (limitcount == 0) print line; else print line FS count; } BEGIN { # initialization FS = "\t"; i = 0; # default settings keeporder = 0; # do not keep order by default limitdate = "0000-00-00_00:00"; # keep all dates by default limitcount = 0; # and do not limit by count by default } { sub(/ +$/, "", $3); # strip trailing spaces (as of former bug) line[$1] = ($1 FS $2 FS $3); if (lastdate[$1] == "" || lastdate[$1] < $3) lastdate[$1] = $3; line[$1] = ($1 FS $2 FS lastdate[$1]); if ($4 != "") cnt[$1] += $4; else cnt[$1]++; if (keeporder == 1) { pos[$1] = i; idx[i++] = $1; } } END { if (keeporder == 1) for (j = 0; j < i; j++) { if (pos[idx[j]] == j) { print_line(line[idx[j]], lastdate[idx[j]], cnt[idx[j]]); } } else for (a in line) { print_line(line[a], lastdate[a], cnt[a]); } } lbdb-0.54/mutt_ldap_query.ChangeLog000066400000000000000000000025731465114770000173500ustar00rootroot00000000000000* 4.0 (02/16/2001): - external configuration capability through a resource file has now be added - more flexibility in the specification of the format of the output is possible through a variable container approach - mutt_ldap_query is exclusively based on perl_ldap module (no longer supports ldapsearch) - Getopt::Long is used for the options: everything has changed - documentation is embedded using POD * 3.3 (02/15/2001): - fixed typo in server_db (pointed out by dpelle@cisco.com) - added "ignorant" option: -i to search with wildcards * 3.2 (01/12/2000): - now use get_value intead of ->[0] * 3.1 (03/10/2000): - added the -l option that suppresses the number of matches output - for better interfacing with little brother database - https://www.spinnaker.de/lbdb/ * 3.0 (12/29/1999): - implemented another query method using perl-ldap module enabled by - the -p boolean flag * 2.3 (12/28/1999): - added better parsing of the options, a shortcut for avoiding - -s and -b options by using the script builtin table of common - servers and associated search bases performing a - lookup (changes inspired from a patch sent by Adrian Likins - ), performed some Y2K cleanups ;-) * 2.2 (11/02/1999): - merged perl style fixes proposed by Warren Jones * 2.1 (4/14/1998): - first public release lbdb-0.54/mutt_ldap_query.pl.in000066400000000000000000000525611465114770000165430ustar00rootroot00000000000000#! @PERL@ -w # # Copyright (C) 2000-2006 Marc de Courville # Copyright (C) 2009 "Alexandra N. Kossovsky" # Copyright (C) 2005-2023 Roland Rosenfeld # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. use strict; use Getopt::Long; use Net::LDAP; use Pod::Usage; # install libgssapi-perl libauthen-sasl-perl use Authen::SASL qw(Perl); #------8<------8<------8<------8<---cut here--->8------>8------>8------>8------ # The defaults my $man = 0; my $help = 0; my $DEBUG = 0; my $lbdb_output = 0; my $version = 0; my $ldap_server_nickname = ''; my $config_file = ''; # hostname of your ldap server our $ldap_server = 'ldap.four11.com'; # ldap base search our $search_base = 'c=US'; # list of the fields that will be used for the query our $ldap_search_fields = 'givenname sn cn'; # list of the fields that will be used for composing the answer our $ldap_expected_answers = 'givenname sn mail o'; # format of the email result based on the expected answers of the ldap query our $ldap_result_email = '${mail}'; # format of the realname result based on the expected answers of the ldap query our $ldap_result_realname = '${givenname} ${sn}'; # format of the comment result based on the expected answers of the ldap query our $ldap_result_comment = '(${o})'; # use ignorant (wildcard searching): our $ignorant = 0; # LDAP bind DN: our $ldap_bind_dn = ''; # LDAP bind password: our $ldap_bind_password = ''; # LDAP TLS our $ldap_tls = 0; # LDAP SASL mechanism our $ldap_sasl_mech = ''; # option to restrict the scope of the LDAP search our $ldap_scope = undef; our %ldap_server_db = ( 'four11' => ['ldap.four11.com', 'c=US', 'givenname sn cn mail', 'givenname cn sn mail o', '${mail}', '${givenname} ${sn}', '${o}' ], 'infospace' => ['ldap.infospace.com', 'c=US', 'givenname sn cn mail', 'givenname cn sn mail o', '${mail}', '${givenname} ${sn}', '${o}' ], 'whowhere' => ['ldap.whowhere.com', 'c=US', 'givenname sn cn mail', 'givenname cn sn mail o', '${mail}', '${givenname} ${sn}', '${o}' ], 'bigfoot' => ['ldap.bigfoot.com', 'c=US', 'givenname sn cn mail', 'givenname cn sn mail o', '${mail}', '${givenname} ${sn}', '${o}' ], 'switchboard' => ['ldap.switchboard.com', 'c=US', 'givenname sn cn mail', 'givenname cn sn mail o', '${mail}', '${givenname} ${sn}', '${o}' ], 'infospacebiz' => ['ldapbiz.infospace.com', 'c=US', 'givenname sn cn mail', 'givenname cn sn mail o', '${mail}', '${givenname} ${sn}', '${o}' ] ); #------8<------8<------8<------8<---cut here--->8------>8------>8------>8------ sub versionstring { my $ver = '@LBDB_VERSION@'; return($ver . " "); } # Source a perl file sub process_file { foreach my $file (@_) { if (-r $file) { unless (my $return = do $file) { warn "couldn't parse $file: $@" if $@; warn "couldn't do $file: $!" unless defined $return; warn "couldn't run $file" unless $return; } } # else { # warn "either $file doesn't exist or is not readable by me!\n"; # } } } sub xdg_home { my $xdg_home = $ENV{XDG_CONFIG_HOME}; $xdg_home = $ENV{HOME} . "/.config" unless defined $xdg_home; return($xdg_home); } # first we need to apply defaults process_file("@SYSCONF_DIR@/lbdb_ldap.rc", "@SYSCONF_DIR@/mutt_ldap_query.rc", xdg_home() . "/lbdb/ldap.rc", "$ENV{HOME}/.lbdb/ldap.rc", "$ENV{HOME}/.mutt_ldap_query.rc"); # Parse command line options. They override system defaults. GetOptions ( 'config_file|c=s' => \$config_file, 'server|ls=s' => \$ldap_server, 'search_base|sb:s' => \$search_base, 'search_fields|sf:s' => \$ldap_search_fields, 'expected_answers|ea:s' => \$ldap_expected_answers, 'format_email|fe:s' => \$ldap_result_email, 'format_realname|fr:s' => \$ldap_result_realname, 'format_comment|fc:s' => \$ldap_result_comment, 'nickname|n=s' => \$ldap_server_nickname, 'bind_dn|bd:s' => \$ldap_bind_dn, 'bind_password|bp:s' => \$ldap_bind_password, 'tls:s' => \$ldap_tls, 'sasl_mech|sm:s' => \$ldap_sasl_mech, 'scope=s' => \$ldap_scope, 'debug' => sub { $DEBUG = 1 }, 'help|?|h' => \$help, 'man|m' => \$man, 'ignorant|i' => \$ignorant, 'lbdb_output|l' => \$lbdb_output, 'version|v' => \$version ); # # print usage and help info before we process config files # pod2usage(1) if $help; pod2usage(-verbose => 2) if $man; if ($version) { print "mutt_ldap_query version " . &versionstring() . "\n"; exit(0); } # command-line config file take precedence over command-line options if ($config_file) { process_file($config_file); } # after we've done with GetOptions $ARGV[0] should present the rest # (i.e. mandatory search pattern) die pod2usage(1) if (! $ARGV[0] ); if ($ldap_server_nickname) { my $option_array = $ldap_server_db{$ldap_server_nickname}; die print "$0 unknown server nickname:\n\t no server associated to the nickname $ldap_server_nickname, please modify the internal database according your needs by editing the ressource file or specifying the relevant one to use\n" if ! $option_array; $ldap_server = $option_array->[0]; $search_base = $option_array->[1]; $ldap_search_fields = $option_array->[2]; $ldap_expected_answers = $option_array->[3]; $ldap_result_email = $option_array->[4]; $ldap_result_realname = $option_array->[5]; $ldap_result_comment = $option_array->[6]; if (defined($option_array->[7])) { $ignorant = $option_array->[7]; } if (defined($option_array->[8])) { $ldap_bind_dn = $option_array->[8]; } if (defined($option_array->[9])) { $ldap_bind_password = $option_array->[9]; } if (defined($option_array->[10])) { $ldap_tls = $option_array->[10]; } if (defined($option_array->[11])) { $ldap_sasl_mech = $option_array->[11]; } if (defined($option_array->[12])) { $ldap_scope = $option_array->[12]; } } print "DEBUG: ldap_server='$ldap_server' search_base='$search_base' search_fields='$ldap_search_fields'\ expected_answer='$ldap_expected_answers' format_email='$ldap_result_email' format_realname='$ldap_result_realname'\ bind_dn='$ldap_bind_dn' bind_password='$ldap_bind_password'\n" if ($DEBUG); my @fields = split / /, $ldap_search_fields; my @results; foreach my $askfor ( @ARGV ) { my $query=""; if ($ignorant) { # enable this if you want to include wildcard in your search with some huge # ldap databases you might want to avoid it $query = join '', map { "($_=*$askfor*)" } @fields; } else { $query = join '', map { "($_=$askfor)" } @fields; } $query = "(|" . $query . ")"; print "DEBUG: perl ldap module processing filter:\nDEBUG: $query\n" if ($DEBUG); my $ldap = Net::LDAP->new($ldap_server, Debug => 3) or die $@; if (defined($ldap_tls) && $ldap_tls) { my $mesg = $ldap->start_tls(); die $mesg->error if $mesg->is_error; } if (defined($ldap_sasl_mech) && $ldap_sasl_mech ne '') { my $sasl = Authen::SASL->new(mechanism => 'GSSAPI') or die $@; my $mesg =$ldap->bind(sasl => $sasl); die $mesg->error if $mesg->is_error; } elsif (defined($ldap_bind_dn) && $ldap_bind_dn ne '' && defined($ldap_bind_password) && $ldap_bind_password ne '') { $ldap->bind($ldap_bind_dn, password=> $ldap_bind_password); } else { $ldap->bind; } my $mesg = $ldap->search( base => $search_base, filter => $query, $ldap_scope ? (scope => $ldap_scope) : () ) or die $@; if ($mesg->code && ($mesg->code ne '4')) { die "Search failed. LDAP server returned an error : ", $mesg->code, ", description: ", $mesg->error; } my @entries = $mesg->entries; map { $_->dump } $mesg->all_entries if ($DEBUG); my $entry; foreach $entry (@entries) { print "DEBUG: processing $entry->dn\n" if ($DEBUG); # prepare the results my @emails = (); my $realname = $ldap_result_realname; my $comment = $ldap_result_comment; foreach my $answer (split / /, $ldap_expected_answers) { my $result = ''; # if this is email we take all the values if( $ldap_result_email =~ /\$\{$answer}/ ) { foreach my $result ($entry->get_value($answer)) { my $email = $ldap_result_email; $email =~ s/\$\{$answer}/$result/g; push @emails, $email; } } else { my $result = ''; # if there is no answer must return the null otherwise we get an uninitialized variable error ($result = $entry->get_value($answer)) || ($result = ''); # replace the containers with the results of the query $realname =~ s/\$\{$answer}/$result/g; $comment =~ s/\$\{$answer}/$result/g; } } foreach my $ema (@emails) { push @results, "$ema\t$realname\t$comment\n"; } } $ldap->unbind; } if ($lbdb_output) { # display results convenient for lbdb processing print @results; } else { print "LDAP query: found ", scalar(@results), "\n", @results; } exit 1 if ! @results; __END__ =head1 NAME mutt_ldap_query - Query LDAP server for Mutt mail-reader =head1 SYNOPSIS mutt_ldap_query.pl [options] [[] ...] =head1 OPTIONS =over 8 =item B<--config=config_file> or B<-c config_file> specify an alternate resource file other than the system ones (F<@SYSCONF_DIR@/lbdb_ldap.rc> or F<@SYSCONF_DIR@/mutt_ldap_query.rc>) or default personal ones (F<$XDG_CONFIG_HOME/lbdb/ldap.rc>, F<$HOME/.lbdb/ldap.rc> or F<$HOME/.mutt_ldap_query.rc>). =item B<--server=ldap_server> or B<-ls ldap_server> hostname of your ldap server. You can also use an ldap://foo[:port] or ldaps://foo[:port] URL here to talk to different ports or SSL encrypted servers. Or use ldapi://%2fvar%2flib%2fldap_sock to access an ldap server via a socket (use %2f as as replacement for a slash in the file name). =item B<--search_base=ldap_search_base> or B<-sb ldap_search_base> use as the starting point for the search instead of the default. =item B<--search_fields=ldap_search_fields> or B<-sf ldap_search_fields> list of the fields on which the query will be performed. =item B<--expected_answers=ldap_expected_answers> or B<-ea ldap_expected_answers> list of the fields expected as the answer of the ldap server that will be used for composing the output of the script. =item B<--format_email=result_format_email> or B<-fe result_format_email> format to be used for composing the email output result. It has to be based on the expected ldap server answers and can use variable containers of the form ${variable} where variable belongs to the set. =item B<--format_realname=result_format_realname> or B<-fr result_format_realname> format to be used for composing the realname output result. It has to be based on the expected ldap server answers and can use variable containers of the form ${variable} where variable belongs to the set. =item B<--format_comment=result_format_comment> or B<-fc result_format_comment> format to be used for composing the comment output result. It has to be based on the expected ldap server answers and can use variable containers of the form ${variable} where variable belongs to the set. =item B<--bind_dn=bind_distinguished_name> or B<-bd bind_distinguished_name> the destinguished name of the user who binds to the LDAP server. Leave it empty for an anonmyous bind. =item B<--bind_password=secret> or B<-bp secret> the bind password for binding to the LDAP server. Leave it empty for an anonmyous bind. =item B<--tls=1> or B<--tls=0> enable or disable transport layer security (TLS). =item B<--sasl_mech=mechanism> or B<-sm mechanism> the SASL mechanism, for example GSSAPI (empty string to turn off). =item B<--scope=ldap_scope> The default search applies to the whole tree. Specifying the optional scope parameter allows the search to be limited in various ways. Some valid values include: 'base', 'one', 'sub', 'subtree', 'children'. See the Net::LDAP CPAN documentation for more information. =item B<--nickname=ldap_server_nickname> or B<-n ldap_server_nickname> shortcut for avoiding to use all the previous options by using the script builtin or alternate config file table of common servers and associated options. All the required parameters are then derived by performing a lookup. =item B<--debug> or B<-d> turn on debugging messages. =item B<--help> or B<-?> or B<-h> or B<--man> or B<-m> generates this help message. =item B<--ignorant> or B<-i> ignorant mode: search using wildcard for *name_to_query* (requires a longer processing from LDAP server but is quite convenient :). =item B<--lbdb_output> or B<-l> suppress number of matches output (suited for interfacing with little brother database https://www.spinnaker.de/lbdb/) =item B<--version> or B<-v> show the version. =back =head1 DESCRIPTION B performs ldap queries using either ldapsearch command or the perl-ldap module and it outputs the required formatted data for feeding mutt when using its "External Address Query" feature. The output of the script consists in 3 fields separated with tabs: the email address, the name of the person and a comment. =head1 INTERFACING WITH MUTT This perl script can be interfaced with mutt by defining in your .muttrc: set query_command = "mutt_ldap_query.pl %s" Multiple requests are supported: the "Q" command of mutt accepts as argument a list of queries (e.g. "Gosse de\ Courville"). Alternatively mutt_ldap_query can be interfaced with the more generic little brother database query program (https://www.spinnaker.de/lbdb/) using: set query_command = "lbdbq %s" and by specifying in your ~/.lbdb/lbdbrc file another method of query just adding to the METHODS variable the m_ldap module e.g.: METHODS='m_inmail m_passwd m_ldap m_muttalias m_finger' and the right path to access m_ldap in MODULES_PATH, e.g. if you moved F in F<~/.lbdb/modules>: MODULES_PATH="/usr/local/lib $HOME/.lbdb/modules" Just make sure to use the correct path for calling mutt_ldap_query in the m_ldap script. =head1 RESOURCE FILE FORMAT mutt_ldap_query is now fully customizable using an external resource file. By default mutt_ldap_query parses the system definition file located generally at F or F and also the user one: F<$HOME/.mutt_ldap_query.rc>. Instead of using command line options, the user can redefine all the variables using the resource file by two manners in order to match his site configuration. A file example is provided below: # The format of each entry of the ldap server database is the following: # LDAP_NICKNAME => ['LDAP_SERVER', # 'LDAP_SEARCH_BASE', # 'LDAP_SEARCH_FIELDS', # 'LDAP_EXPECTED_ANSWERS', # 'LDAP_RESULT_EMAIL', # 'LDAP_RESULT_REALNAME', # 'LDAP_RESULT_COMMENT'], # a practical illustrating example being: # debian => ['db.debian.org', # 'ou=users,dc=debian,dc=org', # 'uid cn sn ircnick', # 'uid cn sn ircnick', # '${uid}@debian.org', # '${cn} ${sn}', # '${ircnick}'], # the output of the query will be then: # ${uid}@debian.org\t${cn} ${sn}\t${ircnick} (i.e.: email name comment) # warning this database will erase default script builtin %ldap_server_db = ( 'four11' => ['ldap.four11.com', 'c=US', 'givenname sn cn mail', 'givenname cn sn mail o', '${mail}', '${givenname} ${sn}', '${o}' ], 'infospace' => ['ldap.infospace.com', 'c=US', 'givenname sn cn mail', 'givenname cn sn mail o', '${mail}', '${givenname} ${sn}', '${o}' ], 'whowhere' => ['ldap.whowhere.com', 'c=US', 'givenname sn cn mail', 'givenname cn sn mail o', '${mail}', '${givenname} ${sn}', '${o}' ], 'bigfoot' => ['ldap.bigfoot.com', 'c=US', 'givenname sn cn mail' , 'givenname cn sn mail o' , '${mail}' , '${givenname} ${sn}', '${o}' ], 'switchboard' => ['ldap.switchboard.com', 'c=US', 'givenname sn cn mail' , 'givenname cn sn mail o', '${mail}', '${givenname} ${sn}', '${o}' ], 'infospacebiz' => ['ldapbiz.infospace.com', 'c=US', 'givenname sn cn mail', 'givenname cn sn mail o', '${mail}', '${givenname} ${sn}', '${o}' ], ); # hostname of your ldap server $ldap_server = 'ldap.four11.com'; # ldap base search $search_base = 'c=US'; # list of the fields that will be used for the query $ldap_search_fields = 'givenname sn cn mail'; # list of the fields that will be used for composing the answer $ldap_expected_answers = 'givenname sn cn mail o'; # format of the email result based on the expected answers of the ldap query $ldap_result_email = '${mail}'; # format of the realname result based on the expected answers of the ldap query $ldap_result_realname = '${givenname} ${sn}'; # format of the comment result based on the expected answers of the ldap query $ldap_result_comment = '(${o})'; =head1 EXAMPLES OF QUERIES mutt_ldap_query.pl --ldap_server='ldap.mot.com' \ --search_base='ou=employees, o=Motorola,c=US' \ --ldap_search_fields='commonName gn sn cn uid' \ --ldap_expected_answers='gn sn preferredRfc822Recipient ou c telephonenumber' \ --ldap_result_email='${preferredRfc822Recipient}' \ --ldap_result_realname='${gn} ${sn}' \ --ldap_result_comment='(${telephonenumber}) ${ou} ${c}' \ Gosse de\ Courville performs a query using the ldap server ldap.mot.com using the following searching base 'ou=employees, o=Motorola,c=US' and performing a search on the fields 'commonName gn sn cn uid' for 'Gosse' and then "de Courville" looking for the following answers 'gn sn preferredRfc822Recipient ou c telephonenumber'. Based on this answers, mutt_ldap_query will return a list of entries identified of the form: <${preferredRfc822Recipient}>\t${gn} ${sn}\t(${telephonenumber}) ${ou} ${c} where ${} variables should be considered as containers that are replaced by the results of the query. The previous query can be greatly simplified by using the ldap server mini database feature of the resource file introducing for example a nickname. mutt_ldap_query.pl --ldap_server_nickname='motorola' Gosse de\ Courville When not sure of the full name (i.e. it should contain Courville) the ignorant mode is useful since the query will be performed using wildcards, i.e. *Courville* in the following case: mutt_ldap_query.pl --ignorant Courville =head1 WHERE TO GET IT The latest version can be retrieved at ftp://ftp.mutt.org/pub/mutt/contrib or http://www.courville.org/ Note that now the script is integrated in the latest version of the little brother database available at https://www.spinnaker.de/lbdb/. It is thus easier to use through this standard package than to hand customize it to fit your system/distribution needs. =head1 REFERENCES =over 2 =item - perl-ldap module http://perl-ldap.sourceforge.net/ =item - mutt is the ultimate email client http://www.mutt.org/ =item - historical Brandon Blong's "External Address Query" feature patch for mutt http://www.fiction.net/blong/programs/mutt/#query =item - little brother database is an interface query program for mutt that allow multiple searches for email addresses based on external query scripts just like this one 8-) https://www.spinnaker.de/lbdb/ =back =head1 AUTHORS Marc de Courville and the various other contributors... that kindly sent their patches. Please report any bugs, or post any suggestions, to . =head1 COPYRIGHT Copyright (c) 1998-2003 Marc de Courville . All rights reserved. This program is free software; you can redistribute it and/or modify it under the GNU General Public License (GPL). See http://www.opensource.org/gpl-license.html and http://www.opensource.org/. =cut lbdb-0.54/nodelist2lbdb.man.in000066400000000000000000000027221465114770000162060ustar00rootroot00000000000000.\" -*-nroff-*- .\" Copyright (c) 1999-2018 Roland Rosenfeld .\" .\" This manual page is free software; you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by .\" the Free Software Foundation; either version 2 of the License, or .\" (at your option) any later version. .\" .\" This program is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public License .\" along with this program; if not, write to the Free Software Foundation, .\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. .\" .TH NODELIST2LBDB 1 "October 2005" Unix "User Manuals" .SH NAME nodelist2lbdb \- convert Fido nodelist and pointlist to lbdb format .SH SYNOPSIS .B nodelist2lbdb .BI nodelist. XXX .BI [point24. XXX ] .SH DESCRIPTION This little script reads in a Fido named .BI nodelist. XXX and optionally a Fido point list named .BI points24. YYY and generates a list with the lbdb format: .nf TAB TAB .fi This file is written to .I $HOME/.lbdb/nodelist .SH FILES .I $HOME/.lbdb/nodelist .br .I @libdir@/m_fido .SH "SEE ALSO" .BR lbdbq (1) .SH AUTHORS .B nodelist2lbdb is written by Roland Rosenfeld . lbdb-0.54/nodelist2lbdb.pl.in000066400000000000000000000056241465114770000160520ustar00rootroot00000000000000#! @PERL@ # # -*-perl-*- # # This little script reads Fido nodelist.XXX (and points24.YYY) in and # generates a list with the following format from it: # TAB TAB # To reduce the size of the generated list, only Region 24 of the # nodelist is used. # # The generated list can be used in combination of Thomas Roessler's # lbdb for the Mutt mailreader. # ########################################################################## # # Copyright (C) 1998-2018 Roland Rosenfeld # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. # ########################################################################## $database="$ENV{HOME}/.lbdb/nodelist"; if (@ARGV == 0 || @ARGV >2 || !($ARGV[0] =~ /nodelist\.\d\d\d$/i) || ((@ARGV == 2) && !($ARGV[1] =~ /points24\.\d\d\d$/i ))) { die "Usage: $0 nodelist.XXX [points24.YYY]\n"; } open (DB, ">$database") || die "Cannot open $database for writing"; # # Process Nodelist: # $zone=2; $net=0; $node=0; open (NODELIST, "<$ARGV[0]") || die "Cannot open $ARGV[0]"; while () { next if /^;/; ($special,$number,$bbs,$city,$name) = split(/,/); if ($special =~ /Zone/) { $zone=$number; $net=$number; $node=0; } elsif ($special =~ /Region/) { $net=$number; $node=0; } elsif ($special =~ /Host/) { $net=$number; $node=0; } elsif ($special =~ /Down|Hold/) { next; } else { $node = $number; } $address = "$name\@f$node.n$net.z$zone.fidonet.org"; $name =~ s/_/ /g; $bbs =~ s/_/ /g; # # Restrict to Region 24: # # if ($zone =~ /^2$/ && $net =~ /^24/ ) { print DB "$address\t$name\t$bbs\n"; # } } close NODELIST; # # Process Pointlist: # $zone=2; $net=0; $node=0; $point=0; open (POINTLIST, "<$ARGV[1]") || die "Cannot open $ARGV[1]"; while () { next if /^;/; ($special,$number,$bbs,$city,$name) = split(/,/); if ($special =~ /Region/) { next; } elsif ($special =~ /Host/) { ($net,$node) = split(/\//, $bbs); next; } elsif ($special =~ /Down|Hold/) { next; } else { $point = $number; } $address = "$name\@p$point.f$node.n$net.z$zone.fidonet.org"; $name =~ s/_/ /g; $city =~ s/_/ /g; print DB "$address\t$name\t$city\n"; } close NODELIST; close DB; lbdb-0.54/palm_lsaddr.pl.in000066400000000000000000000043111465114770000155750ustar00rootroot00000000000000#! @PERL@ # # palm_lsaddr - Palm address database helper utility for lbdb # Copyright (C) 2000 Dave Pearson # (C) 2003 Nikolaus Rath # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. use Palm::PDB; use Palm::Address; if ( $#ARGV > -1 ) { my $pdb = new Palm::PDB; if ( $pdb ) { $pdb->Load( $ARGV[ 0 ] ); my $record; for ( $i = 0, $record = $pdb->{records}[ $i ]; $record; $i++, $record = $pdb->{records}[ $i ] ) { my $name = $record->{fields}{firstName} . " " . $record->{fields}{name}; # Remove leading and trailing whitespace. $name =~ s/\s+$//; $name =~ s/^\s+//; # If the name is empty, use the company name instead. $name = $record->{fields}{company} unless ( length( $name ) > 0 ); if ( length( $name ) > 0 ) { my $entry; # Find fields containing e-mail addresses for($entry=1; $entry <= 5; $entry++) { # 0 = Work, 1 = Home, 2 = Fax, 3 = Other, 4 = email, # 5 = Main, 6 = Pager, 7 = Mobile if($record->{phoneLabel}{"phone${entry}"} == 4) { # A field can also contain multiple lines. print map "$_\t$name\t(Palm)\n", split(/\n/, $record->{fields}{"phone${entry}"}); } } } } } } lbdb-0.54/qpto8bit.c000066400000000000000000000023161465114770000142720ustar00rootroot00000000000000/* * Copyright (C) 2000-2018 Roland Rosenfeld * * This program is free software; you can redistribute * it and/or modify it under the terms of the GNU * General Public License as published by the Free * Software Foundation; either version 2 of the License, * or (at your option) any later version. * * This program is distributed in the hope that it will * be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A * PARTICULAR PURPOSE. See the GNU General Public * License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. * */ #include #include "helpers.h" #include "rfc822.h" #include "rfc2047.h" int main (int argc, char * argv[]) { char buff[2048]; #ifdef HAVE_ICONV const char **charsetptr = &Charset; #endif #ifdef HAVE_ICONV if (argc > 1) *charsetptr = argv[1]; #endif while (fgets (buff, sizeof (buff), stdin)) { rfc2047_decode (buff, buff, sizeof (buff)); fputs (buff, stdout); } return 0; } lbdb-0.54/rfc2047.c000066400000000000000000000134211465114770000136060ustar00rootroot00000000000000/* * Copyright (C) 1996-2000,2010 Michael R. Elkins * Copyright (C) 2000-2002 Edmund Grimley Evans * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #ifdef HAVE_ICONV #include #include #include #endif #include "rfc822.h" #include "rfc2047.h" #include "helpers.h" enum { ENCOTHER, ENC7BIT, ENC8BIT, ENCQUOTEDPRINTABLE, ENCBASE64, ENCBINARY }; const char MimeSpecials[] = "@.,;<>[]\\\"()?/="; const char *Charset = "utf-8"; /* XXX - hack */ int Index_hex[128] = { -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,-1,-1, -1,-1,-1,-1, -1,10,11,12, 13,14,15,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,10,11,12, 13,14,15,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1 }; int Index_64[128] = { -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,62, -1,-1,-1,63, 52,53,54,55, 56,57,58,59, 60,61,-1,-1, -1,-1,-1,-1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11,12,13,14, 15,16,17,18, 19,20,21,22, 23,24,25,-1, -1,-1,-1,-1, -1,26,27,28, 29,30,31,32, 33,34,35,36, 37,38,39,40, 41,42,43,44, 45,46,47,48, 49,50,51,-1, -1,-1,-1,-1 }; #define IsPrint(c) (isprint((unsigned char)(c)) || \ ((unsigned char)(c) >= 0xa0)) #define hexval(c) Index_hex[(unsigned int)(c)] #define base64val(c) Index_64[(unsigned int)(c)] static int rfc2047_decode_word (char *d, const char *s, size_t dlen) { char *p = safe_strdup (s); char *pp = p; char *pd = d; size_t len = dlen; int enc = 0, filter = 0, count = 0, c1, c2, c3, c4; #ifdef HAVE_ICONV char *fromcharset; iconv_t cd; size_t in; #endif while ((pp = strtok (pp, "?")) != NULL) { count++; switch (count) { case 2: if (strcasecmp (pp, Charset) != 0) { filter = 1; #ifdef HAVE_ICONV fromcharset = safe_strdup (pp); #endif } break; case 3: if (toupper (*pp) == 'Q') enc = ENCQUOTEDPRINTABLE; else if (toupper (*pp) == 'B') enc = ENCBASE64; else return (-1); break; case 4: if (enc == ENCQUOTEDPRINTABLE) { while (*pp && len > 0) { if (*pp == '_') { *pd++ = ' '; len--; } else if (*pp == '=') { *pd++ = (hexval(pp[1]) << 4) | hexval(pp[2]); len--; pp += 2; } else { *pd++ = *pp; len--; } pp++; } *pd = 0; } else if (enc == ENCBASE64) { while (*pp && len > 0) { c1 = base64val(pp[0]); c2 = base64val(pp[1]); *pd++ = (c1 << 2) | ((c2 >> 4) & 0x3); if (--len == 0) break; if (pp[2] == '=') break; c3 = base64val(pp[2]); *pd++ = ((c2 & 0xf) << 4) | ((c3 >> 2) & 0xf); if (--len == 0) break; if (pp[3] == '=') break; c4 = base64val(pp[3]); *pd++ = ((c3 & 0x3) << 6) | c4; if (--len == 0) break; pp += 4; } *pd = 0; } break; } pp = 0; } safe_free (&p); if (filter) { #ifdef HAVE_ICONV if ((cd = iconv_open (Charset, fromcharset)) == (iconv_t)(-1)) { #endif pd = d; while (*pd) { if (!IsPrint (*pd)) *pd = '?'; pd++; } #ifdef HAVE_ICONV } else { p = safe_strdup (d); pp = p; in = strlen (d) + 1; pd = d; /* maximum available buffer length for converted string */ len = dlen; while (*pd && iconv (cd, &pp, &in, &pd, &len) == (size_t)(-1)) { if (errno == E2BIG) break; *pd = '?'; pp++; in--; pd++; len--; } iconv (cd, NULL, NULL, &pd, &len); iconv_close (cd); safe_free (&p); } safe_free (&fromcharset); #endif } return (0); } /* try to decode anything that looks like a valid RFC2047 encoded * header field, ignoring RFC822 parsing rules */ void rfc2047_decode (char *d, const char *s, size_t dlen) { const char *p, *q; size_t n; int found_encoded = 0; dlen--; /* save room for the terminal nul */ while (*s && dlen > 0) { if ((p = strstr (s, "=?")) == NULL || (q = strchr (p + 2, '?')) == NULL || (q = strchr (q + 1, '?')) == NULL || (q = strstr (q + 1, "?=")) == NULL) { /* no encoded words */ if (d != s) snprintf(d, dlen, "%s", s); return; } if (p != s) { n = (size_t) (p - s); /* ignore spaces between encoded words */ if (!found_encoded || strspn (s, " \t\r\n") != n) { if (n > dlen) n = dlen; if (d != s) memcpy (d, s, n); d += n; dlen -= n; } } rfc2047_decode_word (d, p, dlen); found_encoded = 1; s = q + 2; n = strlen (d); dlen -= n; d += n; } *d = 0; } void rfc2047_decode_adrlist (ADDRESS *a) { while (a) { if (a->personal && strstr (a->personal, "=?") != NULL) rfc2047_decode (a->personal, a->personal, strlen (a->personal) + 1); a = a->next; } } lbdb-0.54/rfc2047.h000066400000000000000000000017471465114770000136230ustar00rootroot00000000000000/* * Copyright (C) 1996-2000 Michael R. Elkins * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include "rfc822.h" extern const char *Charset; void rfc2047_decode (char *, const char *, size_t); void rfc2047_decode_adrlist (ADDRESS *); lbdb-0.54/rfc822.c000066400000000000000000000531761465114770000135400ustar00rootroot00000000000000/* * Copyright (C) 1996-2000 Michael R. Elkins * Copyright (C) 2011-2013 Michael R. Elkins * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include "helpers.h" #include "rfc822.h" #define terminate_string(a, b, c) \ do \ { \ if ((b) < (c)) \ a[(b)] = 0; \ else \ a[(c)] = 0; \ } while (0) #define terminate_buffer(a, b) terminate_string(a, b, sizeof (a) - 1) const char RFC822Specials[] = "@.,:;<>[]\\\"()"; #define is_special(x) strchr(RFC822Specials,x) int RFC822Error = 0; /* these must defined in the same order as the numerated errors given in rfc822.h */ const char * const RFC822Errors[] = { "out of memory", "mismatched parenthesis", "mismatched quotes", "bad route in <>", "bad address in <>", "bad address spec", "bad address literal" }; void rfc822_dequote_comment (char *s) { char *w = s; for (; *s; s++) { if (*s == '\\') { if (!*++s) break; /* error? */ *w++ = *s; } else if (*s != '\"') { if (w != s) *w = *s; w++; } } *w = 0; } static void free_address (ADDRESS *a) { FREE(&a->personal); FREE(&a->mailbox); #ifdef EXACT_ADDRESS FREE(&a->val); #endif FREE(&a); } int rfc822_remove_from_adrlist (ADDRESS **a, const char *mailbox) { ADDRESS *p, *last = NULL, *t; int rv = -1; p = *a; last = NULL; while (p) { if (ascii_strcasecmp (mailbox, p->mailbox) == 0) { if (last) last->next = p->next; else (*a) = p->next; t = p; p = p->next; free_address (t); rv = 0; } else { last = p; p = p->next; } } return (rv); } void rfc822_free_address (ADDRESS **p) { ADDRESS *t; while (*p) { t = *p; *p = (*p)->next; #ifdef EXACT_ADDRESS FREE (&t->val); #endif FREE (&t->personal); FREE (&t->mailbox); FREE (&t); } } const char * rfc822_parse_comment (const char *s, char *comment, size_t *commentlen, size_t commentmax) { int level = 1; while (*s && level) { if (*s == '(') level++; else if (*s == ')') { if (--level == 0) { s++; break; } } else if (*s == '\\') { if (!*++s) break; } if (*commentlen < commentmax) comment[(*commentlen)++] = *s; s++; } if (level) { RFC822Error = ERR_MISMATCH_PAREN; return NULL; } return s; } static const char * parse_quote (const char *s, char *token, size_t *tokenlen, size_t tokenmax) { while (*s) { if (*tokenlen < tokenmax) token[*tokenlen] = *s; if (*s == '\\') { if (!*++s) break; if (*tokenlen < tokenmax) token[*tokenlen] = *s; } else if (*s == '"') return (s + 1); (*tokenlen)++; s++; } RFC822Error = ERR_MISMATCH_QUOTE; return NULL; } static const char * parse_literal (const char *s, char *token, size_t *tokenlen, size_t tokenmax) { while (*s) { if (*s == '\\' || *s == '[') { RFC822Error = ERR_BAD_LITERAL; return NULL; } if (*tokenlen < tokenmax) token[(*tokenlen)++] = *s; if (*s == ']') return s + 1; s++; } RFC822Error = ERR_BAD_LITERAL; return NULL; } static const char * next_token (const char *s, char *token, size_t *tokenlen, size_t tokenmax) { if (*s == '(') return (rfc822_parse_comment (s + 1, token, tokenlen, tokenmax)); if (*s == '"') return (parse_quote (s + 1, token, tokenlen, tokenmax)); if (*s && is_special (*s)) { if (*tokenlen < tokenmax) token[(*tokenlen)++] = *s; return (s + 1); } while (*s) { if (is_email_wsp(*s) || is_special (*s)) break; if (*tokenlen < tokenmax) token[(*tokenlen)++] = *s; s++; } return s; } static const char * parse_mailboxdomain (const char *s, const char *nonspecial, char *mailbox, size_t *mailboxlen, size_t mailboxmax, char *comment, size_t *commentlen, size_t commentmax) { const char *ps; while (*s) { s = skip_email_wsp(s); if (! *s) return s; if (strchr (nonspecial, *s) == NULL && is_special (*s)) return s; if (*s == '(') { if (*commentlen && *commentlen < commentmax) comment[(*commentlen)++] = ' '; ps = next_token (s, comment, commentlen, commentmax); } else ps = next_token (s, mailbox, mailboxlen, mailboxmax); if (!ps) return NULL; s = ps; } return s; } static const char * parse_domain (const char *s, char *mailbox, size_t *mailboxlen, size_t mailboxmax, char *comment, size_t *commentlen, size_t commentmax) { const char *ps; const char *nonspecial; int domain_literal = 0; while (*s) { s = skip_email_wsp(s); if (! *s) return s; if (*s == '(') { if (*commentlen && *commentlen < commentmax) comment[(*commentlen)++] = ' '; ps = next_token (s, comment, commentlen, commentmax); } else { if (*s == '[') { domain_literal = 1; if (*mailboxlen < mailboxmax) mailbox[(*mailboxlen)++] = '['; s++; nonspecial = "@.,:;<>\"()"; } else nonspecial = ".([]\\"; s = parse_mailboxdomain (s, nonspecial, mailbox, mailboxlen, mailboxmax, comment, commentlen, commentmax); if (domain_literal) { if (!s || *s != ']') { RFC822Error = ERR_BAD_LITERAL; return NULL; } if (*mailboxlen < mailboxmax) mailbox[(*mailboxlen)++] = ']'; s++; } return s; } if (!ps) return NULL; s = ps; } return s; } static const char * parse_address (const char *s, char *token, size_t *tokenlen, size_t tokenmax, char *comment, size_t *commentlen, size_t commentmax, ADDRESS *addr) { s = parse_mailboxdomain (s, ".\"(\\", token, tokenlen, tokenmax, comment, commentlen, commentmax); if (!s) return NULL; if (*s == '@') { if (*tokenlen < tokenmax) token[(*tokenlen)++] = '@'; s = parse_domain (s + 1, token, tokenlen, tokenmax, comment, commentlen, commentmax); if (!s) return NULL; } terminate_string (token, *tokenlen, tokenmax); addr->mailbox = safe_strdup (token); if (*commentlen && !addr->personal) { terminate_string (comment, *commentlen, commentmax); addr->personal = safe_strdup (comment); } return s; } static const char * parse_route_addr (const char *s, char *comment, size_t *commentlen, size_t commentmax, ADDRESS *addr) { char token[LONG_STRING]; size_t tokenlen = 0; s = skip_email_wsp(s); /* find the end of the route */ if (*s == '@') { while (s && *s == '@') { if (tokenlen < sizeof (token) - 1) token[tokenlen++] = '@'; s = parse_mailboxdomain (s + 1, ",.\\[](", token, &tokenlen, sizeof (token) - 1, comment, commentlen, commentmax); } if (!s || *s != ':') { RFC822Error = ERR_BAD_ROUTE; return NULL; /* invalid route */ } if (tokenlen < sizeof (token) - 1) token[tokenlen++] = ':'; s++; } if ((s = parse_address (s, token, &tokenlen, sizeof (token) - 1, comment, commentlen, commentmax, addr)) == NULL) return NULL; if (*s != '>') { RFC822Error = ERR_BAD_ROUTE_ADDR; return NULL; } if (!addr->mailbox) addr->mailbox = safe_strdup ("@"); s++; return s; } static const char * parse_addr_spec (const char *s, char *comment, size_t *commentlen, size_t commentmax, ADDRESS *addr) { char token[LONG_STRING]; size_t tokenlen = 0; s = parse_address (s, token, &tokenlen, sizeof (token) - 1, comment, commentlen, commentmax, addr); if (s && *s && *s != ',' && *s != ';') { RFC822Error = ERR_BAD_ADDR_SPEC; return NULL; } return s; } static void add_addrspec (ADDRESS **top, ADDRESS **last, const char *phrase, char *comment, size_t *commentlen, size_t commentmax) { ADDRESS *cur = rfc822_new_address (); if (parse_addr_spec (phrase, comment, commentlen, commentmax, cur) == NULL) { rfc822_free_address (&cur); return; } if (*last) (*last)->next = cur; else *top = cur; *last = cur; } ADDRESS *rfc822_parse_adrlist (ADDRESS *top, const char *s) { int ws_pending, nl, in_group = 0; #ifdef EXACT_ADDRESS const char *begin; #endif const char *ps; char comment[LONG_STRING], phrase[LONG_STRING]; size_t phraselen = 0, commentlen = 0; ADDRESS *cur, *last = NULL; RFC822Error = 0; last = top; while (last && last->next) last = last->next; ws_pending = is_email_wsp (*s); if ((nl = safe_strlen (s))) nl = s[nl - 1] == '\n'; s = skip_email_wsp(s); #ifdef EXACT_ADDRESS begin = s; #endif while (*s) { if (*s == ',') { if (phraselen) { terminate_buffer (phrase, phraselen); add_addrspec (&top, &last, phrase, comment, &commentlen, sizeof (comment) - 1); } else if (commentlen && last && !last->personal) { terminate_buffer (comment, commentlen); last->personal = safe_strdup (comment); } #ifdef EXACT_ADDRESS if (last && !last->val) last->val = mutt_substrdup (begin, s); #endif commentlen = 0; phraselen = 0; s++; #ifdef EXACT_ADDRESS begin = skip_email_wsp(s); #endif } else if (*s == '(') { if (commentlen && commentlen < sizeof (comment) - 1) comment[commentlen++] = ' '; if ((ps = next_token (s, comment, &commentlen, sizeof (comment) - 1)) == NULL) { rfc822_free_address (&top); return NULL; } s = ps; } else if (*s == '"') { if (phraselen && phraselen < sizeof (phrase) - 1) phrase[phraselen++] = ' '; if ((ps = parse_quote (s + 1, phrase, &phraselen, sizeof (phrase) - 1)) == NULL) { rfc822_free_address (&top); return NULL; } s = ps; } else if (*s == '[') { if (phraselen && phraselen < sizeof (phrase) - 1 && ws_pending) phrase[phraselen++] = ' '; if (phraselen < sizeof (phrase) - 1) phrase[phraselen++] = '['; if ((ps = parse_literal (s + 1, phrase, &phraselen, sizeof (phrase) - 1)) == NULL) { rfc822_free_address (&top); return NULL; } s = ps; } else if (*s == ':') { if (phraselen) { /* add group terminator, if one was missing */ if (last && in_group) { last->next = rfc822_new_address (); last = last->next; } cur = rfc822_new_address (); terminate_buffer (phrase, phraselen); cur->mailbox = safe_strdup (phrase); cur->group = 1; in_group = 1; if (last) last->next = cur; else top = cur; last = cur; #ifdef EXACT_ADDRESS last->val = mutt_substrdup (begin, s); #endif } phraselen = 0; commentlen = 0; s++; #ifdef EXACT_ADDRESS begin = skip_email_wsp(s); #endif } else if (*s == ';') { if (phraselen) { terminate_buffer (phrase, phraselen); add_addrspec (&top, &last, phrase, comment, &commentlen, sizeof (comment) - 1); } else if (commentlen && last && !last->personal) { terminate_buffer (comment, commentlen); last->personal = safe_strdup (comment); } #ifdef EXACT_ADDRESS if (last && !last->val) last->val = mutt_substrdup (begin, s); #endif /* add group terminator */ if (last && in_group) { last->next = rfc822_new_address (); last = last->next; } in_group = 0; phraselen = 0; commentlen = 0; #ifdef EXACT_ADDRESS begin = s; #endif s++; } else if (*s == '<') { terminate_buffer (phrase, phraselen); cur = rfc822_new_address (); if (phraselen) cur->personal = safe_strdup (phrase); if ((ps = parse_route_addr (s + 1, comment, &commentlen, sizeof (comment) - 1, cur)) == NULL) { rfc822_free_address (&top); rfc822_free_address (&cur); return NULL; } if (last) last->next = cur; else top = cur; last = cur; phraselen = 0; commentlen = 0; s = ps; } else { if (phraselen && phraselen < sizeof (phrase) - 1 && ws_pending) phrase[phraselen++] = ' '; if ((ps = next_token (s, phrase, &phraselen, sizeof (phrase) - 1)) == NULL) { rfc822_free_address (&top); return NULL; } s = ps; } ws_pending = is_email_wsp(*s); s = skip_email_wsp(s); } if (phraselen) { terminate_buffer (phrase, phraselen); terminate_buffer (comment, commentlen); add_addrspec (&top, &last, phrase, comment, &commentlen, sizeof (comment) - 1); } else if (commentlen && last && !last->personal) { terminate_buffer (comment, commentlen); last->personal = safe_strdup (comment); } #ifdef EXACT_ADDRESS if (last && !last->val) last->val = mutt_substrdup (begin, s - nl < begin ? begin : s - nl); #endif /* add group terminator, if it was left off */ if (last && in_group) last->next = rfc822_new_address (); return top; } void rfc822_qualify (ADDRESS *addr, const char *host) { char *p; for (; addr; addr = addr->next) if (!addr->group && addr->mailbox && strchr (addr->mailbox, '@') == NULL) { p = safe_malloc (safe_strlen (addr->mailbox) + safe_strlen (host) + 2); sprintf (p, "%s@%s", addr->mailbox, host); /* __SPRINTF_CHECKED__ */ FREE (&addr->mailbox); addr->mailbox = p; } } void rfc822_cat (char *buf, size_t buflen, const char *value, const char *specials) { if (strpbrk (value, specials)) { char tmp[256], *pc = tmp; size_t tmplen = sizeof (tmp) - 3; *pc++ = '"'; for (; *value && tmplen > 1; value++) { if (*value == '\\' || *value == '"') { *pc++ = '\\'; tmplen--; } *pc++ = *value; tmplen--; } *pc++ = '"'; *pc = 0; strfcpy (buf, tmp, buflen); } else strfcpy (buf, value, buflen); } void rfc822_write_address_single (char *buf, size_t buflen, ADDRESS *addr, int display) { size_t len; char *pbuf = buf; char *pc; if (!addr) return; buflen--; /* save room for the terminal nul */ #ifdef EXACT_ADDRESS if (addr->val) { if (!buflen) goto done; strfcpy (pbuf, addr->val, buflen); len = safe_strlen (pbuf); pbuf += len; buflen -= len; if (addr->group) { if (!buflen) goto done; *pbuf++ = ':'; buflen--; *pbuf = 0; } return; } #endif if (addr->personal) { if (strpbrk (addr->personal, RFC822Specials)) { if (!buflen) goto done; *pbuf++ = '"'; buflen--; for (pc = addr->personal; *pc && buflen > 0; pc++) { if (*pc == '"' || *pc == '\\') { *pbuf++ = '\\'; buflen--; } if (!buflen) goto done; *pbuf++ = *pc; buflen--; } if (!buflen) goto done; *pbuf++ = '"'; buflen--; } else { if (!buflen) goto done; strfcpy (pbuf, addr->personal, buflen); len = safe_strlen (pbuf); pbuf += len; buflen -= len; } if (!buflen) goto done; *pbuf++ = ' '; buflen--; } if (addr->personal || (addr->mailbox && *addr->mailbox == '@')) { if (!buflen) goto done; *pbuf++ = '<'; buflen--; } if (addr->mailbox) { if (!buflen) goto done; if (ascii_strcmp (addr->mailbox, "@") && !display) { strfcpy (pbuf, addr->mailbox, buflen); len = safe_strlen (pbuf); } else if (ascii_strcmp (addr->mailbox, "@") && display) { strfcpy (pbuf, mutt_addr_for_display (addr), buflen); len = safe_strlen (pbuf); } else { *pbuf = '\0'; len = 0; } pbuf += len; buflen -= len; if (addr->personal || (addr->mailbox && *addr->mailbox == '@')) { if (!buflen) goto done; *pbuf++ = '>'; buflen--; } if (addr->group) { if (!buflen) goto done; *pbuf++ = ':'; buflen--; if (!buflen) goto done; *pbuf++ = ' '; buflen--; } } else { if (!buflen) goto done; *pbuf++ = ';'; buflen--; } done: /* no need to check for length here since we already save space at the beginning of this routine */ *pbuf = 0; } /* note: it is assumed that `buf' is nul terminated! */ int rfc822_write_address (char *buf, size_t buflen, ADDRESS *addr, int display) { char *pbuf = buf; size_t len = safe_strlen (buf); buflen--; /* save room for the terminal nul */ if (len > 0) { if (len > buflen) return pbuf - buf; /* safety check for bogus arguments */ pbuf += len; buflen -= len; if (!buflen) goto done; *pbuf++ = ','; buflen--; if (!buflen) goto done; *pbuf++ = ' '; buflen--; } for (; addr && buflen > 0; addr = addr->next) { /* use buflen+1 here because we already saved space for the trailing nul char, and the subroutine can make use of it */ rfc822_write_address_single (pbuf, buflen + 1, addr, display); /* this should be safe since we always have at least 1 char passed into the above call, which means `pbuf' should always be nul terminated */ len = safe_strlen (pbuf); pbuf += len; buflen -= len; /* if there is another address, and its not a group mailbox name or group terminator, add a comma to separate the addresses */ if (addr->next && addr->next->mailbox && !addr->group) { if (!buflen) goto done; *pbuf++ = ','; buflen--; if (!buflen) goto done; *pbuf++ = ' '; buflen--; } } done: *pbuf = 0; return pbuf - buf; } /* this should be rfc822_cpy_adr */ ADDRESS *rfc822_cpy_adr_real (ADDRESS *addr) { ADDRESS *p = rfc822_new_address (); #ifdef EXACT_ADDRESS p->val = safe_strdup (addr->val); #endif p->personal = safe_strdup (addr->personal); p->mailbox = safe_strdup (addr->mailbox); p->group = addr->group; p->is_intl = addr->is_intl; p->intl_checked = addr->intl_checked; return p; } /* this should be rfc822_cpy_adrlist */ ADDRESS *rfc822_cpy_adr (ADDRESS *addr, int prune) { ADDRESS *top = NULL, *last = NULL; for (; addr; addr = addr->next) { if (prune && addr->group && (!addr->next || !addr->next->mailbox)) { /* ignore this element of the list */ } else if (last) { last->next = rfc822_cpy_adr_real (addr); last = last->next; } else top = last = rfc822_cpy_adr_real (addr); } return top; } /* append list 'b' to list 'a' and return the last element in the new list */ ADDRESS *rfc822_append (ADDRESS **a, ADDRESS *b, int prune) { ADDRESS *tmp = *a; while (tmp && tmp->next) tmp = tmp->next; if (!b) return tmp; if (tmp) tmp->next = rfc822_cpy_adr (b, prune); else tmp = *a = rfc822_cpy_adr (b, prune); while (tmp && tmp->next) tmp = tmp->next; return tmp; } /* incomplete. Only used to thwart the APOP MD5 attack (#2846). */ int rfc822_valid_msgid (const char *msgid) { /* msg-id = "<" addr-spec ">" * addr-spec = local-part "@" domain * local-part = word *("." word) * word = atom / quoted-string * atom = 1* * CHAR = ( 0.-127. ) * specials = "(" / ")" / "<" / ">" / "@" / "," / ";" / ":" / "\" / <"> / "." / "[" / "]" * SPACE = ( 32. ) * CTLS = ( 0.-31., 127.) * quoted-string = <"> *(qtext/quoted-pair) <"> * qtext = , "\" and CR> * CR = ( 13. ) * quoted-pair = "\" CHAR * domain = sub-domain *("." sub-domain) * sub-domain = domain-ref / domain-literal * domain-ref = atom * domain-literal = "[" *(dtext / quoted-pair) "]" */ unsigned int l, i; if (!msgid || !*msgid) return -1; l = safe_strlen (msgid); if (l < 5) /* */ return -1; if (msgid[0] != '<' || msgid[l-1] != '>') return -1; if (!(strrchr (msgid, '@'))) return -1; /* TODO: complete parser */ for (i = 0; i < l; i++) if ((unsigned char)msgid[i] > 127) return -1; return 0; } #ifdef TESTING int safe_free (void **p) /* __SAFE_FREE_CHECKED__ */ { free(*p); /* __MEM_CHECKED__ */ *p = 0; } int main (int argc, char **argv) { ADDRESS *list; char buf[256]; # if 0 char *str = "michael, Michael Elkins , testing a really complex address: this example <@contains.a.source.route,@with.multiple.hosts:address@example.com>;, lothar@of.the.hillpeople (lothar)"; # else char *str = "a b c "; # endif list = rfc822_parse_adrlist (NULL, str); buf[0] = 0; rfc822_write_address (buf, sizeof (buf), list); rfc822_free_address (&list); puts (buf); exit (0); } #endif lbdb-0.54/rfc822.h000066400000000000000000000045411465114770000135350ustar00rootroot00000000000000/* * Copyright (C) 1996-2000 Michael R. Elkins * Copyright (C) 2012 Michael R. Elkins * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef rfc822_h #define rfc822_h #include /* possible values for RFC822Error */ enum { ERR_MEMORY = 1, ERR_MISMATCH_PAREN, ERR_MISMATCH_QUOTE, ERR_BAD_ROUTE, ERR_BAD_ROUTE_ADDR, ERR_BAD_ADDR_SPEC, ERR_BAD_LITERAL }; typedef struct address_t { #ifdef EXACT_ADDRESS char *val; /* value of address as parsed */ #endif char *personal; /* real name of address */ char *mailbox; /* mailbox and host address */ int group; /* group mailbox? */ struct address_t *next; unsigned is_intl : 1; unsigned intl_checked : 1; } ADDRESS; void rfc822_dequote_comment (char *s); void rfc822_free_address (ADDRESS **); void rfc822_qualify (ADDRESS *, const char *); ADDRESS *rfc822_parse_adrlist (ADDRESS *, const char *s); ADDRESS *rfc822_cpy_adr (ADDRESS *addr, int); ADDRESS *rfc822_cpy_adr_real (ADDRESS *addr); ADDRESS *rfc822_append (ADDRESS **a, ADDRESS *b, int); int rfc822_write_address (char *, size_t, ADDRESS *, int); void rfc822_write_address_single (char *, size_t, ADDRESS *, int); void rfc822_free_address (ADDRESS **addr); void rfc822_cat (char *, size_t, const char *, const char *); int rfc822_valid_msgid (const char *msgid); int rfc822_remove_from_adrlist (ADDRESS **a, const char *mailbox); const char *rfc822_parse_comment (const char *, char *, size_t *, size_t); extern int RFC822Error; extern const char * const RFC822Errors[]; #define rfc822_error(x) RFC822Errors[x] #define rfc822_new_address() safe_calloc(1,sizeof(ADDRESS)) #endif /* rfc822_h */ lbdb-0.54/tac.awk.in000066400000000000000000000017351465114770000142400ustar00rootroot00000000000000#! @AWK@ -f # # -*-awk-*- # # Copyright (C) 2000-2018 Roland Rosenfeld # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. # # Output file in reverse order BEGIN { i = 0; } { line[i++] = $0; } END { for (i-- ; i>=0; i--) { print line[i]; } } lbdb-0.54/tests/000077500000000000000000000000001465114770000135145ustar00rootroot00000000000000lbdb-0.54/tests/Makefile.in000066400000000000000000000040471465114770000155660ustar00rootroot00000000000000# Copyright (C) 2018-2024 Roland Rosenfeld # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. srcdir = @srcdir@ top_srcdir = @top_srcdir@ abs_top_srcdir = @abs_top_srcdir@ AUTOM4TE = @AUTOM4TE@ TESTSUITE_AT = m_muttalias.at m_abook.at m_inmail.at m_vcf.at EXTRA_DIST = testsuite.at testsuite $(TESTSUITE_AT) TESTSUITE = $(srcdir)/testsuite $(srcdir)/package.m4: $(top_srcdir)/configure.ac { \ echo '# Signature of the current package.'; \ echo 'm4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])'; \ echo 'm4_define([AT_PACKAGE_TARNAME], [@PACKAGE_TARNAME@])'; \ echo 'm4_define([AT_PACKAGE_VERSION], [@PACKAGE_VERSION@])'; \ echo 'm4_define([AT_PACKAGE_STRING], [@PACKAGE_STRING@])'; \ echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \ } >$(srcdir)/package.m4 # use just build lbdbq binary: check-local: atconfig atlocal $(TESTSUITE) $(SHELL) $(TESTSUITE) AUTOTEST_PATH=$(abs_top_srcdir) \ USE_LOCAL_LIB=$(abs_top_srcdir) # use installed lbdbq binary: installcheck-local: atconfig atlocal $(TESTSUITE) $(SHELL) $(TESTSUITE) AUTOTEST = $(AUTOM4TE) --language=autotest $(TESTSUITE): $(srcdir)/testsuite.at $(srcdir)/package.m4 $(TESTSUITE_AT) $(AUTOTEST) -I $(srcdir) $@.at -o $@.tmp mv $@.tmp $@ clean: -rm -f *~ testsuite.log -rm -rf testsuite.dir distclean: -rm -f atlocal atconfig Makefile lbdb-0.54/tests/atlocal.in000066400000000000000000000021401465114770000154600ustar00rootroot00000000000000# Copyright (C) 2018-2024 Roland Rosenfeld # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. # @configure_input@ # use atlocal.in to pass variables from configure, by AC_SUBST, # to the testsuite. if test "x@abs_top_builddir@" = "x@abs_top_srcdir@"; then PATH=@abs_top_builddir@/src:$PATH else PATH=@abs_top_builddir@/src:@abs_top_srcdir@/src:$PATH fi PACKAGE_VERSION="@PACKAGE_VERSION@" lbdb-0.54/tests/data/000077500000000000000000000000001465114770000144255ustar00rootroot00000000000000lbdb-0.54/tests/data/abook.addressbook000066400000000000000000000005601465114770000177430ustar00rootroot00000000000000# abook addressbook file [format] program=abook version=0.6.1 [0] name=First1 Family1 email=foo1@example.com,foo1@example.net address=Street 1 city=Village state=AA zip=12345 country=Germany phone=+49-2345-6789 workphone=+49-2345-7890 fax=+49-2345-5790 mobile=+49-170-12345678 nick=nick1 url=https://www.example.com [1] name=First2 Family2 email=foo2@example.com lbdb-0.54/tests/data/example.vcf000066400000000000000000000016321465114770000165620ustar00rootroot00000000000000BEGIN:VCARD VERSION:3.0 FN:Max Mustermann NICKNAME:MaxiNick ORG:Beispiel GmbH TEL;TYPE=WORK,VOICE:+49 123 456789 ADR;TYPE=WORK:;;Musterstraße 1;Köln;Nordrhein-Westfalen;50667;Deutschland EMAIL:max.mustermann@example.com END:VCARD BEGIN:VCARD VERSION:3.0 FN: EMAIL:b@example.com END:VCARD BEGIN:VCARD VERSION:3.0 FN:Erika Musterfrau ORG:Beispiel AG TEL;TYPE=WORK,VOICE:+49 987 654321 ADR;TYPE=HOME:;;Musterweg 2;Köln;Nordrhein-Westfalen;50668;Deutschland EMAIL;TYPE=WORK:erika.musterfrau@example.com EMAIL;TYPE=HOME:erika.home@example.com END:VCARD BEGIN:VCARD VERSION:3.0 FN:Nomail Musterfrau ORG:Beispiel AG TEL;TYPE=WORK,VOICE:+49 987 654321 ADR;TYPE=HOME:;;Musterweg 2;Köln;Nordrhein-Westfalen;50668;Deutschland END:VCARD BEGIN:VCARD VERSION:3.0 N:Family;Given;Additional;HonPrefix;HonSuffix EMAIL;TYPE=HOME:complexname@example.com END:VCARD BEGIN:VCARD VERSION:3.0 EMAIL;TYPE=HOME:norealname@example.com END:VCARD lbdb-0.54/tests/data/m_abook.expected000066400000000000000000000001351465114770000175560ustar00rootroot00000000000000lbdbq: 2 matches foo1@example.com First1 Family1 abook foo1@example.net First1 Family1 abook lbdb-0.54/tests/data/m_inmail.example000066400000000000000000000005171465114770000175720ustar00rootroot00000000000000foo@example.com Bb2 Bb2 2022-01-05 12:00 bar@example.com "Ee5 Ee5" 2022-01-01 12:00 baz@example.com Aa1 Aa1 2022-01-04 12:00 fofo@example.com Dd4 Dd4 2022-01-02 12:00 baba@example.com Cc3 Cc3 2022-01-03 12:00 bzbz@example.com "Ff6 Ff6" 2022-01-06 12:00 baz@example.com Ac1 Ac1 2022-01-07 12:00 baz@example.com Ab1 Ab1 2022-01-08 12:00 lbdb-0.54/tests/data/m_inmail.sortaddress.expected000066400000000000000000000004161465114770000222720ustar00rootroot00000000000000lbdbq: 6 matches baba@example.com Cc3 Cc3 2022-01-03 12:00 bar@example.com "Ee5 Ee5" 2022-01-01 12:00 baz@example.com Ab1 Ab1 2022-01-08 12:00 bzbz@example.com "Ff6 Ff6" 2022-01-06 12:00 fofo@example.com Dd4 Dd4 2022-01-02 12:00 foo@example.com Bb2 Bb2 2022-01-05 12:00 lbdb-0.54/tests/data/m_inmail.sortcomment.expected000066400000000000000000000004161465114770000223070ustar00rootroot00000000000000lbdbq: 6 matches bar@example.com "Ee5 Ee5" 2022-01-01 12:00 fofo@example.com Dd4 Dd4 2022-01-02 12:00 baba@example.com Cc3 Cc3 2022-01-03 12:00 foo@example.com Bb2 Bb2 2022-01-05 12:00 bzbz@example.com "Ff6 Ff6" 2022-01-06 12:00 baz@example.com Ab1 Ab1 2022-01-08 12:00 lbdb-0.54/tests/data/m_inmail.sortname.expected000066400000000000000000000004161465114770000215650ustar00rootroot00000000000000lbdbq: 6 matches baz@example.com Ab1 Ab1 2022-01-08 12:00 foo@example.com Bb2 Bb2 2022-01-05 12:00 baba@example.com Cc3 Cc3 2022-01-03 12:00 fofo@example.com Dd4 Dd4 2022-01-02 12:00 bar@example.com "Ee5 Ee5" 2022-01-01 12:00 bzbz@example.com "Ff6 Ff6" 2022-01-06 12:00 lbdb-0.54/tests/data/m_inmail.sortreverse_comment.expected000066400000000000000000000004161465114770000240420ustar00rootroot00000000000000lbdbq: 6 matches baz@example.com Ab1 Ab1 2022-01-08 12:00 bzbz@example.com "Ff6 Ff6" 2022-01-06 12:00 foo@example.com Bb2 Bb2 2022-01-05 12:00 baba@example.com Cc3 Cc3 2022-01-03 12:00 fofo@example.com Dd4 Dd4 2022-01-02 12:00 bar@example.com "Ee5 Ee5" 2022-01-01 12:00 lbdb-0.54/tests/data/m_inmail.utf8.expected1000066400000000000000000000004411465114770000207020ustar00rootroot00000000000000foo2@example.com Günther Family2 NO DATE foo1@example.com Günther Family1 NO DATE foo3@example.com First3 Family3 NO DATE foo4@example.com First4 Family4 NO DATE foo5@example.com "First5 Family5" NO DATE foo6@example.com "First6 Family6" NO DATE foo9@example.com First9 Günther NO DATE lbdb-0.54/tests/data/m_inmail.utf8.expected2000066400000000000000000000001451465114770000207040ustar00rootroot00000000000000lbdbq: 2 matches foo1@example.com Günther Family1 NO DATE foo2@example.com Günther Family2 NO DATE lbdb-0.54/tests/data/m_muttalias.expected000066400000000000000000000010421465114770000204640ustar00rootroot00000000000000lbdbq: 12 matches foo1@example.com First1 Family1 alias test1 foo2@example.com First2 Family2 alias test2 foo3@example.com First3 Family3 alias test3 foo4@example.com First4 Family4 alias test4 foo5@example.com First5 Family5 alias test5 foo6@example.com First6 Family6 alias test6 foo7@example.com First7 Family7 alias test7 foo8@example.com First8 Family8 alias test8 foo9@example.com First9 Family9 alias test9 fooA@example.com FirstA FamilyA alias testA fooB@example.com FirstB FamilyB alias testB fooC@example.com FirstC FamilyC alias testC lbdb-0.54/tests/data/m_vcf.expected000066400000000000000000000002431465114770000172410ustar00rootroot00000000000000lbdbq: 3 matches erika.home@example.com Erika Musterfrau (VCF) erika.musterfrau@example.com Erika Musterfrau (VCF) max.mustermann@example.com Max Mustermann (VCF) lbdb-0.54/tests/data/m_vcf.expected.namecomponents000066400000000000000000000001331465114770000222640ustar00rootroot00000000000000lbdbq: 1 matches complexname@example.com HonPrefix Given Additional Family HonSuffix (VCF) lbdb-0.54/tests/data/m_vcf.expected.nickname000066400000000000000000000001011465114770000210160ustar00rootroot00000000000000lbdbq: 1 matches max.mustermann@example.com Max Mustermann (VCF) lbdb-0.54/tests/data/m_vcf.expected.norealname000066400000000000000000000000601465114770000213560ustar00rootroot00000000000000lbdbq: 1 matches norealname@example.com (VCF) lbdb-0.54/tests/data/muttaliasfile000066400000000000000000000014531465114770000172160ustar00rootroot00000000000000# Some mutt aliases, that should partly be parsed by m_muttalias. # first with spaces: alias test1 First1 Family1 alias test2 foo2@example.com (First2 Family2) alias test3 (First3 Family3) alias test4 "First4 Family4" alias test5 foo5@example.com ("First5 Family5") alias test6 ("First6 Family6") # second with tabs: alias test7 First7 Family7 alias test8 foo8@example.com (First8 Family8) alias test9 (First9 Family9) alias testA "FirstA FamilyA" alias testB fooB@example.com ("FirstB FamilyB") alias testC ("FirstC FamilyC") # some other stuff, that should be ignored: alias group test1, test2, test3, test4 alias NoTST FirstZ FamilyZ lbdb-0.54/tests/data/testmail1000066400000000000000000000014431465114770000162550ustar00rootroot00000000000000Return-Path: X-Original-To: foobar@host.example.com Delivered-To: foobar@host.example.com From: =?iso-8859-1?Q?G=FCnther?= Family1 To: foo2@example.com (=?UTF-8?Q?G=C3=BCnther?= Family2) Cc: (First3 Family3) Resent-From: "First4 Family4" Resent-To: foo5@example.com ("First5 Family5") X-Header1: ("First6 Family6") X-Header2: X-Header3: foo8@example.com X-Header4: foo9@example.com (First9 =?UTF-8?Q?G=C3=BCnther?=) Subject: lorem ipsum Message-ID: <1234567890@example.com> References: <0987654321@example.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: lbdb-0.54/tests/m_abook.at000066400000000000000000000020721465114770000154520ustar00rootroot00000000000000dnl Copyright (c) 2018 Roland Rosenfeld dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software Foundation, dnl Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. AT_BANNER([Test m_abook]) AT_SETUP(m_abook) AT_SKIP_IF([! which abook]) AT_CHECK([cat $abs_srcdir/data/m_abook.expected > expout]) AT_CHECK([env LBDB_OVERRIDE_METHODS=m_abook \ OVERRIDE_ABOOK_FILES=$abs_srcdir/data/abook.addressbook \ lbdbq First1], [], [expout]) AT_CLEANUP lbdb-0.54/tests/m_inmail.at000066400000000000000000000066541465114770000156420ustar00rootroot00000000000000dnl Copyright (c) 2022 Roland Rosenfeld dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software Foundation, dnl Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. AT_BANNER([Test m_inmail/fetchmail]) AT_SETUP(lbdb-fetchmail) AT_CHECK([cat $abs_srcdir/data/m_inmail.utf8.expected1 > expout]) AT_CHECK([cat $abs_srcdir/data/testmail1 > testmail1]) AT_CHECK([lbdb-fetchaddr -f m_inmail.utf8 -d "NO DATE" < testmail1 && \ lbdb-fetchaddr -f m_inmail.utf8 -d "NO DATE" \ -x x-header1:x-header2:x-header3:x-header4 < testmail1 && \ cat m_inmail.utf8], [], [expout]) AT_CLEANUP AT_SETUP(m_inmail) AT_CHECK([cat $abs_srcdir/data/m_inmail.utf8.expected2 > expout]) AT_CHECK([cat $abs_srcdir/data/testmail1 > testmail1]) AT_CHECK([lbdb-fetchaddr -f m_inmail.utf8 -d "NO DATE" < testmail1 && \ lbdb-fetchaddr -f m_inmail.utf8 -d "NO DATE" < testmail1]) AT_CHECK([env LBDB_OVERRIDE_METHODS=m_inmail \ OVERRIDE_M_INMAIL_DB=m_inmail.utf8 \ OVERRIDE_LIMITDATE="0000-00-00_00:00" \ OVERRIDE_LIMITCOUNT=0 \ OVERRIDE_SORT_OUTPUT=no \ lbdbq Günther], [], [expout]) AT_CLEANUP AT_SETUP(m_inmail SORT=address) AT_CHECK([cat $abs_srcdir/data/m_inmail.example > m_inmail.utf-8]) AT_CHECK([cat $abs_srcdir/data/m_inmail.sortaddress.expected > expout]) AT_CHECK([env LBDB_OVERRIDE_METHODS=m_inmail \ OVERRIDE_M_INMAIL_DB=m_inmail.utf-8 \ OVERRIDE_LIMITDATE="0000-00-00_00:00" \ OVERRIDE_LIMITCOUNT=0 \ OVERRIDE_SORT_OUTPUT=address \ lbdbq example.com], [], [expout]) AT_CLEANUP AT_SETUP(m_inmail SORT=name) AT_CHECK([cat $abs_srcdir/data/m_inmail.example > m_inmail.utf-8]) AT_CHECK([cat $abs_srcdir/data/m_inmail.sortname.expected > expout]) AT_CHECK([env LBDB_OVERRIDE_METHODS=m_inmail \ OVERRIDE_M_INMAIL_DB=m_inmail.utf-8 \ OVERRIDE_LIMITDATE="0000-00-00_00:00" \ OVERRIDE_LIMITCOUNT=0 \ OVERRIDE_SORT_OUTPUT=name \ lbdbq example.com], [], [expout]) AT_CLEANUP AT_SETUP(m_inmail SORT=comment) AT_CHECK([cat $abs_srcdir/data/m_inmail.example > m_inmail.utf-8]) AT_CHECK([cat $abs_srcdir/data/m_inmail.sortcomment.expected > expout]) AT_CHECK([env LBDB_OVERRIDE_METHODS=m_inmail \ OVERRIDE_M_INMAIL_DB=m_inmail.utf-8 \ OVERRIDE_LIMITDATE="0000-00-00_00:00" \ OVERRIDE_LIMITCOUNT=0 \ OVERRIDE_SORT_OUTPUT=comment \ lbdbq example.com], [], [expout]) AT_CLEANUP AT_SETUP(m_inmail SORT=reverse_comment) AT_CHECK([cat $abs_srcdir/data/m_inmail.example > m_inmail.utf-8]) AT_CHECK([cat $abs_srcdir/data/m_inmail.sortreverse_comment.expected > expout]) AT_CHECK([env LBDB_OVERRIDE_METHODS=m_inmail \ OVERRIDE_M_INMAIL_DB=m_inmail.utf-8 \ OVERRIDE_LIMITDATE="0000-00-00_00:00" \ OVERRIDE_LIMITCOUNT=0 \ OVERRIDE_SORT_OUTPUT=reverse_comment \ lbdbq example.com], [], [expout]) AT_CLEANUP lbdb-0.54/tests/m_muttalias.at000066400000000000000000000020541465114770000163620ustar00rootroot00000000000000dnl Copyright (c) 2018 Roland Rosenfeld dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software Foundation, dnl Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. AT_BANNER([Test m_muttalias]) AT_SETUP(m_muttalias) AT_CHECK([cat $abs_srcdir/data/m_muttalias.expected > expout]) AT_CHECK([env LBDB_OVERRIDE_METHODS=m_muttalias \ OVERRIDE_MUTTALIAS_FILES=$abs_srcdir/data/muttaliasfile \ lbdbq test], [], [expout]) AT_CLEANUP lbdb-0.54/tests/m_vcf.at000066400000000000000000000043731465114770000151430ustar00rootroot00000000000000dnl Copyright (c) 2024 Roland Rosenfeld dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software Foundation, dnl Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. AT_BANNER([Test m_vcf]) AT_SETUP(m_vcf) AT_CHECK([cat $abs_srcdir/data/m_vcf.expected > expout]) AT_CHECK([cat $abs_srcdir/data/example.vcf > example.vcf]) AT_CHECK([env LBDB_OVERRIDE_METHODS=m_vcf \ OVERRIDE_VCF_FILES=example.vcf \ lbdbq muster], [], [expout]) AT_CLEANUP AT_SETUP(m_vcf nickname) AT_CHECK([cat $abs_srcdir/data/m_vcf.expected.nickname > expout]) AT_CHECK([cat $abs_srcdir/data/example.vcf > example.vcf]) AT_CHECK([env LBDB_OVERRIDE_METHODS=m_vcf \ OVERRIDE_VCF_FILES=example.vcf \ lbdbq maxinick], [], [expout]) AT_CLEANUP AT_SETUP(m_vcf name components) AT_CHECK([cat $abs_srcdir/data/m_vcf.expected.namecomponents > expout]) AT_CHECK([cat $abs_srcdir/data/example.vcf > example.vcf]) AT_CHECK([env LBDB_OVERRIDE_METHODS=m_vcf \ OVERRIDE_VCF_FILES=example.vcf \ lbdbq complexname], [], [expout]) AT_CLEANUP AT_SETUP(m_vcf no realname) AT_CHECK([cat $abs_srcdir/data/m_vcf.expected.norealname > expout]) AT_CHECK([cat $abs_srcdir/data/example.vcf > example.vcf]) AT_CHECK([env LBDB_OVERRIDE_METHODS=m_vcf \ OVERRIDE_VCF_FILES=example.vcf \ lbdbq norealname], [], [expout]) AT_CLEANUP AT_SETUP(m_vcf crlf lineending) AT_CHECK([cat $abs_srcdir/data/m_vcf.expected > expout]) AT_CHECK([sed 's/$/\r/' < $abs_srcdir/data/example.vcf > example.vcf]) AT_CHECK([env LBDB_OVERRIDE_METHODS=m_vcf \ OVERRIDE_VCF_FILES=example.vcf \ lbdbq muster], [], [expout]) AT_CLEANUP lbdb-0.54/tests/package.m4000066400000000000000000000004061465114770000153510ustar00rootroot00000000000000# Signature of the current package. m4_define([AT_PACKAGE_NAME], [lbdb]) m4_define([AT_PACKAGE_TARNAME], [lbdb]) m4_define([AT_PACKAGE_VERSION], [0.54]) m4_define([AT_PACKAGE_STRING], [lbdb 0.54]) m4_define([AT_PACKAGE_BUGREPORT], [roland@spinnaker.de]) lbdb-0.54/tests/testsuite000077500000000000000000002477661465114770000155210ustar00rootroot00000000000000#! /bin/sh # Generated from testsuite.at by GNU Autoconf 2.71. # # Copyright (C) 2009-2017, 2020-2021 Free Software Foundation, Inc. # # This test suite is free software; the Free Software Foundation gives # unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="as_nop=: if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else \$as_nop case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ) then : else \$as_nop exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 blah=\$(echo \$(echo blah)) test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null then : as_have_required=yes else $as_nop as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$as_shell as_have_required=yes if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null then : break 2 fi fi done;; esac as_found=false done IFS=$as_save_IFS if $as_found then : else $as_nop if { test -f "$SHELL" || test -f "$SHELL.exe"; } && as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes fi fi if test "x$CONFIG_SHELL" != x then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno then : printf "%s\n" "$0: This script requires a shell more modern than all" printf "%s\n" "$0: the shells that I found on your system." if test ${ZSH_VERSION+y} ; then printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else printf "%s\n" "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_nop # --------- # Do nothing but, unlike ":", preserve the value of $?. as_fn_nop () { return $? } as_nop=as_fn_nop # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else $as_nop as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null then : eval 'as_fn_arith () { as_val=$(( $* )) }' else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} # How were we run? at_cli_args="$@" # Not all shells have the 'times' builtin; the subshell is needed to make # sure we discard the 'times: not found' message from the shell. at_times_p=false (times) >/dev/null 2>&1 && at_times_p=: # CLI Arguments to pass to the debugging scripts. at_debug_args= # -e sets to true at_errexit_p=false # Shall we be verbose? ':' means no, empty means yes. at_verbose=: at_quiet= # Running several jobs in parallel, 0 means as many as test groups. at_jobs=1 at_traceon=: at_trace_echo=: at_check_filter_trace=: # Shall we keep the debug scripts? Must be `:' when the suite is # run by a debug script, so that the script doesn't remove itself. at_debug_p=false # Display help message? at_help_p=false # Display the version message? at_version_p=false # List test groups? at_list_p=false # --clean at_clean=false # Test groups to run at_groups= # Whether to rerun failed tests. at_recheck= # Whether a write failure occurred at_write_fail=0 # The directory we run the suite in. Default to . if no -C option. at_dir=`pwd` # An absolute reference to this testsuite script. case $as_myself in [\\/]* | ?:[\\/]* ) at_myself=$as_myself ;; * ) at_myself=$at_dir/$as_myself ;; esac # Whether -C is in effect. at_change_dir=false # Whether to enable colored test results. at_color=auto # As many question marks as there are digits in the last test group number. # Used to normalize the test group numbers so that `ls' lists them in # numerical order. at_format='??' # Description of all the test groups. at_help_all="1;m_muttalias.at:19;m_muttalias;; 2;m_abook.at:19;m_abook;; 3;m_inmail.at:19;lbdb-fetchmail;; 4;m_inmail.at:28;m_inmail;; 5;m_inmail.at:41;m_inmail SORT=address;; 6;m_inmail.at:52;m_inmail SORT=name;; 7;m_inmail.at:63;m_inmail SORT=comment;; 8;m_inmail.at:75;m_inmail SORT=reverse_comment;; 9;m_vcf.at:19;m_vcf;; 10;m_vcf.at:27;m_vcf nickname;; 11;m_vcf.at:35;m_vcf name components;; 12;m_vcf.at:43;m_vcf no realname;; 13;m_vcf.at:51;m_vcf crlf lineending;; " # List of the all the test groups. at_groups_all=`printf "%s\n" "$at_help_all" | sed 's/;.*//'` # at_fn_validate_ranges NAME... # ----------------------------- # Validate and normalize the test group number contained in each variable # NAME. Leading zeroes are treated as decimal. at_fn_validate_ranges () { for at_grp do eval at_value=\$$at_grp if test $at_value -lt 1 || test $at_value -gt 13; then printf "%s\n" "invalid test group: $at_value" >&2 exit 1 fi case $at_value in 0*) # We want to treat leading 0 as decimal, like expr and test, but # AS_VAR_ARITH treats it as octal if it uses $(( )). # With XSI shells, ${at_value#${at_value%%[1-9]*}} avoids the # expr fork, but it is not worth the effort to determine if the # shell supports XSI when the user can just avoid leading 0. eval $at_grp='`expr $at_value + 0`' ;; esac done } # List of the tested programs. at_tested='"lbdbq"' at_prev= for at_option do # If the previous option needs an argument, assign it. if test -n "$at_prev"; then at_option=$at_prev=$at_option at_prev= fi case $at_option in *=?*) at_optarg=`expr "X$at_option" : '[^=]*=\(.*\)'` ;; *) at_optarg= ;; esac case $at_option in --help | -h ) at_help_p=: ;; --list | -l ) at_list_p=: ;; --version | -V ) at_version_p=: ;; --clean | -c ) at_clean=: ;; --color ) at_color=always ;; --color=* ) case $at_optarg in no | never | none) at_color=never ;; auto | tty | if-tty) at_color=auto ;; always | yes | force) at_color=always ;; *) at_optname=`echo " $at_option" | sed 's/^ //; s/=.*//'` as_fn_error $? "unrecognized argument to $at_optname: $at_optarg" ;; esac ;; --debug | -d ) at_debug_p=: ;; --errexit | -e ) at_debug_p=: at_errexit_p=: ;; --verbose | -v ) at_verbose=; at_quiet=: ;; --trace | -x ) at_traceon='set -x' at_trace_echo=echo at_check_filter_trace=at_fn_filter_trace ;; [0-9] | [0-9][0-9] | [0-9][0-9][0-9] | [0-9][0-9][0-9][0-9]) at_fn_validate_ranges at_option as_fn_append at_groups "$at_option$as_nl" ;; # Ranges [0-9]- | [0-9][0-9]- | [0-9][0-9][0-9]- | [0-9][0-9][0-9][0-9]-) at_range_start=`echo $at_option |tr -d X-` at_fn_validate_ranges at_range_start at_range=`printf "%s\n" "$at_groups_all" | \ sed -ne '/^'$at_range_start'$/,$p'` as_fn_append at_groups "$at_range$as_nl" ;; -[0-9] | -[0-9][0-9] | -[0-9][0-9][0-9] | -[0-9][0-9][0-9][0-9]) at_range_end=`echo $at_option |tr -d X-` at_fn_validate_ranges at_range_end at_range=`printf "%s\n" "$at_groups_all" | \ sed -ne '1,/^'$at_range_end'$/p'` as_fn_append at_groups "$at_range$as_nl" ;; [0-9]-[0-9] | [0-9]-[0-9][0-9] | [0-9]-[0-9][0-9][0-9] | \ [0-9]-[0-9][0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9] | \ [0-9][0-9]-[0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9][0-9][0-9] | \ [0-9][0-9][0-9]-[0-9][0-9][0-9] | \ [0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] | \ [0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] ) at_range_start=`expr $at_option : '\(.*\)-'` at_range_end=`expr $at_option : '.*-\(.*\)'` if test $at_range_start -gt $at_range_end; then at_tmp=$at_range_end at_range_end=$at_range_start at_range_start=$at_tmp fi at_fn_validate_ranges at_range_start at_range_end at_range=`printf "%s\n" "$at_groups_all" | \ sed -ne '/^'$at_range_start'$/,/^'$at_range_end'$/p'` as_fn_append at_groups "$at_range$as_nl" ;; # Directory selection. --directory | -C ) at_prev=--directory ;; --directory=* ) at_change_dir=: at_dir=$at_optarg if test x- = "x$at_dir" ; then at_dir=./- fi ;; # Parallel execution. --jobs | -j ) at_jobs=0 ;; --jobs=* | -j[0-9]* ) if test -n "$at_optarg"; then at_jobs=$at_optarg else at_jobs=`expr X$at_option : 'X-j\(.*\)'` fi case $at_jobs in *[!0-9]*) at_optname=`echo " $at_option" | sed 's/^ //; s/[0-9=].*//'` as_fn_error $? "non-numeric argument to $at_optname: $at_jobs" ;; esac ;; # Keywords. --keywords | -k ) at_prev=--keywords ;; --keywords=* ) at_groups_selected=$at_help_all at_save_IFS=$IFS IFS=, set X $at_optarg shift IFS=$at_save_IFS for at_keyword do at_invert= case $at_keyword in '!'*) at_invert="-v" at_keyword=`expr "X$at_keyword" : 'X!\(.*\)'` ;; esac # It is on purpose that we match the test group titles too. at_groups_selected=`printf "%s\n" "$at_groups_selected" | grep -i $at_invert "^[1-9][^;]*;.*[; ]$at_keyword[ ;]"` done # Smash the keywords. at_groups_selected=`printf "%s\n" "$at_groups_selected" | sed 's/;.*//'` as_fn_append at_groups "$at_groups_selected$as_nl" ;; --recheck) at_recheck=: ;; *=*) at_envvar=`expr "x$at_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $at_envvar in '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$at_envvar'" ;; esac at_value=`printf "%s\n" "$at_optarg" | sed "s/'/'\\\\\\\\''/g"` # Export now, but save eval for later and for debug scripts. export $at_envvar as_fn_append at_debug_args " $at_envvar='$at_value'" ;; *) printf "%s\n" "$as_me: invalid option: $at_option" >&2 printf "%s\n" "Try \`$0 --help' for more information." >&2 exit 1 ;; esac done # Verify our last option didn't require an argument if test -n "$at_prev" then : as_fn_error $? "\`$at_prev' requires an argument" fi # The file containing the suite. at_suite_log=$at_dir/$as_me.log # Selected test groups. if test -z "$at_groups$at_recheck"; then at_groups=$at_groups_all else if test -n "$at_recheck" && test -r "$at_suite_log"; then at_oldfails=`sed -n ' /^Failed tests:$/,/^Skipped tests:$/{ s/^[ ]*\([1-9][0-9]*\):.*/\1/p } /^Unexpected passes:$/,/^## Detailed failed tests/{ s/^[ ]*\([1-9][0-9]*\):.*/\1/p } /^## Detailed failed tests/q ' "$at_suite_log"` as_fn_append at_groups "$at_oldfails$as_nl" fi # Sort the tests, removing duplicates. at_groups=`printf "%s\n" "$at_groups" | sort -nu | sed '/^$/d'` fi if test x"$at_color" = xalways \ || { test x"$at_color" = xauto && test -t 1; }; then at_red=`printf '\033[0;31m'` at_grn=`printf '\033[0;32m'` at_lgn=`printf '\033[1;32m'` at_blu=`printf '\033[1;34m'` at_std=`printf '\033[m'` else at_red= at_grn= at_lgn= at_blu= at_std= fi # Help message. if $at_help_p; then cat <<_ATEOF || at_write_fail=1 Usage: $0 [OPTION]... [VARIABLE=VALUE]... [TESTS] Run all the tests, or the selected TESTS, given by numeric ranges, and save a detailed log file. Upon failure, create debugging scripts. Do not change environment variables directly. Instead, set them via command line arguments. Set \`AUTOTEST_PATH' to select the executables to exercise. Each relative directory is expanded as build and source directories relative to the top level of this distribution. E.g., from within the build directory /tmp/foo-1.0, invoking this: $ $0 AUTOTEST_PATH=bin is equivalent to the following, assuming the source directory is /src/foo-1.0: PATH=/tmp/foo-1.0/bin:/src/foo-1.0/bin:\$PATH $0 _ATEOF cat <<_ATEOF || at_write_fail=1 Operation modes: -h, --help print the help message, then exit -V, --version print version number, then exit -c, --clean remove all the files this test suite might create and exit -l, --list describes all the tests, or the selected TESTS _ATEOF cat <<_ATEOF || at_write_fail=1 Execution tuning: -C, --directory=DIR change to directory DIR before starting --color[=never|auto|always] disable colored test results, or enable even without terminal -j, --jobs[=N] Allow N jobs at once; infinite jobs with no arg (default 1) -k, --keywords=KEYWORDS select the tests matching all the comma-separated KEYWORDS multiple \`-k' accumulate; prefixed \`!' negates a KEYWORD --recheck select all tests that failed or passed unexpectedly last time -e, --errexit abort as soon as a test fails; implies --debug -v, --verbose force more detailed output default for debugging scripts -d, --debug inhibit clean up and top-level logging default for debugging scripts -x, --trace enable tests shell tracing _ATEOF cat <<_ATEOF || at_write_fail=1 Report bugs to . _ATEOF exit $at_write_fail fi # List of tests. if $at_list_p; then cat <<_ATEOF || at_write_fail=1 lbdb 0.54 test suite test groups: NUM: FILE-NAME:LINE TEST-GROUP-NAME KEYWORDS _ATEOF # Pass an empty line as separator between selected groups and help. printf "%s\n" "$at_groups$as_nl$as_nl$at_help_all" | awk 'NF == 1 && FS != ";" { selected[$ 1] = 1 next } /^$/ { FS = ";" } NF > 0 { if (selected[$ 1]) { printf " %3d: %-18s %s\n", $ 1, $ 2, $ 3 if ($ 4) { lmax = 79 indent = " " line = indent len = length (line) n = split ($ 4, a, " ") for (i = 1; i <= n; i++) { l = length (a[i]) + 1 if (i > 1 && len + l > lmax) { print line line = indent " " a[i] len = length (line) } else { line = line " " a[i] len += l } } if (n) print line } } }' || at_write_fail=1 exit $at_write_fail fi if $at_version_p; then printf "%s\n" "$as_me (lbdb 0.54)" && cat <<\_ATEOF || at_write_fail=1 Copyright (C) 2021 Free Software Foundation, Inc. This test suite is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ATEOF exit $at_write_fail fi # Should we print banners? Yes if more than one test is run. case $at_groups in #( *$as_nl* ) at_print_banners=: ;; #( * ) at_print_banners=false ;; esac # Text for banner N, set to a single space once printed. # Banner 1. m_muttalias.at:17 # Category starts at test group 1. at_banner_text_1="Test m_muttalias" # Banner 2. m_abook.at:17 # Category starts at test group 2. at_banner_text_2="Test m_abook" # Banner 3. m_inmail.at:17 # Category starts at test group 3. at_banner_text_3="Test m_inmail/fetchmail" # Banner 4. m_vcf.at:17 # Category starts at test group 9. at_banner_text_4="Test m_vcf" # Take any -C into account. if $at_change_dir ; then test x != "x$at_dir" && cd "$at_dir" \ || as_fn_error $? "unable to change directory" at_dir=`pwd` fi # Load the config files for any default variable assignments. for at_file in atconfig atlocal do test -r $at_file || continue . ./$at_file || as_fn_error $? "invalid content: $at_file" done # Autoconf <=2.59b set at_top_builddir instead of at_top_build_prefix: : "${at_top_build_prefix=$at_top_builddir}" # Perform any assignments requested during argument parsing. eval "$at_debug_args" # atconfig delivers names relative to the directory the test suite is # in, but the groups themselves are run in testsuite-dir/group-dir. if test -n "$at_top_srcdir"; then builddir=../.. for at_dir_var in srcdir top_srcdir top_build_prefix do eval at_val=\$at_$at_dir_var case $at_val in [\\/$]* | ?:[\\/]* ) at_prefix= ;; *) at_prefix=../../ ;; esac eval "$at_dir_var=\$at_prefix\$at_val" done fi ## -------------------- ## ## Directory structure. ## ## -------------------- ## # This is the set of directories and files used by this script # (non-literals are capitalized): # # TESTSUITE - the testsuite # TESTSUITE.log - summarizes the complete testsuite run # TESTSUITE.dir/ - created during a run, remains after -d or failed test # + at-groups/ - during a run: status of all groups in run # | + NNN/ - during a run: meta-data about test group NNN # | | + check-line - location (source file and line) of current AT_CHECK # | | + status - exit status of current AT_CHECK # | | + stdout - stdout of current AT_CHECK # | | + stder1 - stderr, including trace # | | + stderr - stderr, with trace filtered out # | | + test-source - portion of testsuite that defines group # | | + times - timestamps for computing duration # | | + pass - created if group passed # | | + xpass - created if group xpassed # | | + fail - created if group failed # | | + xfail - created if group xfailed # | | + skip - created if group skipped # + at-stop - during a run: end the run if this file exists # + at-source-lines - during a run: cache of TESTSUITE line numbers for extraction # + 0..NNN/ - created for each group NNN, remains after -d or failed test # | + TESTSUITE.log - summarizes the group results # | + ... - files created during the group # The directory the whole suite works in. # Should be absolute to let the user `cd' at will. at_suite_dir=$at_dir/$as_me.dir # The file containing the suite ($at_dir might have changed since earlier). at_suite_log=$at_dir/$as_me.log # The directory containing helper files per test group. at_helper_dir=$at_suite_dir/at-groups # Stop file: if it exists, do not start new jobs. at_stop_file=$at_suite_dir/at-stop # The fifo used for the job dispatcher. at_job_fifo=$at_suite_dir/at-job-fifo if $at_clean; then test -d "$at_suite_dir" && find "$at_suite_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \; rm -f -r "$at_suite_dir" "$at_suite_log" exit $? fi # Don't take risks: use only absolute directories in PATH. # # For stand-alone test suites (ie. atconfig was not found), # AUTOTEST_PATH is relative to `.'. # # For embedded test suites, AUTOTEST_PATH is relative to the top level # of the package. Then expand it into build/src parts, since users # may create executables in both places. AUTOTEST_PATH=`printf "%s\n" "$AUTOTEST_PATH" | sed "s|:|$PATH_SEPARATOR|g"` at_path= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $AUTOTEST_PATH $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -n "$at_path" && as_fn_append at_path $PATH_SEPARATOR case $as_dir in [\\/]* | ?:[\\/]* ) as_fn_append at_path "$as_dir" ;; * ) if test -z "$at_top_build_prefix"; then # Stand-alone test suite. as_fn_append at_path "$as_dir" else # Embedded test suite. as_fn_append at_path "$at_top_build_prefix$as_dir$PATH_SEPARATOR" as_fn_append at_path "$at_top_srcdir/$as_dir" fi ;; esac done IFS=$as_save_IFS # Now build and simplify PATH. # # There might be directories that don't exist, but don't redirect # builtins' (eg., cd) stderr directly: Ultrix's sh hates that. at_new_path= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $at_path do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -d "$as_dir" || continue case $as_dir in [\\/]* | ?:[\\/]* ) ;; * ) as_dir=`(cd "$as_dir" && pwd) 2>/dev/null` ;; esac case $PATH_SEPARATOR$at_new_path$PATH_SEPARATOR in *$PATH_SEPARATOR$as_dir$PATH_SEPARATOR*) ;; $PATH_SEPARATOR$PATH_SEPARATOR) at_new_path=$as_dir ;; *) as_fn_append at_new_path "$PATH_SEPARATOR$as_dir" ;; esac done IFS=$as_save_IFS PATH=$at_new_path export PATH # Setting up the FDs. # 5 is the log file. Not to be overwritten if `-d'. if $at_debug_p; then at_suite_log=/dev/null else : >"$at_suite_log" fi exec 5>>"$at_suite_log" # Banners and logs. printf "%s\n" "## --------------------- ## ## lbdb 0.54 test suite. ## ## --------------------- ##" { printf "%s\n" "## --------------------- ## ## lbdb 0.54 test suite. ## ## --------------------- ##" echo printf "%s\n" "$as_me: command line was:" printf "%s\n" " \$ $0 $at_cli_args" echo # If ChangeLog exists, list a few lines in case it might help determining # the exact version. if test -n "$at_top_srcdir" && test -f "$at_top_srcdir/ChangeLog"; then printf "%s\n" "## ---------- ## ## ChangeLog. ## ## ---------- ##" echo sed 's/^/| /;10q' "$at_top_srcdir/ChangeLog" echo fi { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS } echo # Contents of the config files. for at_file in atconfig atlocal do test -r $at_file || continue printf "%s\n" "$as_me: $at_file:" sed 's/^/| /' $at_file echo done } >&5 ## ------------------------- ## ## Autotest shell functions. ## ## ------------------------- ## # at_fn_banner NUMBER # ------------------- # Output banner NUMBER, provided the testsuite is running multiple groups and # this particular banner has not yet been printed. at_fn_banner () { $at_print_banners || return 0 eval at_banner_text=\$at_banner_text_$1 test "x$at_banner_text" = "x " && return 0 eval "at_banner_text_$1=\" \"" if test -z "$at_banner_text"; then $at_first || echo else printf "%s\n" "$as_nl$at_banner_text$as_nl" fi } # at_fn_banner # at_fn_check_prepare_notrace REASON LINE # --------------------------------------- # Perform AT_CHECK preparations for the command at LINE for an untraceable # command; REASON is the reason for disabling tracing. at_fn_check_prepare_notrace () { $at_trace_echo "Not enabling shell tracing (command contains $1)" printf "%s\n" "$2" >"$at_check_line_file" at_check_trace=: at_check_filter=: : >"$at_stdout"; : >"$at_stderr" } # at_fn_check_prepare_trace LINE # ------------------------------ # Perform AT_CHECK preparations for the command at LINE for a traceable # command. at_fn_check_prepare_trace () { printf "%s\n" "$1" >"$at_check_line_file" at_check_trace=$at_traceon at_check_filter=$at_check_filter_trace : >"$at_stdout"; : >"$at_stderr" } # at_fn_check_prepare_dynamic COMMAND LINE # ---------------------------------------- # Decide if COMMAND at LINE is traceable at runtime, and call the appropriate # preparation function. at_fn_check_prepare_dynamic () { case $1 in *$as_nl*) at_fn_check_prepare_notrace 'an embedded newline' "$2" ;; *) at_fn_check_prepare_trace "$2" ;; esac } # at_fn_filter_trace # ------------------ # Remove the lines in the file "$at_stderr" generated by "set -x" and print # them to stderr. at_fn_filter_trace () { mv "$at_stderr" "$at_stder1" grep '^ *+' "$at_stder1" >&2 grep -v '^ *+' "$at_stder1" >"$at_stderr" } # at_fn_log_failure FILE-LIST # --------------------------- # Copy the files in the list on stdout with a "> " prefix, and exit the shell # with a failure exit code. at_fn_log_failure () { for file do printf "%s\n" "$file:"; sed 's/^/> /' "$file"; done echo 1 > "$at_status_file" exit 1 } # at_fn_check_skip EXIT-CODE LINE # ------------------------------- # Check whether EXIT-CODE is a special exit code (77 or 99), and if so exit # the test group subshell with that same exit code. Use LINE in any report # about test failure. at_fn_check_skip () { case $1 in 99) echo 99 > "$at_status_file"; at_failed=: printf "%s\n" "$2: hard failure"; exit 99;; 77) echo 77 > "$at_status_file"; exit 77;; esac } # at_fn_check_status EXPECTED EXIT-CODE LINE # ------------------------------------------ # Check whether EXIT-CODE is the EXPECTED exit code, and if so do nothing. # Otherwise, if it is 77 or 99, exit the test group subshell with that same # exit code; if it is anything else print an error message referring to LINE, # and fail the test. at_fn_check_status () { case $2 in $1 ) ;; 77) echo 77 > "$at_status_file"; exit 77;; 99) echo 99 > "$at_status_file"; at_failed=: printf "%s\n" "$3: hard failure"; exit 99;; *) printf "%s\n" "$3: exit code was $2, expected $1" at_failed=:;; esac } # at_fn_diff_devnull FILE # ----------------------- # Emit a diff between /dev/null and FILE. Uses "test -s" to avoid useless diff # invocations. at_fn_diff_devnull () { test -s "$1" || return 0 $at_diff "$at_devnull" "$1" } # at_fn_test NUMBER # ----------------- # Parse out test NUMBER from the tail of this file. at_fn_test () { eval at_sed=\$at_sed$1 sed "$at_sed" "$at_myself" > "$at_test_source" } # at_fn_create_debugging_script # ----------------------------- # Create the debugging script $at_group_dir/run which will reproduce the # current test group. at_fn_create_debugging_script () { { echo "#! /bin/sh" && echo 'test ${ZSH_VERSION+y} && alias -g '\''${1+"$@"}'\''='\''"$@"'\''' && printf "%s\n" "cd '$at_dir'" && printf "%s\n" "exec \${CONFIG_SHELL-$SHELL} \"$at_myself\" -v -d $at_debug_args $at_group \${1+\"\$@\"}" && echo 'exit 1' } >"$at_group_dir/run" && chmod +x "$at_group_dir/run" } ## -------------------------------- ## ## End of autotest shell functions. ## ## -------------------------------- ## { printf "%s\n" "## ---------------- ## ## Tested programs. ## ## ---------------- ##" echo } >&5 # Report what programs are being tested. for at_program in : `eval echo $at_tested` do case $at_program in #( :) : continue ;; #( [\\/]* | ?:[\\/]*) : at_program_=$at_program ;; #( *) : as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -f "$as_dir$at_program" && break done IFS=$as_save_IFS at_program_=$as_dir$at_program ;; esac if test -f "$at_program_"; then { printf "%s\n" "$at_srcdir/testsuite.at:17: $at_program_ --version" "$at_program_" --version &5 2>&1 else as_fn_error $? "cannot find $at_program" "$LINENO" 5 fi done { printf "%s\n" "## ------------------ ## ## Running the tests. ## ## ------------------ ##" } >&5 at_start_date=`date` at_start_time=`date +%s 2>/dev/null` printf "%s\n" "$as_me: starting at: $at_start_date" >&5 # Create the master directory if it doesn't already exist. as_dir="$at_suite_dir"; as_fn_mkdir_p || as_fn_error $? "cannot create \`$at_suite_dir'" "$LINENO" 5 # Can we diff with `/dev/null'? DU 5.0 refuses. if diff /dev/null /dev/null >/dev/null 2>&1; then at_devnull=/dev/null else at_devnull=$at_suite_dir/devnull >"$at_devnull" fi # Use `diff -u' when possible. if at_diff=`diff -u "$at_devnull" "$at_devnull" 2>&1` && test -z "$at_diff" then at_diff='diff -u' else at_diff=diff fi # Get the last needed group. for at_group in : $at_groups; do :; done # Extract the start and end lines of each test group at the tail # of this file awk ' BEGIN { FS="" } /^#AT_START_/ { start = NR } /^#AT_STOP_/ { test = substr ($ 0, 10) print "at_sed" test "=\"1," start "d;" (NR-1) "q\"" if (test == "'"$at_group"'") exit }' "$at_myself" > "$at_suite_dir/at-source-lines" && . "$at_suite_dir/at-source-lines" || as_fn_error $? "cannot create test line number cache" "$LINENO" 5 rm -f "$at_suite_dir/at-source-lines" # Set number of jobs for `-j'; avoid more jobs than test groups. set X $at_groups; shift; at_max_jobs=$# if test $at_max_jobs -eq 0; then at_jobs=1 fi if test $at_jobs -ne 1 && { test $at_jobs -eq 0 || test $at_jobs -gt $at_max_jobs; }; then at_jobs=$at_max_jobs fi # If parallel mode, don't output banners, don't split summary lines. if test $at_jobs -ne 1; then at_print_banners=false at_quiet=: fi # Set up helper dirs. rm -rf "$at_helper_dir" && mkdir "$at_helper_dir" && cd "$at_helper_dir" && { test -z "$at_groups" || mkdir $at_groups; } || as_fn_error $? "testsuite directory setup failed" "$LINENO" 5 # Functions for running a test group. We leave the actual # test group execution outside of a shell function in order # to avoid hitting zsh 4.x exit status bugs. # at_fn_group_prepare # ------------------- # Prepare for running a test group. at_fn_group_prepare () { # The directory for additional per-group helper files. at_job_dir=$at_helper_dir/$at_group # The file containing the location of the last AT_CHECK. at_check_line_file=$at_job_dir/check-line # The file containing the exit status of the last command. at_status_file=$at_job_dir/status # The files containing the output of the tested commands. at_stdout=$at_job_dir/stdout at_stder1=$at_job_dir/stder1 at_stderr=$at_job_dir/stderr # The file containing the code for a test group. at_test_source=$at_job_dir/test-source # The file containing dates. at_times_file=$at_job_dir/times # Be sure to come back to the top test directory. cd "$at_suite_dir" # Clearly separate the test groups when verbose. $at_first || $at_verbose echo at_group_normalized=$at_group eval 'while :; do case $at_group_normalized in #( '"$at_format"'*) break;; esac at_group_normalized=0$at_group_normalized done' # Create a fresh directory for the next test group, and enter. # If one already exists, the user may have invoked ./run from # within that directory; we remove the contents, but not the # directory itself, so that we aren't pulling the rug out from # under the shell's notion of the current directory. at_group_dir=$at_suite_dir/$at_group_normalized at_group_log=$at_group_dir/$as_me.log if test -d "$at_group_dir" then find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx {} \; rm -fr "$at_group_dir"/* "$at_group_dir"/.[!.] "$at_group_dir"/.??* fi || { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: test directory for $at_group_normalized could not be cleaned" >&5 printf "%s\n" "$as_me: WARNING: test directory for $at_group_normalized could not be cleaned" >&2;} # Be tolerant if the above `rm' was not able to remove the directory. as_dir="$at_group_dir"; as_fn_mkdir_p echo 0 > "$at_status_file" # In verbose mode, append to the log file *and* show on # the standard output; in quiet mode only write to the log. if test -z "$at_verbose"; then at_tee_pipe='tee -a "$at_group_log"' else at_tee_pipe='cat >> "$at_group_log"' fi } # at_fn_group_banner ORDINAL LINE DESC PAD [BANNER] # ------------------------------------------------- # Declare the test group ORDINAL, located at LINE with group description DESC, # and residing under BANNER. Use PAD to align the status column. at_fn_group_banner () { at_setup_line="$2" test -n "$5" && at_fn_banner $5 at_desc="$3" case $1 in [0-9]) at_desc_line=" $1: ";; [0-9][0-9]) at_desc_line=" $1: " ;; *) at_desc_line="$1: " ;; esac as_fn_append at_desc_line "$3$4" $at_quiet printf %s "$at_desc_line" echo "# -*- compilation -*-" >> "$at_group_log" } # at_fn_group_postprocess # ----------------------- # Perform cleanup after running a test group. at_fn_group_postprocess () { # Be sure to come back to the suite directory, in particular # since below we might `rm' the group directory we are in currently. cd "$at_suite_dir" if test ! -f "$at_check_line_file"; then sed "s/^ */$as_me: WARNING: /" <<_ATEOF A failure happened in a test group before any test could be run. This means that test suite is improperly designed. Please report this failure to . _ATEOF printf "%s\n" "$at_setup_line" >"$at_check_line_file" at_status=99 fi $at_verbose printf %s "$at_group. $at_setup_line: " printf %s "$at_group. $at_setup_line: " >> "$at_group_log" case $at_xfail:$at_status in yes:0) at_msg="UNEXPECTED PASS" at_res=xpass at_errexit=$at_errexit_p at_color=$at_red ;; no:0) at_msg="ok" at_res=pass at_errexit=false at_color=$at_grn ;; *:77) at_msg='skipped ('`cat "$at_check_line_file"`')' at_res=skip at_errexit=false at_color=$at_blu ;; no:* | *:99) at_msg='FAILED ('`cat "$at_check_line_file"`')' at_res=fail at_errexit=$at_errexit_p at_color=$at_red ;; yes:*) at_msg='expected failure ('`cat "$at_check_line_file"`')' at_res=xfail at_errexit=false at_color=$at_lgn ;; esac echo "$at_res" > "$at_job_dir/$at_res" # In parallel mode, output the summary line only afterwards. if test $at_jobs -ne 1 && test -n "$at_verbose"; then printf "%s\n" "$at_desc_line $at_color$at_msg$at_std" else # Make sure there is a separator even with long titles. printf "%s\n" " $at_color$at_msg$at_std" fi at_log_msg="$at_group. $at_desc ($at_setup_line): $at_msg" case $at_status in 0|77) # $at_times_file is only available if the group succeeded. # We're not including the group log, so the success message # is written in the global log separately. But we also # write to the group log in case they're using -d. if test -f "$at_times_file"; then at_log_msg="$at_log_msg ("`sed 1d "$at_times_file"`')' rm -f "$at_times_file" fi printf "%s\n" "$at_log_msg" >> "$at_group_log" printf "%s\n" "$at_log_msg" >&5 # Cleanup the group directory, unless the user wants the files # or the success was unexpected. if $at_debug_p || test $at_res = xpass; then at_fn_create_debugging_script if test $at_res = xpass && $at_errexit; then echo stop > "$at_stop_file" fi else if test -d "$at_group_dir"; then find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \; rm -fr "$at_group_dir" fi rm -f "$at_test_source" fi ;; *) # Upon failure, include the log into the testsuite's global # log. The failure message is written in the group log. It # is later included in the global log. printf "%s\n" "$at_log_msg" >> "$at_group_log" # Upon failure, keep the group directory for autopsy, and create # the debugging script. With -e, do not start any further tests. at_fn_create_debugging_script if $at_errexit; then echo stop > "$at_stop_file" fi ;; esac } ## ------------ ## ## Driver loop. ## ## ------------ ## if (set -m && set +m && set +b) >/dev/null 2>&1; then set +b at_job_control_on='set -m' at_job_control_off='set +m' at_job_group=- else at_job_control_on=: at_job_control_off=: at_job_group= fi for at_signal in 1 2 15; do trap 'set +x; set +e $at_job_control_off at_signal='"$at_signal"' echo stop > "$at_stop_file" trap "" $at_signal at_pgids= for at_pgid in `jobs -p 2>/dev/null`; do at_pgids="$at_pgids $at_job_group$at_pgid" done test -z "$at_pgids" || kill -$at_signal $at_pgids 2>/dev/null wait if test "$at_jobs" -eq 1 || test -z "$at_verbose"; then echo >&2 fi at_signame=`kill -l $at_signal 2>&1 || echo $at_signal` set x $at_signame test 0 -gt 2 && at_signame=$at_signal { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: caught signal $at_signame, bailing out" >&5 printf "%s\n" "$as_me: WARNING: caught signal $at_signame, bailing out" >&2;} as_fn_arith 128 + $at_signal && exit_status=$as_val as_fn_exit $exit_status' $at_signal done rm -f "$at_stop_file" at_first=: if test $at_jobs -ne 1 && rm -f "$at_job_fifo" && test -n "$at_job_group" && ( mkfifo "$at_job_fifo" && trap 'exit 1' PIPE STOP TSTP ) 2>/dev/null then # FIFO job dispatcher. trap 'at_pids= for at_pid in `jobs -p`; do at_pids="$at_pids $at_job_group$at_pid" done if test -n "$at_pids"; then at_sig=TSTP test ${TMOUT+y} && at_sig=STOP kill -$at_sig $at_pids 2>/dev/null fi kill -STOP $$ test -z "$at_pids" || kill -CONT $at_pids 2>/dev/null' TSTP echo # Turn jobs into a list of numbers, starting from 1. at_joblist=`printf "%s\n" "$at_groups" | sed -n 1,${at_jobs}p` set X $at_joblist shift for at_group in $at_groups; do $at_job_control_on 2>/dev/null ( # Start one test group. $at_job_control_off if $at_first; then exec 7>"$at_job_fifo" else exec 6<&- fi trap 'set +x; set +e trap "" PIPE echo stop > "$at_stop_file" echo >&7 as_fn_exit 141' PIPE at_fn_group_prepare if cd "$at_group_dir" && at_fn_test $at_group && . "$at_test_source" then :; else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5 printf "%s\n" "$as_me: WARNING: unable to parse test group: $at_group" >&2;} at_failed=: fi at_fn_group_postprocess echo >&7 ) & $at_job_control_off if $at_first; then at_first=false exec 6<"$at_job_fifo" 7>"$at_job_fifo" fi shift # Consume one token. if test $# -gt 0; then :; else read at_token <&6 || break set x $* fi test -f "$at_stop_file" && break done exec 7>&- # Read back the remaining ($at_jobs - 1) tokens. set X $at_joblist shift if test $# -gt 0; then shift for at_job do read at_token done <&6 fi exec 6<&- wait else # Run serially, avoid forks and other potential surprises. for at_group in $at_groups; do at_fn_group_prepare if cd "$at_group_dir" && at_fn_test $at_group && . "$at_test_source"; then :; else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5 printf "%s\n" "$as_me: WARNING: unable to parse test group: $at_group" >&2;} at_failed=: fi at_fn_group_postprocess test -f "$at_stop_file" && break at_first=false done fi # Wrap up the test suite with summary statistics. cd "$at_helper_dir" # Use ?..???? when the list must remain sorted, the faster * otherwise. at_pass_list=`for f in */pass; do echo $f; done | sed '/\*/d; s,/pass,,'` at_skip_list=`for f in */skip; do echo $f; done | sed '/\*/d; s,/skip,,'` at_xfail_list=`for f in */xfail; do echo $f; done | sed '/\*/d; s,/xfail,,'` at_xpass_list=`for f in ?/xpass ??/xpass ???/xpass ????/xpass; do echo $f; done | sed '/?/d; s,/xpass,,'` at_fail_list=`for f in ?/fail ??/fail ???/fail ????/fail; do echo $f; done | sed '/?/d; s,/fail,,'` set X $at_pass_list $at_xpass_list $at_xfail_list $at_fail_list $at_skip_list shift; at_group_count=$# set X $at_xpass_list; shift; at_xpass_count=$#; at_xpass_list=$* set X $at_xfail_list; shift; at_xfail_count=$# set X $at_fail_list; shift; at_fail_count=$#; at_fail_list=$* set X $at_skip_list; shift; at_skip_count=$# as_fn_arith $at_group_count - $at_skip_count && at_run_count=$as_val as_fn_arith $at_xpass_count + $at_fail_count && at_unexpected_count=$as_val as_fn_arith $at_xfail_count + $at_fail_count && at_total_fail_count=$as_val # Back to the top directory. cd "$at_dir" rm -rf "$at_helper_dir" # Compute the duration of the suite. at_stop_date=`date` at_stop_time=`date +%s 2>/dev/null` printf "%s\n" "$as_me: ending at: $at_stop_date" >&5 case $at_start_time,$at_stop_time in [0-9]*,[0-9]*) as_fn_arith $at_stop_time - $at_start_time && at_duration_s=$as_val as_fn_arith $at_duration_s / 60 && at_duration_m=$as_val as_fn_arith $at_duration_m / 60 && at_duration_h=$as_val as_fn_arith $at_duration_s % 60 && at_duration_s=$as_val as_fn_arith $at_duration_m % 60 && at_duration_m=$as_val at_duration="${at_duration_h}h ${at_duration_m}m ${at_duration_s}s" printf "%s\n" "$as_me: test suite duration: $at_duration" >&5 ;; esac echo printf "%s\n" "## ------------- ## ## Test results. ## ## ------------- ##" echo { echo printf "%s\n" "## ------------- ## ## Test results. ## ## ------------- ##" echo } >&5 if test $at_run_count = 1; then at_result="1 test" at_were=was else at_result="$at_run_count tests" at_were=were fi if $at_errexit_p && test $at_unexpected_count != 0; then if test $at_xpass_count = 1; then at_result="$at_result $at_were run, one passed" else at_result="$at_result $at_were run, one failed" fi at_result="$at_result unexpectedly and inhibited subsequent tests." at_color=$at_red else # Don't you just love exponential explosion of the number of cases? at_color=$at_red case $at_xpass_count:$at_fail_count:$at_xfail_count in # So far, so good. 0:0:0) at_result="$at_result $at_were successful." at_color=$at_grn ;; 0:0:*) at_result="$at_result behaved as expected." at_color=$at_lgn ;; # Some unexpected failures 0:*:0) at_result="$at_result $at_were run, $at_fail_count failed unexpectedly." ;; # Some failures, both expected and unexpected 0:*:1) at_result="$at_result $at_were run, $at_total_fail_count failed ($at_xfail_count expected failure)." ;; 0:*:*) at_result="$at_result $at_were run, $at_total_fail_count failed ($at_xfail_count expected failures)." ;; # No unexpected failures, but some xpasses *:0:*) at_result="$at_result $at_were run, $at_xpass_count passed unexpectedly." ;; # No expected failures, but failures and xpasses *:1:0) at_result="$at_result $at_were run, $at_unexpected_count did not behave as expected ($at_fail_count unexpected failure)." ;; *:*:0) at_result="$at_result $at_were run, $at_unexpected_count did not behave as expected ($at_fail_count unexpected failures)." ;; # All of them. *:*:1) at_result="$at_result $at_were run, $at_xpass_count passed unexpectedly, $at_total_fail_count failed ($at_xfail_count expected failure)." ;; *:*:*) at_result="$at_result $at_were run, $at_xpass_count passed unexpectedly, $at_total_fail_count failed ($at_xfail_count expected failures)." ;; esac if test $at_skip_count = 0 && test $at_run_count -gt 1; then at_result="All $at_result" fi fi # Now put skips in the mix. case $at_skip_count in 0) ;; 1) at_result="$at_result 1 test was skipped." ;; *) at_result="$at_result $at_skip_count tests were skipped." ;; esac if test $at_unexpected_count = 0; then echo "$at_color$at_result$at_std" echo "$at_result" >&5 else echo "${at_color}ERROR: $at_result$at_std" >&2 echo "ERROR: $at_result" >&5 { echo printf "%s\n" "## ------------------------ ## ## Summary of the failures. ## ## ------------------------ ##" # Summary of failed and skipped tests. if test $at_fail_count != 0; then echo "Failed tests:" $SHELL "$at_myself" $at_fail_list --list echo fi if test $at_skip_count != 0; then echo "Skipped tests:" $SHELL "$at_myself" $at_skip_list --list echo fi if test $at_xpass_count != 0; then echo "Unexpected passes:" $SHELL "$at_myself" $at_xpass_list --list echo fi if test $at_fail_count != 0; then printf "%s\n" "## ---------------------- ## ## Detailed failed tests. ## ## ---------------------- ##" echo for at_group in $at_fail_list do at_group_normalized=$at_group eval 'while :; do case $at_group_normalized in #( '"$at_format"'*) break;; esac at_group_normalized=0$at_group_normalized done' cat "$at_suite_dir/$at_group_normalized/$as_me.log" echo done echo fi if test -n "$at_top_srcdir"; then sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## ${at_top_build_prefix}config.log ## _ASBOX sed 's/^/| /' ${at_top_build_prefix}config.log echo fi } >&5 sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## $as_me.log was created. ## _ASBOX echo if $at_debug_p; then at_msg='per-test log files' else at_msg="\`${at_testdir+${at_testdir}/}$as_me.log'" fi at_msg1a=${at_xpass_list:+', '} at_msg1=$at_fail_list${at_fail_list:+" failed$at_msg1a"} at_msg2=$at_xpass_list${at_xpass_list:+" passed unexpectedly"} printf "%s\n" "Please send $at_msg and all information you think might help: To: Subject: [lbdb 0.54] $as_me: $at_msg1$at_msg2 You may investigate any problem if you feel able to do so, in which case the test suite provides a good starting point. Its output may be found below \`${at_testdir+${at_testdir}/}$as_me.dir'. " exit 1 fi exit 0 ## ------------- ## ## Actual tests. ## ## ------------- ## #AT_START_1 at_fn_group_banner 1 'm_muttalias.at:19' \ "m_muttalias" " " 1 at_xfail=no ( printf "%s\n" "1. $at_setup_line: testing $at_desc ..." $at_traceon { set +x printf "%s\n" "$at_srcdir/m_muttalias.at:21: cat \$abs_srcdir/data/m_muttalias.expected > expout" at_fn_check_prepare_dynamic "cat $abs_srcdir/data/m_muttalias.expected > expout" "m_muttalias.at:21" ( $at_check_trace; cat $abs_srcdir/data/m_muttalias.expected > expout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/m_muttalias.at:21" $at_failed && at_fn_log_failure $at_traceon; } { set +x printf "%s\n" "$at_srcdir/m_muttalias.at:22: env LBDB_OVERRIDE_METHODS=m_muttalias \\ OVERRIDE_MUTTALIAS_FILES=\$abs_srcdir/data/muttaliasfile \\ lbdbq test" at_fn_check_prepare_notrace 'an embedded newline' "m_muttalias.at:22" ( $at_check_trace; env LBDB_OVERRIDE_METHODS=m_muttalias \ OVERRIDE_MUTTALIAS_FILES=$abs_srcdir/data/muttaliasfile \ lbdbq test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/m_muttalias.at:22" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_1 #AT_START_2 at_fn_group_banner 2 'm_abook.at:19' \ "m_abook" " " 2 at_xfail=no ( printf "%s\n" "2. $at_setup_line: testing $at_desc ..." $at_traceon printf "%s\n" "m_abook.at:21" >"$at_check_line_file" (! which abook) \ && at_fn_check_skip 77 "$at_srcdir/m_abook.at:21" { set +x printf "%s\n" "$at_srcdir/m_abook.at:22: cat \$abs_srcdir/data/m_abook.expected > expout" at_fn_check_prepare_dynamic "cat $abs_srcdir/data/m_abook.expected > expout" "m_abook.at:22" ( $at_check_trace; cat $abs_srcdir/data/m_abook.expected > expout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/m_abook.at:22" $at_failed && at_fn_log_failure $at_traceon; } { set +x printf "%s\n" "$at_srcdir/m_abook.at:23: env LBDB_OVERRIDE_METHODS=m_abook \\ OVERRIDE_ABOOK_FILES=\$abs_srcdir/data/abook.addressbook \\ lbdbq First1" at_fn_check_prepare_notrace 'an embedded newline' "m_abook.at:23" ( $at_check_trace; env LBDB_OVERRIDE_METHODS=m_abook \ OVERRIDE_ABOOK_FILES=$abs_srcdir/data/abook.addressbook \ lbdbq First1 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/m_abook.at:23" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_2 #AT_START_3 at_fn_group_banner 3 'm_inmail.at:19' \ "lbdb-fetchmail" " " 3 at_xfail=no ( printf "%s\n" "3. $at_setup_line: testing $at_desc ..." $at_traceon { set +x printf "%s\n" "$at_srcdir/m_inmail.at:20: cat \$abs_srcdir/data/m_inmail.utf8.expected1 > expout" at_fn_check_prepare_dynamic "cat $abs_srcdir/data/m_inmail.utf8.expected1 > expout" "m_inmail.at:20" ( $at_check_trace; cat $abs_srcdir/data/m_inmail.utf8.expected1 > expout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/m_inmail.at:20" $at_failed && at_fn_log_failure $at_traceon; } { set +x printf "%s\n" "$at_srcdir/m_inmail.at:21: cat \$abs_srcdir/data/testmail1 > testmail1" at_fn_check_prepare_dynamic "cat $abs_srcdir/data/testmail1 > testmail1" "m_inmail.at:21" ( $at_check_trace; cat $abs_srcdir/data/testmail1 > testmail1 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/m_inmail.at:21" $at_failed && at_fn_log_failure $at_traceon; } { set +x printf "%s\n" "$at_srcdir/m_inmail.at:22: lbdb-fetchaddr -f m_inmail.utf8 -d \"NO DATE\" < testmail1 && \\ lbdb-fetchaddr -f m_inmail.utf8 -d \"NO DATE\" \\ -x x-header1:x-header2:x-header3:x-header4 < testmail1 && \\ cat m_inmail.utf8" at_fn_check_prepare_notrace 'an embedded newline' "m_inmail.at:22" ( $at_check_trace; lbdb-fetchaddr -f m_inmail.utf8 -d "NO DATE" < testmail1 && \ lbdb-fetchaddr -f m_inmail.utf8 -d "NO DATE" \ -x x-header1:x-header2:x-header3:x-header4 < testmail1 && \ cat m_inmail.utf8 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/m_inmail.at:22" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_3 #AT_START_4 at_fn_group_banner 4 'm_inmail.at:28' \ "m_inmail" " " 3 at_xfail=no ( printf "%s\n" "4. $at_setup_line: testing $at_desc ..." $at_traceon { set +x printf "%s\n" "$at_srcdir/m_inmail.at:29: cat \$abs_srcdir/data/m_inmail.utf8.expected2 > expout" at_fn_check_prepare_dynamic "cat $abs_srcdir/data/m_inmail.utf8.expected2 > expout" "m_inmail.at:29" ( $at_check_trace; cat $abs_srcdir/data/m_inmail.utf8.expected2 > expout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/m_inmail.at:29" $at_failed && at_fn_log_failure $at_traceon; } { set +x printf "%s\n" "$at_srcdir/m_inmail.at:30: cat \$abs_srcdir/data/testmail1 > testmail1" at_fn_check_prepare_dynamic "cat $abs_srcdir/data/testmail1 > testmail1" "m_inmail.at:30" ( $at_check_trace; cat $abs_srcdir/data/testmail1 > testmail1 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/m_inmail.at:30" $at_failed && at_fn_log_failure $at_traceon; } { set +x printf "%s\n" "$at_srcdir/m_inmail.at:31: lbdb-fetchaddr -f m_inmail.utf8 -d \"NO DATE\" < testmail1 && \\ lbdb-fetchaddr -f m_inmail.utf8 -d \"NO DATE\" < testmail1" at_fn_check_prepare_notrace 'an embedded newline' "m_inmail.at:31" ( $at_check_trace; lbdb-fetchaddr -f m_inmail.utf8 -d "NO DATE" < testmail1 && \ lbdb-fetchaddr -f m_inmail.utf8 -d "NO DATE" < testmail1 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/m_inmail.at:31" $at_failed && at_fn_log_failure $at_traceon; } { set +x printf "%s\n" "$at_srcdir/m_inmail.at:33: env LBDB_OVERRIDE_METHODS=m_inmail \\ OVERRIDE_M_INMAIL_DB=m_inmail.utf8 \\ OVERRIDE_LIMITDATE=\"0000-00-00_00:00\" \\ OVERRIDE_LIMITCOUNT=0 \\ OVERRIDE_SORT_OUTPUT=no \\ lbdbq Günther" at_fn_check_prepare_notrace 'an embedded newline' "m_inmail.at:33" ( $at_check_trace; env LBDB_OVERRIDE_METHODS=m_inmail \ OVERRIDE_M_INMAIL_DB=m_inmail.utf8 \ OVERRIDE_LIMITDATE="0000-00-00_00:00" \ OVERRIDE_LIMITCOUNT=0 \ OVERRIDE_SORT_OUTPUT=no \ lbdbq Günther ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/m_inmail.at:33" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_4 #AT_START_5 at_fn_group_banner 5 'm_inmail.at:41' \ "m_inmail SORT=address" " " 3 at_xfail=no ( printf "%s\n" "5. $at_setup_line: testing $at_desc ..." $at_traceon { set +x printf "%s\n" "$at_srcdir/m_inmail.at:42: cat \$abs_srcdir/data/m_inmail.example > m_inmail.utf-8" at_fn_check_prepare_dynamic "cat $abs_srcdir/data/m_inmail.example > m_inmail.utf-8" "m_inmail.at:42" ( $at_check_trace; cat $abs_srcdir/data/m_inmail.example > m_inmail.utf-8 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/m_inmail.at:42" $at_failed && at_fn_log_failure $at_traceon; } { set +x printf "%s\n" "$at_srcdir/m_inmail.at:43: cat \$abs_srcdir/data/m_inmail.sortaddress.expected > expout" at_fn_check_prepare_dynamic "cat $abs_srcdir/data/m_inmail.sortaddress.expected > expout" "m_inmail.at:43" ( $at_check_trace; cat $abs_srcdir/data/m_inmail.sortaddress.expected > expout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/m_inmail.at:43" $at_failed && at_fn_log_failure $at_traceon; } { set +x printf "%s\n" "$at_srcdir/m_inmail.at:44: env LBDB_OVERRIDE_METHODS=m_inmail \\ OVERRIDE_M_INMAIL_DB=m_inmail.utf-8 \\ OVERRIDE_LIMITDATE=\"0000-00-00_00:00\" \\ OVERRIDE_LIMITCOUNT=0 \\ OVERRIDE_SORT_OUTPUT=address \\ lbdbq example.com" at_fn_check_prepare_notrace 'an embedded newline' "m_inmail.at:44" ( $at_check_trace; env LBDB_OVERRIDE_METHODS=m_inmail \ OVERRIDE_M_INMAIL_DB=m_inmail.utf-8 \ OVERRIDE_LIMITDATE="0000-00-00_00:00" \ OVERRIDE_LIMITCOUNT=0 \ OVERRIDE_SORT_OUTPUT=address \ lbdbq example.com ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/m_inmail.at:44" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_5 #AT_START_6 at_fn_group_banner 6 'm_inmail.at:52' \ "m_inmail SORT=name" " " 3 at_xfail=no ( printf "%s\n" "6. $at_setup_line: testing $at_desc ..." $at_traceon { set +x printf "%s\n" "$at_srcdir/m_inmail.at:53: cat \$abs_srcdir/data/m_inmail.example > m_inmail.utf-8" at_fn_check_prepare_dynamic "cat $abs_srcdir/data/m_inmail.example > m_inmail.utf-8" "m_inmail.at:53" ( $at_check_trace; cat $abs_srcdir/data/m_inmail.example > m_inmail.utf-8 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/m_inmail.at:53" $at_failed && at_fn_log_failure $at_traceon; } { set +x printf "%s\n" "$at_srcdir/m_inmail.at:54: cat \$abs_srcdir/data/m_inmail.sortname.expected > expout" at_fn_check_prepare_dynamic "cat $abs_srcdir/data/m_inmail.sortname.expected > expout" "m_inmail.at:54" ( $at_check_trace; cat $abs_srcdir/data/m_inmail.sortname.expected > expout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/m_inmail.at:54" $at_failed && at_fn_log_failure $at_traceon; } { set +x printf "%s\n" "$at_srcdir/m_inmail.at:55: env LBDB_OVERRIDE_METHODS=m_inmail \\ OVERRIDE_M_INMAIL_DB=m_inmail.utf-8 \\ OVERRIDE_LIMITDATE=\"0000-00-00_00:00\" \\ OVERRIDE_LIMITCOUNT=0 \\ OVERRIDE_SORT_OUTPUT=name \\ lbdbq example.com" at_fn_check_prepare_notrace 'an embedded newline' "m_inmail.at:55" ( $at_check_trace; env LBDB_OVERRIDE_METHODS=m_inmail \ OVERRIDE_M_INMAIL_DB=m_inmail.utf-8 \ OVERRIDE_LIMITDATE="0000-00-00_00:00" \ OVERRIDE_LIMITCOUNT=0 \ OVERRIDE_SORT_OUTPUT=name \ lbdbq example.com ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/m_inmail.at:55" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_6 #AT_START_7 at_fn_group_banner 7 'm_inmail.at:63' \ "m_inmail SORT=comment" " " 3 at_xfail=no ( printf "%s\n" "7. $at_setup_line: testing $at_desc ..." $at_traceon { set +x printf "%s\n" "$at_srcdir/m_inmail.at:64: cat \$abs_srcdir/data/m_inmail.example > m_inmail.utf-8" at_fn_check_prepare_dynamic "cat $abs_srcdir/data/m_inmail.example > m_inmail.utf-8" "m_inmail.at:64" ( $at_check_trace; cat $abs_srcdir/data/m_inmail.example > m_inmail.utf-8 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/m_inmail.at:64" $at_failed && at_fn_log_failure $at_traceon; } { set +x printf "%s\n" "$at_srcdir/m_inmail.at:65: cat \$abs_srcdir/data/m_inmail.sortcomment.expected > expout" at_fn_check_prepare_dynamic "cat $abs_srcdir/data/m_inmail.sortcomment.expected > expout" "m_inmail.at:65" ( $at_check_trace; cat $abs_srcdir/data/m_inmail.sortcomment.expected > expout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/m_inmail.at:65" $at_failed && at_fn_log_failure $at_traceon; } { set +x printf "%s\n" "$at_srcdir/m_inmail.at:66: env LBDB_OVERRIDE_METHODS=m_inmail \\ OVERRIDE_M_INMAIL_DB=m_inmail.utf-8 \\ OVERRIDE_LIMITDATE=\"0000-00-00_00:00\" \\ OVERRIDE_LIMITCOUNT=0 \\ OVERRIDE_SORT_OUTPUT=comment \\ lbdbq example.com" at_fn_check_prepare_notrace 'an embedded newline' "m_inmail.at:66" ( $at_check_trace; env LBDB_OVERRIDE_METHODS=m_inmail \ OVERRIDE_M_INMAIL_DB=m_inmail.utf-8 \ OVERRIDE_LIMITDATE="0000-00-00_00:00" \ OVERRIDE_LIMITCOUNT=0 \ OVERRIDE_SORT_OUTPUT=comment \ lbdbq example.com ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/m_inmail.at:66" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_7 #AT_START_8 at_fn_group_banner 8 'm_inmail.at:75' \ "m_inmail SORT=reverse_comment" " " 3 at_xfail=no ( printf "%s\n" "8. $at_setup_line: testing $at_desc ..." $at_traceon { set +x printf "%s\n" "$at_srcdir/m_inmail.at:76: cat \$abs_srcdir/data/m_inmail.example > m_inmail.utf-8" at_fn_check_prepare_dynamic "cat $abs_srcdir/data/m_inmail.example > m_inmail.utf-8" "m_inmail.at:76" ( $at_check_trace; cat $abs_srcdir/data/m_inmail.example > m_inmail.utf-8 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/m_inmail.at:76" $at_failed && at_fn_log_failure $at_traceon; } { set +x printf "%s\n" "$at_srcdir/m_inmail.at:77: cat \$abs_srcdir/data/m_inmail.sortreverse_comment.expected > expout" at_fn_check_prepare_dynamic "cat $abs_srcdir/data/m_inmail.sortreverse_comment.expected > expout" "m_inmail.at:77" ( $at_check_trace; cat $abs_srcdir/data/m_inmail.sortreverse_comment.expected > expout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/m_inmail.at:77" $at_failed && at_fn_log_failure $at_traceon; } { set +x printf "%s\n" "$at_srcdir/m_inmail.at:78: env LBDB_OVERRIDE_METHODS=m_inmail \\ OVERRIDE_M_INMAIL_DB=m_inmail.utf-8 \\ OVERRIDE_LIMITDATE=\"0000-00-00_00:00\" \\ OVERRIDE_LIMITCOUNT=0 \\ OVERRIDE_SORT_OUTPUT=reverse_comment \\ lbdbq example.com" at_fn_check_prepare_notrace 'an embedded newline' "m_inmail.at:78" ( $at_check_trace; env LBDB_OVERRIDE_METHODS=m_inmail \ OVERRIDE_M_INMAIL_DB=m_inmail.utf-8 \ OVERRIDE_LIMITDATE="0000-00-00_00:00" \ OVERRIDE_LIMITCOUNT=0 \ OVERRIDE_SORT_OUTPUT=reverse_comment \ lbdbq example.com ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/m_inmail.at:78" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_8 #AT_START_9 at_fn_group_banner 9 'm_vcf.at:19' \ "m_vcf" " " 4 at_xfail=no ( printf "%s\n" "9. $at_setup_line: testing $at_desc ..." $at_traceon { set +x printf "%s\n" "$at_srcdir/m_vcf.at:20: cat \$abs_srcdir/data/m_vcf.expected > expout" at_fn_check_prepare_dynamic "cat $abs_srcdir/data/m_vcf.expected > expout" "m_vcf.at:20" ( $at_check_trace; cat $abs_srcdir/data/m_vcf.expected > expout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/m_vcf.at:20" $at_failed && at_fn_log_failure $at_traceon; } { set +x printf "%s\n" "$at_srcdir/m_vcf.at:21: cat \$abs_srcdir/data/example.vcf > example.vcf" at_fn_check_prepare_dynamic "cat $abs_srcdir/data/example.vcf > example.vcf" "m_vcf.at:21" ( $at_check_trace; cat $abs_srcdir/data/example.vcf > example.vcf ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/m_vcf.at:21" $at_failed && at_fn_log_failure $at_traceon; } { set +x printf "%s\n" "$at_srcdir/m_vcf.at:22: env LBDB_OVERRIDE_METHODS=m_vcf \\ OVERRIDE_VCF_FILES=example.vcf \\ lbdbq muster" at_fn_check_prepare_notrace 'an embedded newline' "m_vcf.at:22" ( $at_check_trace; env LBDB_OVERRIDE_METHODS=m_vcf \ OVERRIDE_VCF_FILES=example.vcf \ lbdbq muster ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/m_vcf.at:22" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_9 #AT_START_10 at_fn_group_banner 10 'm_vcf.at:27' \ "m_vcf nickname" " " 4 at_xfail=no ( printf "%s\n" "10. $at_setup_line: testing $at_desc ..." $at_traceon { set +x printf "%s\n" "$at_srcdir/m_vcf.at:28: cat \$abs_srcdir/data/m_vcf.expected.nickname > expout" at_fn_check_prepare_dynamic "cat $abs_srcdir/data/m_vcf.expected.nickname > expout" "m_vcf.at:28" ( $at_check_trace; cat $abs_srcdir/data/m_vcf.expected.nickname > expout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/m_vcf.at:28" $at_failed && at_fn_log_failure $at_traceon; } { set +x printf "%s\n" "$at_srcdir/m_vcf.at:29: cat \$abs_srcdir/data/example.vcf > example.vcf" at_fn_check_prepare_dynamic "cat $abs_srcdir/data/example.vcf > example.vcf" "m_vcf.at:29" ( $at_check_trace; cat $abs_srcdir/data/example.vcf > example.vcf ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/m_vcf.at:29" $at_failed && at_fn_log_failure $at_traceon; } { set +x printf "%s\n" "$at_srcdir/m_vcf.at:30: env LBDB_OVERRIDE_METHODS=m_vcf \\ OVERRIDE_VCF_FILES=example.vcf \\ lbdbq maxinick" at_fn_check_prepare_notrace 'an embedded newline' "m_vcf.at:30" ( $at_check_trace; env LBDB_OVERRIDE_METHODS=m_vcf \ OVERRIDE_VCF_FILES=example.vcf \ lbdbq maxinick ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/m_vcf.at:30" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_10 #AT_START_11 at_fn_group_banner 11 'm_vcf.at:35' \ "m_vcf name components" " " 4 at_xfail=no ( printf "%s\n" "11. $at_setup_line: testing $at_desc ..." $at_traceon { set +x printf "%s\n" "$at_srcdir/m_vcf.at:36: cat \$abs_srcdir/data/m_vcf.expected.namecomponents > expout" at_fn_check_prepare_dynamic "cat $abs_srcdir/data/m_vcf.expected.namecomponents > expout" "m_vcf.at:36" ( $at_check_trace; cat $abs_srcdir/data/m_vcf.expected.namecomponents > expout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/m_vcf.at:36" $at_failed && at_fn_log_failure $at_traceon; } { set +x printf "%s\n" "$at_srcdir/m_vcf.at:37: cat \$abs_srcdir/data/example.vcf > example.vcf" at_fn_check_prepare_dynamic "cat $abs_srcdir/data/example.vcf > example.vcf" "m_vcf.at:37" ( $at_check_trace; cat $abs_srcdir/data/example.vcf > example.vcf ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/m_vcf.at:37" $at_failed && at_fn_log_failure $at_traceon; } { set +x printf "%s\n" "$at_srcdir/m_vcf.at:38: env LBDB_OVERRIDE_METHODS=m_vcf \\ OVERRIDE_VCF_FILES=example.vcf \\ lbdbq complexname" at_fn_check_prepare_notrace 'an embedded newline' "m_vcf.at:38" ( $at_check_trace; env LBDB_OVERRIDE_METHODS=m_vcf \ OVERRIDE_VCF_FILES=example.vcf \ lbdbq complexname ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/m_vcf.at:38" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_11 #AT_START_12 at_fn_group_banner 12 'm_vcf.at:43' \ "m_vcf no realname" " " 4 at_xfail=no ( printf "%s\n" "12. $at_setup_line: testing $at_desc ..." $at_traceon { set +x printf "%s\n" "$at_srcdir/m_vcf.at:44: cat \$abs_srcdir/data/m_vcf.expected.norealname > expout" at_fn_check_prepare_dynamic "cat $abs_srcdir/data/m_vcf.expected.norealname > expout" "m_vcf.at:44" ( $at_check_trace; cat $abs_srcdir/data/m_vcf.expected.norealname > expout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/m_vcf.at:44" $at_failed && at_fn_log_failure $at_traceon; } { set +x printf "%s\n" "$at_srcdir/m_vcf.at:45: cat \$abs_srcdir/data/example.vcf > example.vcf" at_fn_check_prepare_dynamic "cat $abs_srcdir/data/example.vcf > example.vcf" "m_vcf.at:45" ( $at_check_trace; cat $abs_srcdir/data/example.vcf > example.vcf ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/m_vcf.at:45" $at_failed && at_fn_log_failure $at_traceon; } { set +x printf "%s\n" "$at_srcdir/m_vcf.at:46: env LBDB_OVERRIDE_METHODS=m_vcf \\ OVERRIDE_VCF_FILES=example.vcf \\ lbdbq norealname" at_fn_check_prepare_notrace 'an embedded newline' "m_vcf.at:46" ( $at_check_trace; env LBDB_OVERRIDE_METHODS=m_vcf \ OVERRIDE_VCF_FILES=example.vcf \ lbdbq norealname ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/m_vcf.at:46" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_12 #AT_START_13 at_fn_group_banner 13 'm_vcf.at:51' \ "m_vcf crlf lineending" " " 4 at_xfail=no ( printf "%s\n" "13. $at_setup_line: testing $at_desc ..." $at_traceon { set +x printf "%s\n" "$at_srcdir/m_vcf.at:52: cat \$abs_srcdir/data/m_vcf.expected > expout" at_fn_check_prepare_dynamic "cat $abs_srcdir/data/m_vcf.expected > expout" "m_vcf.at:52" ( $at_check_trace; cat $abs_srcdir/data/m_vcf.expected > expout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/m_vcf.at:52" $at_failed && at_fn_log_failure $at_traceon; } { set +x printf "%s\n" "$at_srcdir/m_vcf.at:53: sed 's/\$/\\r/' < \$abs_srcdir/data/example.vcf > example.vcf" at_fn_check_prepare_dynamic "sed 's/$/\\r/' < $abs_srcdir/data/example.vcf > example.vcf" "m_vcf.at:53" ( $at_check_trace; sed 's/$/\r/' < $abs_srcdir/data/example.vcf > example.vcf ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/m_vcf.at:53" $at_failed && at_fn_log_failure $at_traceon; } { set +x printf "%s\n" "$at_srcdir/m_vcf.at:54: env LBDB_OVERRIDE_METHODS=m_vcf \\ OVERRIDE_VCF_FILES=example.vcf \\ lbdbq muster" at_fn_check_prepare_notrace 'an embedded newline' "m_vcf.at:54" ( $at_check_trace; env LBDB_OVERRIDE_METHODS=m_vcf \ OVERRIDE_VCF_FILES=example.vcf \ lbdbq muster ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/m_vcf.at:54" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_13 lbdb-0.54/tests/testsuite.at000066400000000000000000000016471465114770000161030ustar00rootroot00000000000000dnl Copyright (c) 2018-2024 Roland Rosenfeld dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software Foundation, dnl Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. AT_INIT AT_COLOR_TESTS AT_TESTED(lbdbq) m4_include(m_muttalias.at) m4_include(m_abook.at) m4_include(m_inmail.at) m4_include(m_vcf.at) lbdb-0.54/vcquery.pl.in000077500000000000000000000051151465114770000150170ustar00rootroot00000000000000#! @PERL@ # # Copyright (c) 2024 Roland Rosenfeld # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,, USA. use strict; use warnings; my ($fn, $n, $nickname) = ('', '', ''); my @email = (); my $last = ''; while (<>) { chomp; s/\r//g; if (/^BEGIN:VCARD/) { # new record ($fn, $n, $nickname) = ('', '', ''); @email = (); $last = ''; } elsif (/^END:VCARD/) { # print output my $name = ''; if ($fn ne '') { $name = $fn; } elsif ($n =~ /^(.*);(.*);(.*);(.*);(.*)$/) { # RFC 2426 defines N: field with 5 components: # Family Name (4), Given Name (2), Additional Names (3), # Honorific Prefixes (1), Honorific Suffixes (5) $name = "$4 $2 $3 $1 $5"; $name =~ s/^\s+//; # remove leeding space $name =~ s/\s+$//; # remove trailing space $name =~s /\s+/ /; # reduce multiple spaces } else { $name = '(null)'; } foreach my $addr (@email) { printf "%s\t%s\t%s\n", $addr, $name, $nickname; } # reset data ($fn, $n, $nickname) = ('', '', ''); @email = (); } elsif (/^FN:(.*)$/) { $fn = $1; $last = 'fn'; } elsif (/^N:(.*)$/) { $n = $1; $last = 'n'; } elsif (/^NICKNAME:(.*)$/) { $nickname = $1; $last = 'nickname'; } elsif (/^([^:]+\.)?EMAIL[^ ]*:(.*)$/) { push @email, $2; $last = 'email'; } elsif (/^\s(.*)$/) { my $cont = $1; # continues line if ($last eq 'fn') { $fn .= $cont; } elsif ($last eq 'n') { $n .= $cont; } elsif ($last eq 'nickname') { $nickname .= $cont; } elsif ($last eq 'email') { my $addr = pop @email; print STDERR "Prefix: $addr\n"; $addr .= $cont; print STDERR "concated: $addr\n"; push @email, $addr; } } else { $last = ''; } }