-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 NotDashEscaped: You need GnuPG to verify this message This is a patch file to create version 1.2.0 from 1.1.8. Please check the signature of this patch file: zcat somepath/gpgme-1.1.8-1.2.0.diff.gz | gpg --verify Change to directory gpgme-1.1.8 (or however you renamed it) and give this command: zcat somepath/gpgme-1.1.8-1.2.0.diff.gz | patch -p1 It is a good idea to rename your current directory to gpgme-1.2.0 now. diff -urpNP gpgme-1.1.8/VERSION gpgme-1.2.0/VERSION --- gpgme-1.1.8/VERSION 2008-12-08 18:42:07.000000000 +0000 +++ gpgme-1.2.0/VERSION 2009-06-18 16:15:35.000000000 +0000 @@ -1 +1 @@ -1.1.8 +1.2.0 diff -urpNP gpgme-1.1.8/ChangeLog gpgme-1.2.0/ChangeLog --- gpgme-1.1.8/ChangeLog 2008-12-08 18:41:12.000000000 +0000 +++ gpgme-1.2.0/ChangeLog 2009-06-18 16:11:28.000000000 +0000 @@ -1,3 +1,26 @@ +2009-06-18 Marcus Brinkmann + + * configure.ac (my_version): Set to 1.2.0. + (LIBGPGME_LT_CURRENT, LIBGPGME_LT_AGE): Bump. + (LIBGPGME_LT_REVISION): Reset. + +2009-05-05 Marcus Brinkmann + + * configure.ac: Add infrastructure for compile time check of + _FILE_OFFSET_BITS. + +2009-04-19 Moritz + + * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): Specify --with-gpg. + +2009-03-06 Marcus Brinkmann + + * assuan/: Update to libassuan SVN 2009-03-06. + +2009-01-26 Werner Koch + + * configure.ac (AC_CONFIG_FILES): Add tests/opassuan/Makefile. + 2008-12-08 Marcus Brinkmann Release GPGME 1.1.8. @@ -720,8 +743,8 @@ * configure.ac (AC_INIT): Bump version to 0.3.3. * jnlib/Makefile.am: Rever to older version that includes xmalloc - but not dotlock and some other files. Reported by Stéphane - Corthésy. + but not dotlock and some other files. Reported by Stéphane + Corthésy. 2002-02-10 Marcus Brinkmann diff -urpNP gpgme-1.1.8/Makefile.am gpgme-1.2.0/Makefile.am --- gpgme-1.1.8/Makefile.am 2008-11-03 16:50:12.000000000 +0000 +++ gpgme-1.2.0/Makefile.am 2009-05-05 15:36:15.000000000 +0000 @@ -1,6 +1,6 @@ # Makefile.am - Top level Makefile for GPGME. # Copyright (C) 2000 Werner Koch (dd9jn) -# Copyright (C) 2001, 2002, 2004, 2005, 2008 g10 Code GmbH +# Copyright (C) 2001, 2002, 2004, 2005, 2008, 2009 g10 Code GmbH # # This file is part of GPGME. # @@ -15,14 +15,15 @@ # Public License for more details. # # You should have received a copy of the GNU Lesser General Public -# License along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA +# License along with this program; if not, see . ## Process this file with automake to produce Makefile.in ACLOCAL_AMFLAGS = -I m4 AUTOMAKE_OPTIONS = dist-bzip2 +DISTCHECK_CONFIGURE_FLAGS = --with-gpg="@GPG@" + EXTRA_DIST = gpgme.spec.in autogen.sh if BUILD_ASSUAN diff -urpNP gpgme-1.1.8/Makefile.in gpgme-1.2.0/Makefile.in --- gpgme-1.1.8/Makefile.in 2008-12-08 18:41:52.000000000 +0000 +++ gpgme-1.2.0/Makefile.in 2009-06-18 16:13:41.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -16,7 +16,7 @@ # Makefile.am - Top level Makefile for GPGME. # Copyright (C) 2000 Werner Koch (dd9jn) -# Copyright (C) 2001, 2002, 2004, 2005, 2008 g10 Code GmbH +# Copyright (C) 2001, 2002, 2004, 2005, 2008, 2009 g10 Code GmbH # # This file is part of GPGME. # @@ -31,8 +31,7 @@ # Public License for more details. # # You should have received a copy of the GNU Lesser General Public -# License along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA +# License along with this program; if not, see . VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -160,6 +159,7 @@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ +NEED__FILE_OFFSET_BITS = @NEED__FILE_OFFSET_BITS@ NETLIBS = @NETLIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -232,10 +232,12 @@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I m4 AUTOMAKE_OPTIONS = dist-bzip2 +DISTCHECK_CONFIGURE_FLAGS = --with-gpg="@GPG@" EXTRA_DIST = gpgme.spec.in autogen.sh @BUILD_ASSUAN_FALSE@assuan = @BUILD_ASSUAN_TRUE@assuan = assuan @@ -306,7 +308,7 @@ clean-libtool: -rm -rf .libs _libs distclean-libtool: - -rm -f libtool + -rm -f libtool config.lt # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. @@ -383,7 +385,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS diff -urpNP gpgme-1.1.8/NEWS gpgme-1.2.0/NEWS --- gpgme-1.1.8/NEWS 2008-12-08 18:39:22.000000000 +0000 +++ gpgme-1.2.0/NEWS 2009-06-18 16:11:28.000000000 +0000 @@ -1,3 +1,59 @@ +Noteworthy changes in version 1.2.0 (2009-06-18) +------------------------------------------------ + + * New encryption flag GPGME_ENCRYPT_NO_ENCRYPT_TO to disable default + recipients. + + * gpgme_new will fail if gpgme_check_version was not called, or a + selftest failed (for example, if -mms-bitfields was not used on + MingW32 targets). + + * New functions gpgme_io_read and gpgme_io_write for use with + gpgme_passphrase_cb_t and gpgme_edit_cb_t functions. + + * New functions gpgme_result_ref and gpgme_result_unref to detach + result structures from a context. + + * New functions gpgme_op_export_keys_start and gpgme_op_export_keys + that allow to specify exported keys through gpgme_key_t objects + instead of patterns. + + * New mode of operation gpgme_export_mode_t that allows exporting + external keys. + + * Interface changes relative to the 1.1.7 release: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + GPGME_KEYLIST_MODE_EPHEMERAL NEW. + GPGME_PROTOCOL_ASSUAN NEW. + gpgme_assuan_data_cb_t NEW. + gpgme_assuan_inquire_cb_t NEW. + gpgme_assuan_status_cb_t NEW. + gpgme_op_assuan_transact_start NEW. + gpgme_op_assuan_transact NEW. + gpgme_op_assuan_result NEW. + gpgme_op_import_keys NEW. + gpgme_op_import_keys_start NEW. + gpgme_subkey_t EXTENDED: New fields is_cardkey, card_number. + GPGME_ENCRYPT_NO_ENCRYPT_TO NEW. + gpgme_check_version CHANGED: Is now a macro. + gpgme_new EXTENDED: More failure codes. + gpgme_io_read NEW. + gpgme_io_write NEW. + gpgme_result_ref NEW. + gpgme_result_unref NEW. + gpgme_export_mode_t NEW. + gpgme_export_ext_start EXTENDED: Arg RESERVED is now a MODE flag. + gpgme_op_export EXTENDED: Arg RESERVED is now a MODE flag. + gpgme_op_export_ext_start EXTENDED: Arg RESERVED is now a MODE flag. + gpgme_op_export_ext EXTENDED: Arg RESERVED is now a MODE flag. + gpgme_op_export_keys_start NEW. + gpgme_op_export_keys NEW. + GPGME_DATA_ENCODING_URL NEW. + GPGME_DATA_ENCODING_URL0 NEW. + GPGME_DATA_ENCODING_URLESC NEW. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Noteworthy changes in version 1.1.8 (2008-12-08) ------------------------------------------------ diff -urpNP gpgme-1.1.8/TODO gpgme-1.2.0/TODO --- gpgme-1.1.8/TODO 2008-06-23 21:42:46.000000000 +0000 +++ gpgme-1.2.0/TODO 2009-06-18 16:09:23.000000000 +0000 @@ -1,24 +1,27 @@ -Hey Emacs, this is -*- outline -*- mode! +Hey Emacs, this is -*- org -*- mode! + +* IMPORTANT +** When using descriptor passing, we need to set the fd to blocking before + issueing simple commands, because we are mixing synchronous + commands into potentially asynchronous operations. +** Might want to implement nonblock for w32 native backend! Right now, + we block reading the next line with assuan. * Before release: -** Figure out if _gpgme_io_pipe should pre-create reader/writer and if we - then can use !start_it in most invocations. Note that gpgme_io_dup - probably should always use !start_it, because currently it will - always create reader/writer if they don't exist(!?). ** Some gpg tests fail with gpg 1.3.4-cvs (gpg/t-keylist-sig) The test is currently disabled there and in gpg/t-import. ** When gpg supports it, write binary subpackets directly, and parse SUBPACKET status lines. -** A few months after 1.1.7: - Remove GPGME_CONF_PATHNAME macro. * ABI's to break: +** Implementation: Remove support for old style error codes in + conversion.c::_gpgme_map_gnupg_error. ** gpgme_edit_cb_t: Add "processed" return argument (see edit.c::command_handler). ** I/O and User Data could be made extensible. But this can be done without breaking the ABI hopefully. -* All enums that should be enums need to have a maximum value to ensure - a certain minimum width for extensibility. +** All enums should be replaced by ints and simple macros for + maximum compatibility. ** Compatibility interfaces that can be removed in future versions: *** gpgme_data_new_from_filepart *** gpgme_data_new_from_file @@ -61,9 +64,15 @@ Hey Emacs, this is -*- outline -*- mode! application can then do whatever is required. There are other usages too. This notfication system should be independent of any contextes of course. + + Not sure whether this is still required. GPGME_PROTOCOL_ASSUAN is + sufficient for this. + ** --learn-code support This might be integrated with import. we still need to work out how - to learn a card when gpg and gpgsm have support for smartcards. + to learn a card when gpg and gpgsm have support for smartcards. In + GPA we currently invoke gpg directly. + ** Might need a stat() for data objects and use it for length param to gpg. ** Implement support for photo ids. ** Allow selection of subkeys @@ -75,6 +84,7 @@ Hey Emacs, this is -*- outline -*- mode! *** Allow to export secret keys. Rejected because this is conceptually flawed. Secret keys on a smart card can not be exported, for example. + May eventually e supproted with a keywrapping system. *** Selecting the key ring, setting the version or comment in output. Rejected because the naive implementation is engine specific, the configuration is part of the engine's configuration or readily @@ -95,7 +105,7 @@ Hey Emacs, this is -*- outline -*- mode! the fds unregistered immediately - i think so?) Note that we need support in gpgsm to set include-certs to default as RESET does not reset it. -** Optimize the case where a data object has 0an underlying fd we can pass +** Optimize the case where a data object has an underlying fd we can pass directly to the engine. This will be automatic with socket I/O and descriptor passing. ** Move code common to all engines up from gpg to engine. @@ -103,6 +113,11 @@ Hey Emacs, this is -*- outline -*- mode! (it's an internal error, as select_protocol checks already). ** When server mode is implemented properly, more care has to be taken to release all resources on error (for example to free assuan_cmd). +** op_import_keys and op_export_keys have a limit ion the number of keys. + This is because we pass them in gpg via the command line and gpgsm + via an assuan control line. We should pipe them instead and maybe + change gpg/gpgsm to not put them in memory. + * GPG breakage: ** gpg 1.4.2 lacks error reporting if sign/encrypt with revoked key. ** gpg 1.4.2 does crappy error reporting (namely none at all) when diff -urpNP gpgme-1.1.8/aclocal.m4 gpgme-1.2.0/aclocal.m4 diff -urpNP gpgme-1.1.8/aclocal.m4 gpgme-1.2.0/aclocal.m4 --- gpgme-1.1.8/aclocal.m4 2008-12-08 18:41:50.000000000 +0000 +++ gpgme-1.2.0/aclocal.m4 2009-06-18 16:13:38.000000000 +0000 @@ -1,4 +1,4 @@ -# generated automatically by aclocal 1.10.1 -*- Autoconf -*- +# generated automatically by aclocal 1.10.2 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008 Free Software Foundation, Inc. @@ -13,13 +13,13 @@ m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(AC_AUTOCONF_VERSION, [2.61],, -[m4_warning([this file was generated for autoconf 2.61. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],, +[m4_warning([this file was generated for autoconf 2.63. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) -# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -34,7 +34,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.10' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.10.1], [], +m4_if([$1], [1.10.2], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -48,12 +48,12 @@ m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. -# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.10.1])dnl +[AM_AUTOMAKE_VERSION([1.10.2])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)]) +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- @@ -303,57 +303,68 @@ _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -#serial 3 +#serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], -[for mf in $CONFIG_FILES; do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`AS_DIRNAME("$mf")` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`AS_DIRNAME(["$file"])` - AS_MKDIR_P([$dirpart/$fdir]) - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" +[{ + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done done -done +} ])# _AM_OUTPUT_DEPENDENCY_COMMANDS @@ -688,13 +699,13 @@ esac # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 3 +# serial 4 # _AM_MANGLE_OPTION(NAME) # ----------------------- @@ -711,7 +722,7 @@ AC_DEFUN([_AM_SET_OPTION], # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], -[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- diff -urpNP gpgme-1.1.8/assuan/ChangeLog gpgme-1.2.0/assuan/ChangeLog --- gpgme-1.1.8/assuan/ChangeLog 2008-11-03 16:50:12.000000000 +0000 +++ gpgme-1.2.0/assuan/ChangeLog 2009-06-17 12:36:07.000000000 +0000 @@ -1,65 +1,286 @@ -2008-11-03 Marcus Brinkmann +2009-06-12 Werner Koch - * Makefile.am (INCLUDES): Replace gpgme path with src. + * assuan-pipe-connect.c (_gpgme_io_spawn): Change prototype. + (pipe_connect_gpgme): Pass a flags arg. -2008-10-30 Marcus Brinkmann +2009-04-08 Marcus Brinkmann - * assuan-pipe-connect.c: Fix prototype for _gpgme_io_spawn. Cast - second argument in its invocation to silence gcc warning. + * assuan.h (_gpgme_io_socket): New prototype. + (_ASSUAN_CUSTOM_IO, _assuan_custom_close, _assuan_custom_read) + (_assuan_custom_write, _assuan_custom_pipe, _assuan_custom_socket) + (_assuan_custom_connect): New macros. + * assuan-socket.c (_assuan_close, _assuan_sock_new) + (_assuan_sock_connect) [_ASSUAN_CUSTOM_IO]: Use custom I/O function. + * assuan-buffer.c (assuan_read_line): Do not handle EAGAIN anymore. + * assuan-client.c (_assuan_read_from_server): Likewise. + * assuan-handler.c (process_next): Likewise + * assuan-inquire.c (assuan_inquire): Likewise. + +2009-03-23 Marcus Brinkmann + + * assuan.h: Add prefix macros for _assuan_close and _assuan_usleep. + +2009-02-24 Werner Koch + + * assuan-buffer.c (assuan_send_data): Add hack to optionally send + a final "CAN". + +2008-11-03 Marcus Brinkmann + + * assuan-handler.c (std_handler_help): Make I unsigned to silence + gcc -W warning. + * assuan-logging.c (_assuan_log_print_buffer): Likewise for N. + * funopen.c (_assuan_funopen): Remove initializer to silence gcc + -W warning. + * assuan-handler.c (std_cmd_table): Add missing initializer to + silence gcc -W warning. + * assuan-socket-server.c (io): Likewise. + * assuan-socket-connect.c (assuan_socket_connect_ext): Likewise. + +2008-10-29 Marcus Brinkmann + + * assuan.h (assuan_error_t) (_ASSUAN_ONLY_GPG_ERRORS): Make + unsigned int. + (assuan_transact): Change return type of callback handlers to + assuan_error_t. + +2008-10-15 Werner Koch + + * assuan-logging.c (_assuan_log_printf): Flush if the format + string ends with a LF. + +2008-09-01 Werner Koch + + * assuan-io.c: Include time.h. Fixes bug#951. + (_assuan_usleep): Use nanosleep only is available. + +2008-03-25 Marcus Brinkmann + + * assuan-inquire.c (assuan_inquire): Loop over _assuan_read_line + for EAGAIN. + +2008-03-21 Marcus Brinkmann + + * assuan-defs.h (_assuan_usleep): New prototype. + * assuan-io.c (_assuan_usleep): New function. + * assuan-io-pth.c (_assuan_usleep): New function. + * mkerrors: Do not incude , but assuan-defs.h. + (_assuan_error_is_eagain): Call _assuan_usleep. + + * mkerrors [HAVE_W32_SYSTEM]: Include + (_assuan_error_is_eagain) [HAVE_W32_SYSTEM]: Wait the tenth of a + second. + +2007-11-23 Marcus Brinkmann + + * assuan-inquire.c (_assuan_inquire_ext_cb): Pass through return + value from callback function. + Suggested by Ben Kibbey . + +2007-11-14 Werner Koch + + * assuan-pipe-connect.c (pipe_connect_unix): Add dummy arg FLAGS. + (pipe_connect_w32): Add arg FLAGS and start process detached if + requested. Changed callers to pass 0. + (assuan_pipe_connect_ext): Pass FLAG. + +2007-11-12 Marcus Brinkmann + + * assuan-inquire.c (_assuan_inquire_ext_cb): Clear + CTX->inquire_membuf after deallocating it. + +2007-10-18 Marcus Brinkmann + + * assuan-handler.c (std_handler_help): New function. + (std_cmd_table): Add new command HELP. + +2007-10-08 Werner Koch + + * assuan-util.c (assuan_set_io_hooks): New. + * assuan.h (struct assuan_io_hooks): New. + (assuan_set_io_hooks, _assuan_io_hooks): Add prefix macros. + * assuan-defs.h (_assuan_io_hooks): New. + * assuan-io.c (do_io_read): Take all code from _assuan_io_read. + (_assuan_io_read, _assuan_simple_read): Add hook feature. + (do_io_write): Take all code from _assuan_io_write. + (_assuan_io_write, _assuan_simple_write): Add hook feature. + * assuan-io-pth.c (_assuan_simple_read, _assuan_simple_write) + (_assuan_io_read, _assuan_io_write): Add hook feature. + +2007-10-05 Marcus Brinkmann + + * assuan.h (_assuan_error_is_eagain): Add prefix macro. + + * assuan-defs.h (_assuan_error_is_eagain): New prototype. + * mkerrors (_assuan_error_is_eagain): New function. + * assuan-handler.c (process_next): Leave on EAGAIN. + * assuan-handler.c (process_request), + assuan-client.c (_assuan_read_from_server), + assuan-buffer.c (assuan_read_line): Busy loop over EAGAIN. + +2007-10-05 Werner Koch + + * assuan-socket.c (_assuan_sock_wsa2errno): Map WSANOTINITIALISED. + (_assuan_sock_new): Use assuan_fd_t. + * assuan.h (_assuan_sock_wsa2errno): Add prefix macro. + +2007-10-05 Marcus Brinkmann + + * assuan-defs.h (_assuan_sock_wsa2errno) [HAVE_W32_SYSTEM]: Add prototype. + * assuan-uds.c (wsa2errno) [HAVE_W32_SYSTEM]: Move and rename to ... + * assuan-socket.c (_assuan_sock_wsa2errno) [HAVE_W32_SYSTEM]: ... this. + (_assuan_close, _assuan_sock_new, _assuan_sock_connect, _assuan_sock_bind): + Always set errno on error. + + * assuan-uds.c (wsa2errno) [HAVE_W32_SYSTEM]: New function. + (uds_reader, uds_writer) [HAVE_W32_SYSTEM]: Set errno. + +2007-10-04 Werner Koch + + * mkerrors: Map EAGAIN to GPG_ERR_EAGAIN for read and write + errors. + +2007-10-02 Werner Koch -2008-06-25 Marcus Brinkmann + * assuan-io.c (_assuan_io_read) [W32]: Map WSAEWOULDBLOCK to EAGAIN. + * assuan-socket.c (_assuan_sock_check_nonce): N needs to be signed. - * assuan-pipe-connect.c (struct spawn_fd_item_s): Add new members. - (HANDLE_TRANSLATION): New macro. - (pipe_connect_gpgme): Adjust caller of _gpgme_io_spawn. - [HANDLE_TRANSLATION]: Return translated handles. + * assuan-defs.h (struct assuan_context_s): Add LISTEN_NONCE. + * assuan-socket-server.c (assuan_set_sock_nonce): New. + (accept_connection): Check the nonce. -2008-02-14 Werner Koch +2007-10-01 Werner Koch - * assuan-pipe-connect.c (_gpgme_io_spawn): Adjust prototype. - (pipe_connect_gpgme, pipe_connect_gpgme): Adjust call. + * assuan.h (ASSUAN_INT2FD, ASSUAN_FD2INT): New. -2008-01-04 Marcus Brinkmann + * assuan-socket.c: Rewritten. + (assuan_sock_new, assuan_sock_connect, assuan_sock_bind) + (assuan_sock_get_nonce, assuan_sock_check_nonce): New APIs. - * assuan-pipe-connect.c (_gpgme_io_pipe) - (_gpgme_io_spawn) [_ASSUAN_IN_GPGME_BUILD_ASSUAN]: Add prototypes - to silence compiler warning. Reported by Alon Bar-Lev. + * assuan-io.c (_assuan_simple_read, _assuan_simple_write): + Factored code out to ... + (_assuan_io_read, _assuan_io_write): .. new. + * assuan-io-pth.c (_assuan_io_read, _assuan_io_write): New. 2007-09-25 Werner Koch * assuan.h (_assuan_gpg_strerror_r, _assuan_gpg_strsource): Add - new wrappers. + wrappers for these new internal functions. + +2007-09-24 Marcus Brinkmann + + * assuan-uds.c (uds_reader) [HAVE_W32_SYSTEM]: Do not touch the + UDS structure in the context. Reported by Frank Osterfeld. + (uds_writer): Clarify code. + +2007-09-14 Marcus Brinkmann + + * assuan-pipe-connect.c (do_finish) [HAVE_W32_SYSTEM]: Close + ctx->pid as handle. + (pipe_connect_w32): Save the spawned processes handle. + +2007-09-13 Werner Koch + + * assuan-socket.c (_assuan_close): Add inactive debug outputs. + +2007-09-11 Marcus Brinkmann + + * assuan.h: Use _WIN32 instead of HAVE_W32_SYSTEM. + +2007-09-07 Marcus Brinkmann + + * assuan-inquire.c (assuan_inquire_ext): If MAXLEN is 0, still + initialize MEMBUF. + + * assuan-inquire.c (_assuan_inquire_ext_cb): Clear CTX->in_inquire + before invoking callback and returning. + +2007-09-05 Marcus Brinkmann + + * assuan-handler.c (dispatch_command): Return non-critical errors + with PROCESS_DONE (). 2007-09-03 Marcus Brinkmann * assuan.h [_ASSUAN_EXT_SYM_PREFIX]: Add missing symbol renames with _ASSUAN_PREFIX. -2007-08-02 Werner Koch +2007-09-03 Marcus Brinkmann - * assuan-pipe-connect.c (pipe_connect_w32): A bit more debug output. - (pipe_connect_w32): Use DETACHED_PROCESS flag. - * assuan-logging.c (log_level): New. Use this to disable logging. - (assuan_set_assuan_log_level): New. - * assuan.h: Add prototype. + * assuan.h [_ASSUAN_EXT_SYM_PREFIX]: Add missing symbol renames + with _ASSUAN_PREFIX. -2007-07-12 Werner Koch + * assuan.h (assuan_inquire_ext): Move buffer and buffer_length + arguments callback in prototype. + * assuan-defs.h (struct assuan_context_s): Remove members + inquire_r_buffer and inquire_r_buffer_len. Add buffer and buffer + length arguments to inquire_cb. + * assuan-inquire.c (_assuan_inquire_ext_cb): Return buffer and + buffer length via callback. + (assuan_inquire_ext): Move buffer and buffer length arguments to + callback. + +2007-08-24 Werner Koch + + Switched license to back to LGPLv2.1. - * assuan-handler.c (assuan_get_active_fds): Use get_osfhandle for - the data fp. - * assuan-socket.c (_assuan_close) [W32]: Use CloseHandle and not close. +2007-08-09 Marcus Brinkmann - * assuan-io.c (_assuan_simple_write, _assuan_simple_read): Map - ERROR_BROKEN_PIPE to EPIPE. + * assuan.h (assuan_process_done, assuan_inquire_ext): New + prototypes. + * assuan-defs.h (struct assuan_context_s): New members + in_process_next, in_command, inquire_cb, inquire_cb_data, + inquire_r_buffer, inquire_r_buffer_len, inquire_membuf. + (_assuan_inquire_ext_cb, _assuan_inquire_release): New prototypes. + * assuan-handler.c (PROCESS_DONE): New macro. + (dummy_handler, std_handler_nop, std_handler_cancel) + (std_handler_option, std_handler_bye, std_handler_auth) + (std_handler_reset, std_handler_end): Use PROCESS_DONE to + optionally call assuan_process_done if CTX->in_process_next is + true. + (assuan_process_done, process_next): New functions. + (assuan_process_next): Rewritten to support external event + handling. + * mkerrors: Do not clear high bits of -1 for old style EOF. + * assuan-inquire.c (_assuan_inquire_release) + (_assuan_inquire_ext_cb, assuan_inquire_ext): New functions. + * assuan-pipe-server.c (_assuan_release_context): Call + _assuan_inquire_release. + +2007-07-12 Werner Koch + * assuan.h (assuan_fd_t): New. + (ASSUAN_INVALID_FD): New. Use it everywhere. + * assuan-defs.h (SOCKET2HANDLE, HANDLE2SOCKET) [W32]: New. Use + them to cast descriptors for socket fucntions. + * assuan-pipe-connect.c (fd_to_handle, handle_to_fd): Remove + definition and all uses. + (pid_to_handle, handle_to_pid): Remove as they are ununsed. + * assuan-io.c (_assuan_simple_write, _assuan_simple_read) [W32]: + Make use of HANDLE2SOCKET. + * assuan-socket.c (_assuan_close) [W32]: Use CloseHandle and not + close. + * assuan-handler.c (assuan_get_active_fds) [W32]: Use + _get_osfhandle for the data fp. + + * assuan-io.c (_assuan_simple_write): Return EPIPE on a closed pipe. + (_assuan_simple_read): Likewise + 2007-07-08 Marcus Brinkmann - * assuan-defs.h (struct assuan_context_s): Have partial peercred - structure even if HAVE_W32_SYSTEM, and have full peercred - structure only if HAVE_SO_PEERCRED. + * assuan-defs.h (struct assuan_context_s): Have full peercred + structure for HAVE_SO_PEERCRED. * assuan-connect.c (assuan_get_peercred) [!HAVE_SO_PEERCRED]: Do not try to set PID, UID and GID. +2007-07-05 Werner Koch + + * assuan-defs.h (struct assuan_context_s): Have peercred.valid + even for Windows. This makes some other code cleaner. + + * assuan.h (ASSUAN_CONFIDENTIAL): New flag. + * assuan-util.c (assuan_set_flag, assuan_get_flag): Support flag. + 2007-07-04 Marcus Brinkmann Change _WIN32 to HAVE_W32_SYSTEM for consistency. @@ -377,28 +598,63 @@ to silence gcc warning. * assuan-inquire.c (assuan_inquire): Likewise. -2005-08-19 Werner Koch +2005-09-08 Marcus Brinkmann - * funopen.c, assuan-socket.c: Copied from libassuan CVS. * assuan-pipe-connect.c (assuan_pipe_connect2): Add missing declaration of PID. 2005-08-09 Werner Koch - * README.1st: Adjusted to cope with changes done in upstream Assuan. + * mkerrors: Include config.h into assuan-errors.c. This is + required so that assuan.h knows about the W32 macro. - Merged changes for W32 support from libassuan. - * assuan.h [_ASSUAN_EXT_SYM_PREFIX]: New. * assuan-io.c [_ASSUAN_NO_PTH]: New. * assuan-pipe-connect.c (fix_signals) [_ASSUAN_NO_FIXED_SIGNALS]: New. (assuan_pipe_connect2) [_ASSUAN_USE_DOUBLE_FORK]: Use double fork. (fix_signals) [_ASSUAN_USE_DOUBLE_FORK]: Do not wait.. - * assuan-logging.c, assuan-io.c: Include config.h - Replaced all usages of _WIN32 by the new HAVE_W32_SYSTEM because - there is nothing winning in this API. - * assuan-pipe-connect.c (assuan_pipe_connect2) [_WIN32]: Return - error Not Imlemented. + +2005-05-21 Werner Koch + + * assuan-util.c (assuan_set_flag, assuan_get_flag): New. + * assuan-defs.h (struct assuan_context_s): New field flags. + * assuan.h (assuan_flag_t): New with one flag value + ASSUAN_NO_WAITPID for now. + * assuan-pipe-connect.c (do_finish): Take care of the no_waitpid + flag. + +2005-04-04 Werner Koch + + * assuan-util.c (_assuan_calloc): Avoid integer overflow. + +2005-03-22 Werner Koch + + * assuan-defs.h (struct assuan_io): Renamed elements READ and + WRITE to READFNC and WRITEFNC to avoid problems with read defined + as macros. Changed callers. Noted by Ville Skyttä. + +2005-02-24 Werner Koch + + * assuan-client.c (assuan_transact): Handle empty and comment + commands correctly. + +2004-12-20 Werner Koch + + * assuan-socket-connect.c (assuan_socket_connect) [W32]: Allow for + a drive letter in the path. + +2004-12-19 Werner Koch + + * assuan-pipe-server.c (assuan_init_pipe_server) [W32]: Map file + descriptors using _get_osfhandle. + +2004-12-19 Moritz Schulte + + * assuan-pipe-connect.c (assuan_pipe_connect2): Removed "`" + character at beginning of line 532. + +2004-12-18 Werner Koch + * assuan-logging.c (_assuan_w32_strerror): New. * assuan-defs.h (w32_strerror): new. * assuan-pipe-connect.c (assuan_pipe_connect2, fix_signals): @@ -406,57 +662,95 @@ (build_w32_commandline, create_inheritable_pipe): New. Taken from gnupg 1.9. (assuan_pipe_connect2) [W32]: Implemented for W32. - * assuan-pipe-server.c (assuan_init_pipe_server) [W32]: Map file - descriptors using _get_osfhandle. - * assuan-socket-connect.c (assuan_socket_connect) [W32]: Allow for - a drive letter in the path. - * assuan-client.c (assuan_transact): Handle empty and comment - commands correctly. - * assuan-util.c (_assuan_calloc): Avoid integer overflow. - * assuan-util.c (assuan_set_flag, assuan_get_flag): New. - * assuan-defs.h (struct assuan_context_s): New field flags. - * assuan.h (assuan_flag_t): New with one flag value - ASSUAN_NO_WAITPID for now. - * assuan-pipe-connect.c (do_finish): Take care of the no_waitpid - flag. - * mkerrors: Include config.h into assuan-errors.c. This is - required so that assuan.h knows about the W32 macro. -2005-08-09 Timo Schulz (ported from libassuan by wk) +2004-12-14 Werner Koch + + * assuan-socket-connect.c (assuan_socket_connect): Always allow + NAME to start with a froward slash. + +2004-12-07 Werner Koch + + * assuan-logging.c, assuan-io.c: Include config.h + + Replaced all usages of _WIN32 by the new HAVE_W32_SYSTEM because + there is nothing winning in this API. + + * assuan-pipe-connect.c (assuan_pipe_connect2) [_WIN32]: Return + error Not Imlemented. + +2004-11-27 Werner Koch + + * assuan-socket.c: Include sys/types.h. Noted by Michael + Nottebrock. + +2004-11-26 Werner Koch + + * assuan-io.c [_WIN32]: Avoid warnings about unknown pragmas. + +2004-11-24 Werner Koch + + * assuan-logging.c (_assuan_log_printf): New. + * assuan-domain-connect.c (LOG): Removed and replaced all callers + by _assuan_log_printf. This is needed for C89 and gcc 2.95 which + both don't have C99 style variable arg macros. + * assuan-pipe-connect.c (LOG): Ditto. + * assuan-socket-connect.c (LOG): Ditto. + + * assuan-socket.c[!_WIN32]: Fixed includes. + +2004-11-23 Timo Schulz + + * assuan-socket.c (_assuan_sock_connect): Get local port from + the sun_path[] file. + (_assuan_sock_bind): Write local port to the sun_path[] file. + * assuan-socket-connect.c (assuan_socket_connect): Use DIRSEP_C + for a better portability. + (assuan-defs.h): Define DIRSEP_C. +2004-11-19 Werner Koch + + * assuan-handler.c (assuan_write_status): Return an error code. + +2004-11-22 Timo Schulz + * assuan-io.c (_assuan_simple_read, _assuan_simple_write): W32 support. * assuan-socket.c (_assuan_close): New. (_assuan_sock_new): New. (_assuan_sock_bind): New. + +2004-11-16 Werner Koch -2005-03-22 Werner Koch + * assuan-socket-connect.c (LOG): Fixed macro to print not only the + prefix. + * assuan-domain-connect.c, assuan-socket-connect.c (LOG): Ditto. - * assuan-defs.h (struct assuan_io): Renamed elements READ and - WRITE to READFNC and WRITEFNC to avoid problems with read defined - as macro. Changed callers. Noted by Ville Skyttä. +2004-10-02 Werner Koch -2004-12-16 Marcus Brinkmann + * assuan-socket-connect.c: Define SUN_LEN, AF_LOCAL and PF_LOCAL + if they are not available. + * assuan-domain-connect.c: Define PF_LOCAL and AF_LOCAL if needed. - * assuan-pipe-connect.c (do_finish): Do not wait for child to finish. - (assuan_pipe_connect): Use double-fork approach. - * assuan-connect.c (assuan_disconnect): Do not write BYE to the - status line. +2004-06-23 Marcus Brinkmann -2004-12-07 Marcus Brinkmann + * assuan-domain-connect.c [HAVE_SYS_UIO_H]: Include . - * README.1st: Add copyright notice. +2004-05-11 Werner Koch -2004-06-23 Marcus Brinkmann + * assuan-listen.c (assuan_set_hello_line, assuan_accept): Allow + for multi line hello strings. - * assuan-domain-connect.c [HAVE_SYS_UIO_H]: Include . + * assuan-buffer.c (_assuan_write_line): New with parts of .. + (assuan_write_line): .. factored out. + +2004-04-29 Werner Koch - * assuan-handler.c: Include . + * assuan-socket-connect.c: Include string.h. + * assuan-logging.c: Ditto. -2004-06-08 Marcus Brinkmann +2004-04-22 Marcus Brinkmann - * assuan-buffer.c (assuan_write_line): If the line is longer than - the maximum line length, bail out early. + * libassuan.m4: Quote first argument to AC_DEFUN. 2004-04-21 Werner Koch @@ -1034,7 +1328,7 @@ * assuan-defs.h: Add space in the context for this. - Copyright 2001, 2002, 2006 Free Software Foundation, Inc. + Copyright 2001, 2002, 2006, 2007 Free Software Foundation, Inc. This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -urpNP gpgme-1.1.8/assuan/Makefile.in gpgme-1.2.0/assuan/Makefile.in --- gpgme-1.1.8/assuan/Makefile.in 2008-12-08 18:41:52.000000000 +0000 +++ gpgme-1.2.0/assuan/Makefile.in 2009-06-18 16:13:40.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -155,6 +155,7 @@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ +NEED__FILE_OFFSET_BITS = @NEED__FILE_OFFSET_BITS@ NETLIBS = @NETLIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -227,6 +228,7 @@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = mkerrors @@ -266,8 +268,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_ @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -358,7 +360,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS diff -urpNP gpgme-1.1.8/assuan/assuan-buffer.c gpgme-1.2.0/assuan/assuan-buffer.c --- gpgme-1.1.8/assuan/assuan-buffer.c 2007-11-23 15:24:05.000000000 +0000 +++ gpgme-1.2.0/assuan/assuan-buffer.c 2009-04-08 17:51:18.000000000 +0000 @@ -14,9 +14,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. + * License along with this program; if not, see . */ #include @@ -53,9 +51,10 @@ writen (assuan_context_t ctx, const char return 0; /* okay */ } -/* Read an entire line. Returns 0 on success or -1 and ERRNo on +/* Read an entire line. Returns 0 on success or -1 and ERRNO on failure. EOF is indictated by setting the integer at address - R_EOF. */ + R_EOF. Note: BUF, R_NREAD and R_EOF contain a valid result even if + an error is returned. */ static int readline (assuan_context_t ctx, char *buf, size_t buflen, int *r_nread, int *r_eof) @@ -94,7 +93,7 @@ readline (assuan_context_t ctx, char *bu } -/* Function returns an Assuan error. */ +/* Function returns an Assuan error. */ assuan_error_t _assuan_read_line (assuan_context_t ctx) { @@ -134,11 +133,23 @@ _assuan_read_line (assuan_context_t ctx) &nread, &ctx->inbound.eof); if (rc) { + int saved_errno = errno; + if (ctx->log_fp) - fprintf (ctx->log_fp, "%s[%u.%d] DBG: <- [Error: %s (%d)]\n", - assuan_get_assuan_log_prefix (), - (unsigned int)getpid (), ctx->inbound.fd, - strerror (errno), errno); + fprintf (ctx->log_fp, "%s[%u.%d] DBG: <- [Error: %s]\n", + assuan_get_assuan_log_prefix (), + (unsigned int)getpid (), (int)ctx->inbound.fd, + strerror (errno)); + + if (saved_errno == EAGAIN) + { + /* We have to save a partial line. */ + memcpy (ctx->inbound.attic.line, line, atticlen + nread); + ctx->inbound.attic.pending = 0; + ctx->inbound.attic.linelen = atticlen + nread; + } + + errno = saved_errno; return _assuan_error (ASSUAN_Read_Error); } if (!nread) @@ -147,7 +158,7 @@ _assuan_read_line (assuan_context_t ctx) if (ctx->log_fp) fprintf (ctx->log_fp, "%s[%u.%d] DBG: <- [EOF]\n", assuan_get_assuan_log_prefix (), - (unsigned int)getpid (), ctx->inbound.fd); + (unsigned int)getpid (), (int)ctx->inbound.fd); return _assuan_error (-1); } @@ -191,7 +202,7 @@ _assuan_read_line (assuan_context_t ctx) { fprintf (ctx->log_fp, "%s[%u.%d] DBG: <- ", assuan_get_assuan_log_prefix (), - (unsigned int)getpid (), ctx->inbound.fd); + (unsigned int)getpid (), (int)ctx->inbound.fd); if (ctx->confidential) fputs ("[Confidential data not shown]", ctx->log_fp); else @@ -207,7 +218,7 @@ _assuan_read_line (assuan_context_t ctx) if (ctx->log_fp) fprintf (ctx->log_fp, "%s[%u.%d] DBG: <- [Invalid line]\n", assuan_get_assuan_log_prefix (), - (unsigned int)getpid (), ctx->inbound.fd); + (unsigned int)getpid (), (int)ctx->inbound.fd); *line = 0; ctx->inbound.linelen = 0; return _assuan_error (ctx->inbound.eof @@ -235,6 +246,7 @@ assuan_read_line (assuan_context_t ctx, return _assuan_error (ASSUAN_Invalid_Value); err = _assuan_read_line (ctx); + *line = ctx->inbound.line; *linelen = ctx->inbound.linelen; return err; @@ -265,7 +277,7 @@ _assuan_write_line (assuan_context_t ctx fprintf (ctx->log_fp, "%s[%u.%d] DBG: -> " "[supplied line too long -truncated]\n", assuan_get_assuan_log_prefix (), - (unsigned int)getpid (), ctx->inbound.fd); + (unsigned int)getpid (), (int)ctx->inbound.fd); if (prefixlen > 5) prefixlen = 5; if (len > ASSUAN_LINELENGTH - prefixlen - 2) @@ -281,7 +293,7 @@ _assuan_write_line (assuan_context_t ctx { fprintf (ctx->log_fp, "%s[%u.%d] DBG: -> ", assuan_get_assuan_log_prefix (), - (unsigned int)getpid (), ctx->inbound.fd); + (unsigned int)getpid (), (int)ctx->inbound.fd); if (ctx->confidential) fputs ("[Confidential data not shown]", ctx->log_fp); else @@ -333,7 +345,7 @@ assuan_write_line (assuan_context_t ctx, fprintf (ctx->log_fp, "%s[%u.%d] DBG: -> " "[supplied line contained a LF - truncated]\n", assuan_get_assuan_log_prefix (), - (unsigned int)getpid (), ctx->inbound.fd); + (unsigned int)getpid (), (int)ctx->inbound.fd); return _assuan_write_line (ctx, NULL, line, len); } @@ -398,7 +410,7 @@ _assuan_cookie_write_data (void *cookie, { fprintf (ctx->log_fp, "%s[%u.%d] DBG: -> ", assuan_get_assuan_log_prefix (), - (unsigned int)getpid (), ctx->inbound.fd); + (unsigned int)getpid (), (int)ctx->inbound.fd); if (ctx->confidential) fputs ("[Confidential data not shown]", ctx->log_fp); @@ -454,7 +466,7 @@ _assuan_cookie_write_flush (void *cookie { fprintf (ctx->log_fp, "%s[%u.%d] DBG: -> ", assuan_get_assuan_log_prefix (), - (unsigned int)getpid (), ctx->inbound.fd); + (unsigned int)getpid (), (int)ctx->inbound.fd); if (ctx->confidential) fputs ("[Confidential data not shown]", ctx->log_fp); else @@ -491,6 +503,9 @@ _assuan_cookie_write_flush (void *cookie * a INQUIRE response. However, when assuan_transact() is used, this * function takes care of sending END itself. * + * If BUFFER is NULL and LENGTH is 1 and we are a client, a "CAN" is + * send instead of an "END". + * * Return value: 0 on success or an error code **/ @@ -499,7 +514,7 @@ assuan_send_data (assuan_context_t ctx, { if (!ctx) return _assuan_error (ASSUAN_Invalid_Value); - if (!buffer && length) + if (!buffer && length > 1) return _assuan_error (ASSUAN_Invalid_Value); if (!buffer) @@ -508,7 +523,7 @@ assuan_send_data (assuan_context_t ctx, if (ctx->outbound.data.error) return ctx->outbound.data.error; if (!ctx->is_server) - return assuan_write_line (ctx, "END"); + return assuan_write_line (ctx, length == 1? "CAN":"END"); } else { @@ -521,11 +536,11 @@ assuan_send_data (assuan_context_t ctx, } assuan_error_t -assuan_sendfd (assuan_context_t ctx, int fd) +assuan_sendfd (assuan_context_t ctx, assuan_fd_t fd) { /* It is explicitly allowed to use (NULL, -1) as a runtime test to check whether descriptor passing is available. */ - if (!ctx && fd == -1) + if (!ctx && fd == ASSUAN_INVALID_FD) #ifdef USE_DESCRIPTOR_PASSING return 0; #else @@ -540,7 +555,7 @@ assuan_sendfd (assuan_context_t ctx, int } assuan_error_t -assuan_receivefd (assuan_context_t ctx, int *fd) +assuan_receivefd (assuan_context_t ctx, assuan_fd_t *fd) { if (! ctx->io->receivefd) return set_error (ctx, Not_Implemented, diff -urpNP gpgme-1.1.8/assuan/assuan-client.c gpgme-1.2.0/assuan/assuan-client.c --- gpgme-1.1.8/assuan/assuan-client.c 2007-07-04 20:08:19.000000000 +0000 +++ gpgme-1.2.0/assuan/assuan-client.c 2009-04-08 16:39:34.000000000 +0000 @@ -14,9 +14,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. + * License along with this program; if not, see . */ #include @@ -49,7 +47,7 @@ _assuan_read_from_server (assuan_context return rc; line = ctx->inbound.line; linelen = ctx->inbound.linelen; - } + } while (*line == '#' || !linelen); if (linelen >= 1 diff -urpNP gpgme-1.1.8/assuan/assuan-connect.c gpgme-1.2.0/assuan/assuan-connect.c --- gpgme-1.1.8/assuan/assuan-connect.c 2007-07-08 15:46:47.000000000 +0000 +++ gpgme-1.2.0/assuan/assuan-connect.c 2009-03-09 14:10:31.000000000 +0000 @@ -14,9 +14,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. + * License along with this program; if not, see . */ #ifdef HAVE_CONFIG_H @@ -60,8 +58,8 @@ assuan_get_pid (assuan_context_t ctx) #ifndef HAVE_W32_SYSTEM -/* Return user credentials. PID, UID and GID amy be gived as NULL if - you are not interested in this value. For getting the pid of the +/* Return user credentials. PID, UID and GID may be given as NULL if + you are not interested in a value. For getting the pid of the peer the assuan_get_pid is usually better suited. */ assuan_error_t assuan_get_peercred (assuan_context_t ctx, pid_t *pid, uid_t *uid, gid_t *gid) diff -urpNP gpgme-1.1.8/assuan/assuan-defs.h gpgme-1.2.0/assuan/assuan-defs.h --- gpgme-1.1.8/assuan/assuan-defs.h 2007-07-08 15:46:47.000000000 +0000 +++ gpgme-1.2.0/assuan/assuan-defs.h 2009-03-09 14:10:31.000000000 +0000 @@ -1,5 +1,5 @@ /* assuan-defs.c - Internal definitions to Assuan - * Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation, Inc. + * Copyright (C) 2001, 2002, 2004, 2005, 2007, 2008 Free Software Foundation, Inc. * * This file is part of Assuan. * @@ -40,17 +40,6 @@ #endif #ifdef HAVE_W32_SYSTEM -#define AF_LOCAL AF_UNIX -/* We need to prefix the structure with a sockaddr_in header so we can - use it later for sendto and recvfrom. */ -struct sockaddr_un -{ - short sun_family; - unsigned short sun_port; - struct in_addr sun_addr; - char sun_path[108-2-4]; /* Path name. */ -}; - /* Not needed anymore because the current mingw32 defines this in sys/types.h */ /* typedef int ssize_t; */ @@ -80,12 +69,16 @@ struct assuan_io /* Routine to write to output_fd. */ ssize_t (*writefnc) (assuan_context_t, const void *, size_t); /* Send a file descriptor. */ - assuan_error_t (*sendfd) (assuan_context_t, int); + assuan_error_t (*sendfd) (assuan_context_t, assuan_fd_t); /* Receive a file descriptor. */ - assuan_error_t (*receivefd) (assuan_context_t, int *); + assuan_error_t (*receivefd) (assuan_context_t, assuan_fd_t *); }; +/* The global variable with the optional hook fucntions. */ +extern struct assuan_io_hooks _assuan_io_hooks; + + /* The context we use with most functions. */ struct assuan_context_s { @@ -103,6 +96,14 @@ struct assuan_context_s int confidential; int is_server; /* Set if this is context belongs to a server */ int in_inquire; + int in_process_next; + int in_command; + + /* The following members are used by assuan_inquire_ext. */ + int (*inquire_cb) (void *cb_data, int rc, unsigned char *buf, size_t len); + void *inquire_cb_data; + void *inquire_membuf; + char *hello_line; char *okay_line; /* See assuan_set_okay_line() */ @@ -111,7 +112,7 @@ struct assuan_context_s FILE *log_fp; struct { - int fd; + assuan_fd_t fd; int eof; char line[LINELENGTH]; int linelen; /* w/o CR, LF - might not be the same as @@ -125,7 +126,7 @@ struct assuan_context_s } inbound; struct { - int fd; + assuan_fd_t fd; struct { FILE *fp; char line[LINELENGTH]; @@ -137,8 +138,10 @@ struct assuan_context_s int pipe_mode; /* We are in pipe mode, i.e. we can handle just one connection and must terminate then. */ pid_t pid; /* The pid of the peer. */ - int listen_fd; /* The fd we are listening on (used by socket servers) */ - int connected_fd; /* helper */ + assuan_fd_t listen_fd; /* The fd we are listening on (used by + socket servers) */ + assuan_sock_nonce_t listen_nonce; /* Used with LISTEN_FD. */ + assuan_fd_t connected_fd; /* helper */ struct { int valid; /* Whether this structure has valid information. */ @@ -162,7 +165,7 @@ struct assuan_context_s int bufferoffset; /* Offset of start of buffer. */ int buffersize; /* Bytes buffered. */ - int pendingfds[5]; /* Array to save received descriptors. */ + assuan_fd_t pendingfds[5]; /* Array to save received descriptors. */ int pendingfdscount; /* Number of received descriptors. */ } uds; @@ -188,15 +191,15 @@ struct assuan_context_s /* If set, this is called right before logging an I/O line. With DIRECTION set to 1 it is called for an output oeration; 0 means an input operation. If bit 0 is set in the return value, the - logging of the will be suppressed. With bit 1 set, the entire - line will be ignored. */ + logging of the line will be suppressed. With bit 1 set, the + entire line will be ignored. */ unsigned int (*io_monitor)(assuan_context_t ctx, int direction, const char *line, size_t linelen); - int input_fd; /* set by INPUT command */ - int output_fd; /* set by OUTPUT command */ + assuan_fd_t input_fd; /* Set by the INPUT command. */ + assuan_fd_t output_fd; /* Set by the OUTPUT command. */ /* io routines. */ struct assuan_io *io; @@ -228,17 +231,22 @@ assuan_error_t _assuan_read_from_server /*-- assuan-error.c --*/ +/*-- assuan-inquire.c --*/ +int _assuan_inquire_ext_cb (assuan_context_t ctx); +void _assuan_inquire_release (assuan_context_t ctx); -/* Map error codes as used in this implementaion to the libgpg-error +/* Map error codes as used in this implementation to the libgpg-error codes. */ assuan_error_t _assuan_error (int oldcode); +/* Check if ERR means EAGAIN. */ +int _assuan_error_is_eagain (assuan_error_t err); -/* Extrac the erro code from A. This works for both the old and the - new style error codes. This needs to be whenever an error code is - compared. */ +/* Extract the error code from A. This works for both the old and the + new style error codes. This needs to be used whenever an error + code is compared. */ #define err_code(a) ((a) & 0x00ffffff) -/* Check whether A is the erro code for EOF. We allow forold and new +/* Check whether A is the erro code for EOF. We allow for old and new style EOF error codes here. */ #define err_is_eof(a) ((a) == (-1) || err_code (a) == 16383) @@ -284,6 +292,8 @@ pid_t _assuan_waitpid (pid_t pid, int *s ssize_t _assuan_simple_read (assuan_context_t ctx, void *buffer, size_t size); ssize_t _assuan_simple_write (assuan_context_t ctx, const void *buffer, size_t size); +ssize_t _assuan_io_read (assuan_fd_t fd, void *buffer, size_t size); +ssize_t _assuan_io_write (assuan_fd_t fd, const void *buffer, size_t size); #ifdef HAVE_W32_SYSTEM int _assuan_simple_sendmsg (assuan_context_t ctx, void *msg); int _assuan_simple_recvmsg (assuan_context_t ctx, void *msg); @@ -292,11 +302,21 @@ ssize_t _assuan_simple_sendmsg (assuan_c ssize_t _assuan_simple_recvmsg (assuan_context_t ctx, struct msghdr *msg); #endif +void _assuan_usleep (unsigned int usec); + + /*-- assuan-socket.c --*/ -int _assuan_close (int fd); -int _assuan_sock_new (int domain, int type, int proto); -int _assuan_sock_bind (int sockfd, struct sockaddr *addr, int addrlen); -int _assuan_sock_connect (int sockfd, struct sockaddr *addr, int addrlen); +int _assuan_close (assuan_fd_t fd); +assuan_fd_t _assuan_sock_new (int domain, int type, int proto); +int _assuan_sock_connect (assuan_fd_t sockfd, + struct sockaddr *addr, int addrlen); +int _assuan_sock_bind (assuan_fd_t sockfd, struct sockaddr *addr, int addrlen); +int _assuan_sock_get_nonce (struct sockaddr *addr, int addrlen, + assuan_sock_nonce_t *nonce); +int _assuan_sock_check_nonce (assuan_fd_t fd, assuan_sock_nonce_t *nonce); +#ifdef HAVE_W32_SYSTEM +int _assuan_sock_wsa2errno (int err); +#endif #ifdef HAVE_FOPENCOOKIE /* We have to implement funopen in terms of glibc's fopencookie. */ @@ -329,4 +349,13 @@ int putc_unlocked (int c, FILE *stream); #define DIMof(type,member) DIM(((type *)0)->member) +#if HAVE_W32_SYSTEM +#define SOCKET2HANDLE(s) ((void *)(s)) +#define HANDLE2SOCKET(h) ((unsigned int)(h)) +#else +#define SOCKET2HANDLE(s) (s) +#define HANDLE2SOCKET(h) (h) +#endif + + #endif /*ASSUAN_DEFS_H*/ diff -urpNP gpgme-1.1.8/assuan/assuan-errors.c gpgme-1.2.0/assuan/assuan-errors.c --- gpgme-1.1.8/assuan/assuan-errors.c 2008-12-08 18:42:06.000000000 +0000 +++ gpgme-1.2.0/assuan/assuan-errors.c 2009-06-18 16:14:52.000000000 +0000 @@ -11,6 +11,7 @@ #undef _ASSUAN_IN_LIBASSUAN /* undef to get all error codes. */ #include "assuan.h" +#include "assuan-defs.h" /* If true the modern gpg-error style error codes are used in the API. */ @@ -74,11 +75,8 @@ _assuan_error (int oldcode) { case 0: n = 16381; /*GPG_ERR_MISSING_ERRNO*/ break; case EAGAIN: - if (errno > 0 && errno < 4096) - { - n = (EAGAIN | (1 << 15)); - break; - } + n = (6 | (1 << 15)); + break; default: n = 270; /*GPG_ERR_ASS_READ_ERROR*/ break; } break; @@ -88,11 +86,8 @@ _assuan_error (int oldcode) { case 0: n = 16381; /*GPG_ERR_MISSING_ERRNO*/ break; case EAGAIN: - if (errno > 0 && errno < 4096) - { - n = (EAGAIN | (1 << 15)); - break; - } + n = (6 | (1 << 15)); + break; default: n = 271; /*GPG_ERR_ASS_WRITE_ERROR*/ break; } break; @@ -107,11 +102,8 @@ _assuan_error (int oldcode) n = 16381; /*GPG_ERR_MISSING_ERRNO*/ break; case ENOMEM: - if (errno > 0 && errno < 4096) - { - n = (ENOMEM | (1 << 15)); - break; - } + n = (86 | (1 << 15)); + break; default: n = 16382; /*GPG_ERR_UNKNOWN_ERRNO*/ break; @@ -130,6 +122,23 @@ _assuan_error (int oldcode) } +/* A small helper function to treat EAGAIN transparently to the + caller. */ +int +_assuan_error_is_eagain (assuan_error_t err) +{ + if ((!err_source && err == ASSUAN_Read_Error && errno == EAGAIN) + || (err_source && (err & ((1 << 24) - 1)) == (6 | (1 << 15)))) + { + /* Avoid spinning by sleeping for one tenth of a second. */ + _assuan_usleep (100000); + return 1; + } + else + return 0; +} + + /** * assuan_strerror: * @err: Error code diff -urpNP gpgme-1.1.8/assuan/assuan-handler.c gpgme-1.2.0/assuan/assuan-handler.c --- gpgme-1.1.8/assuan/assuan-handler.c 2007-07-12 19:23:29.000000000 +0000 +++ gpgme-1.2.0/assuan/assuan-handler.c 2009-04-08 16:39:34.000000000 +0000 @@ -1,5 +1,5 @@ /* assuan-handler.c - dispatch commands - * Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. + * Copyright (C) 2001, 2002, 2003, 2007 Free Software Foundation, Inc. * * This file is part of Assuan. * @@ -14,9 +14,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. + * License along with this program; if not, see . */ #include @@ -35,18 +33,21 @@ static int my_strcasecmp (const char *a, const char *b); +#define PROCESS_DONE(ctx, rc) \ + ((ctx)->in_process_next ? assuan_process_done ((ctx), (rc)) : (rc)) static int dummy_handler (assuan_context_t ctx, char *line) { - return set_error (ctx, Server_Fault, "no handler registered"); + return + PROCESS_DONE (ctx, set_error (ctx, Server_Fault, "no handler registered")); } static int std_handler_nop (assuan_context_t ctx, char *line) { - return 0; /* okay */ + return PROCESS_DONE (ctx, 0); /* okay */ } static int @@ -54,7 +55,7 @@ std_handler_cancel (assuan_context_t ctx { if (ctx->cancel_notify_fnc) ctx->cancel_notify_fnc (ctx); - return set_error (ctx, Not_Implemented, NULL); + return PROCESS_DONE (ctx, set_error (ctx, Not_Implemented, NULL)); } static int @@ -65,9 +66,12 @@ std_handler_option (assuan_context_t ctx for (key=line; spacep (key); key++) ; if (!*key) - return set_error (ctx, Syntax_Error, "argument required"); + return + PROCESS_DONE (ctx, set_error (ctx, Syntax_Error, "argument required")); if (*key == '=') - return set_error (ctx, Syntax_Error, "no option name given"); + return + PROCESS_DONE (ctx, set_error (ctx, Syntax_Error, + "no option name given")); for (value=key; *value && !spacep (value) && *value != '='; value++) ; if (*value) @@ -82,7 +86,9 @@ std_handler_option (assuan_context_t ctx for (; spacep (value); value++) ; if (!*value) - return set_error (ctx, Syntax_Error, "option argument expected"); + return + PROCESS_DONE (ctx, set_error (ctx, Syntax_Error, + "option argument expected")); } if (*value) { @@ -96,12 +102,13 @@ std_handler_option (assuan_context_t ctx if (*key == '-' && key[1] == '-' && key[2]) key += 2; /* the double dashes are optional */ if (*key == '-') - return set_error (ctx, Syntax_Error, - "option should not begin with one dash"); + return PROCESS_DONE (ctx, + set_error (ctx, Syntax_Error, + "option should not begin with one dash")); if (ctx->option_handler_fnc) - return ctx->option_handler_fnc (ctx, key, value); - return 0; + return PROCESS_DONE (ctx, ctx->option_handler_fnc (ctx, key, value)); + return PROCESS_DONE (ctx, 0); } static int @@ -111,13 +118,13 @@ std_handler_bye (assuan_context_t ctx, c ctx->bye_notify_fnc (ctx); assuan_close_input_fd (ctx); assuan_close_output_fd (ctx); - return -1; /* pretty simple :-) */ + return PROCESS_DONE (ctx, _assuan_error (-1)); /* pretty simple :-) */ } static int std_handler_auth (assuan_context_t ctx, char *line) { - return set_error (ctx, Not_Implemented, NULL); + return PROCESS_DONE (ctx, set_error (ctx, Not_Implemented, NULL)); } static int @@ -128,17 +135,35 @@ std_handler_reset (assuan_context_t ctx, assuan_close_input_fd (ctx); assuan_close_output_fd (ctx); _assuan_uds_close_fds (ctx); - return 0; + return PROCESS_DONE (ctx, 0); } static int +std_handler_help (assuan_context_t ctx, char *line) +{ + unsigned int i; + char buf[ASSUAN_LINELENGTH]; + + for (i = 0; i < ctx->cmdtbl_used; i++) + { + snprintf (buf, sizeof (buf), "# %s", ctx->cmdtbl[i].name); + buf[ASSUAN_LINELENGTH - 1] = '\0'; + assuan_write_line (ctx, buf); + } + + return PROCESS_DONE (ctx, 0); +} + + +static int std_handler_end (assuan_context_t ctx, char *line) { - return set_error (ctx, Not_Implemented, NULL); + return PROCESS_DONE (ctx, set_error (ctx, Not_Implemented, NULL)); } + assuan_error_t -assuan_command_parse_fd (assuan_context_t ctx, char *line, int *rfd) +assuan_command_parse_fd (assuan_context_t ctx, char *line, assuan_fd_t *rfd) { char *endp; @@ -151,7 +176,13 @@ assuan_command_parse_fd (assuan_context_ line ++; if (!digitp (*line)) return set_error (ctx, Syntax_Error, "number required"); +#ifdef HAVE_W32_SYSTEM + /* Fixme: For a W32/64bit system we will need to change the cast + and the conversion fucntion. */ + *rfd = (void*)strtoul (line, &endp, 10); +#else *rfd = strtoul (line, &endp, 10); +#endif /* Remove that argument so that a notify handler won't see it. */ memset (line, ' ', endp? (endp-line):strlen(line)); @@ -166,34 +197,37 @@ assuan_command_parse_fd (assuan_context_ return assuan_receivefd (ctx, rfd); } + /* Format is INPUT FD= */ static int std_handler_input (assuan_context_t ctx, char *line) { - int rc, fd; + int rc; + assuan_fd_t fd; rc = assuan_command_parse_fd (ctx, line, &fd); if (rc) - return rc; + return PROCESS_DONE (ctx, rc); ctx->input_fd = fd; if (ctx->input_notify_fnc) ctx->input_notify_fnc (ctx, line); - return 0; + return PROCESS_DONE (ctx, 0); } /* Format is OUTPUT FD= */ static int std_handler_output (assuan_context_t ctx, char *line) { - int rc, fd; + int rc; + assuan_fd_t fd; rc = assuan_command_parse_fd (ctx, line, &fd); if (rc) - return rc; + return PROCESS_DONE (ctx, rc); ctx->output_fd = fd; if (ctx->output_notify_fnc) ctx->output_notify_fnc (ctx, line); - return 0; + return PROCESS_DONE (ctx, 0); } @@ -215,11 +249,12 @@ static struct { { "AUTH", std_handler_auth, 1 }, { "RESET", std_handler_reset, 1 }, { "END", std_handler_end, 1 }, + { "HELP", std_handler_help, 1 }, - { "INPUT", std_handler_input }, - { "OUTPUT", std_handler_output }, + { "INPUT", std_handler_input, 0 }, + { "OUTPUT", std_handler_output, 0 }, { "OPTION", std_handler_option, 1 }, - { NULL } + { NULL, NULL, 0 } }; @@ -406,9 +441,10 @@ my_strcasecmp (const char *a, const char return *a == *b? 0 : (((*a >= 'a' && *a <= 'z')? (*a&~0x20):*a) - *b); } + /* Parse the line, break out the command, find it in the command table, remove leading and white spaces from the arguments, call the - handler with the argument line and return the error */ + handler with the argument line and return the error. */ static int dispatch_command (assuan_context_t ctx, char *line, int linelen) { @@ -416,13 +452,21 @@ dispatch_command (assuan_context_t ctx, const char *s; int shift, i; + /* Note that as this function is invoked by assuan_process_next as + well, we need to hide non-critical errors with PROCESS_DONE. */ + if (*line == 'D' && line[1] == ' ') /* divert to special handler */ - return handle_data_line (ctx, line+2, linelen-2); + /* FIXME: Depending on the final implementation of + handle_data_line, this may be wrong here. For example, if a + user callback is invoked, and that callback is responsible for + calling assuan_process_done, then this is wrong. */ + return PROCESS_DONE (ctx, handle_data_line (ctx, line+2, linelen-2)); for (p=line; *p && *p != ' ' && *p != '\t'; p++) ; if (p==line) - return set_error (ctx, Syntax_Error, "leading white-space"); + return PROCESS_DONE + (ctx, set_error (ctx, Syntax_Error, "leading white-space")); if (*p) { /* Skip over leading WS after the keyword */ *p++ = 0; @@ -445,7 +489,7 @@ dispatch_command (assuan_context_t ctx, } } if (!s) - return set_error (ctx, Unknown_Command, NULL); + return PROCESS_DONE (ctx, set_error (ctx, Unknown_Command, NULL)); line += shift; linelen -= shift; @@ -453,42 +497,34 @@ dispatch_command (assuan_context_t ctx, return ctx->cmdtbl[i].handler (ctx, line); } - - -static int -process_request (assuan_context_t ctx) +/* Call this to acknowledge the current command. */ +int +assuan_process_done (assuan_context_t ctx, int rc) { - int rc; + if (!ctx->in_command) + return _assuan_error (ASSUAN_General_Error); - if (ctx->in_inquire) - return _assuan_error (ASSUAN_Nested_Commands); - - rc = _assuan_read_line (ctx); - if (rc) - return rc; - if (*ctx->inbound.line == '#' || !ctx->inbound.linelen) - return 0; /* comment line - ignore */ + ctx->in_command = 0; - ctx->outbound.data.error = 0; - ctx->outbound.data.linelen = 0; - /* dispatch command and return reply */ - rc = dispatch_command (ctx, ctx->inbound.line, ctx->inbound.linelen); - /* check from data write errors */ + /* Check for data write errors. */ if (ctx->outbound.data.fp) - { /* Flush the data lines */ + { + /* Flush the data lines. */ fclose (ctx->outbound.data.fp); ctx->outbound.data.fp = NULL; if (!rc && ctx->outbound.data.error) - rc = ctx->outbound.data.error; + rc = ctx->outbound.data.error; } - else /* flush any data send w/o using the data fp */ + else { + /* Flush any data send without using the data FP. */ assuan_send_data (ctx, NULL, 0); if (!rc && ctx->outbound.data.error) - rc = ctx->outbound.data.error; + rc = ctx->outbound.data.error; } - /* Error handling */ + + /* Error handling. */ if (!rc) { rc = assuan_write_line (ctx, ctx->okay_line? ctx->okay_line : "OK"); @@ -501,26 +537,26 @@ process_request (assuan_context_t ctx) else { char errline[300]; - + if (rc < 100) sprintf (errline, "ERR %d server fault (%.50s)", _assuan_error (ASSUAN_Server_Fault), assuan_strerror (rc)); else { const char *text = ctx->err_no == rc? ctx->err_str:NULL; - + #if defined(HAVE_W32_SYSTEM) unsigned int source, code; char ebuf[50]; const char *esrc; - + source = ((rc >> 24) & 0xff); code = (rc & 0x00ffffff); if (source && !_assuan_gpg_strerror_r (rc, ebuf, sizeof ebuf) && (esrc=_assuan_gpg_strsource (rc))) { - /* Assume this is an libgpg-error. */ + /* Assume this is an libgpg-error. */ sprintf (errline, "ERR %d %.50s <%.30s>%s%.100s", rc, ebuf, esrc, text? " - ":"", text?text:""); @@ -554,7 +590,7 @@ process_request (assuan_context_t ctx) { /* Assume this is an libgpg-error. */ char ebuf[50]; - + gpg_strerror_r (rc, ebuf, sizeof ebuf ); sprintf (errline, "ERR %d %.50s <%.30s>%s%.100s", rc, @@ -569,19 +605,121 @@ process_request (assuan_context_t ctx) } rc = assuan_write_line (ctx, errline); } - + if (ctx->post_cmd_notify_fnc) ctx->post_cmd_notify_fnc (ctx, rc); - + ctx->confidential = 0; if (ctx->okay_line) { xfree (ctx->okay_line); ctx->okay_line = NULL; } + + return rc; +} + + +static int +process_next (assuan_context_t ctx) +{ + int rc; + + /* What the next thing to do is depends on the current state. + However, we will always first read the next line. The client is + required to write full lines without blocking long after starting + a partial line. */ + rc = _assuan_read_line (ctx); + if (rc) + return rc; + if (*ctx->inbound.line == '#' || !ctx->inbound.linelen) + /* Comment lines are ignored. */ + return 0; + + /* Now we have a line that really means something. It could be one + of the following things: First, if we are not in a command + already, it is the next command to dispatch. Second, if we are + in a command, it can only be the response to an INQUIRE + reply. */ + + if (!ctx->in_command) + { + ctx->in_command = 1; + + ctx->outbound.data.error = 0; + ctx->outbound.data.linelen = 0; + /* Dispatch command and return reply. */ + ctx->in_process_next = 1; + rc = dispatch_command (ctx, ctx->inbound.line, ctx->inbound.linelen); + ctx->in_process_next = 0; + } + else if (ctx->in_inquire) + { + /* FIXME: Pick up the continuation. */ + rc = _assuan_inquire_ext_cb (ctx); + } + else + { + /* Should not happen. The client is sending data while we are + in a command and not waiting for an inquire. We log an error + and discard it. */ + _assuan_log_printf ("unexpected client data\n"); + rc = 0; + } + return rc; } + +/* This function should be invoked when the assuan connected FD is + ready for reading. If the equivalent to EWOULDBLOCK is returned + (this should be done by the command handler), assuan_process_next + should be invoked the next time the connected FD is readable. + Eventually, the caller will finish by invoking + assuan_process_done. */ +int +assuan_process_next (assuan_context_t ctx) +{ + int rc; + + do + { + rc = process_next (ctx); + } + while (!rc && assuan_pending_line (ctx)); + + return rc; +} + + + +static int +process_request (assuan_context_t ctx) +{ + int rc; + + if (ctx->in_inquire) + return _assuan_error (ASSUAN_Nested_Commands); + + do + { + rc = _assuan_read_line (ctx); + } + while (_assuan_error_is_eagain (rc)); + if (rc) + return rc; + if (*ctx->inbound.line == '#' || !ctx->inbound.linelen) + return 0; /* comment line - ignore */ + + ctx->in_command = 1; + ctx->outbound.data.error = 0; + ctx->outbound.data.linelen = 0; + /* dispatch command and return reply */ + rc = dispatch_command (ctx, ctx->inbound.line, ctx->inbound.linelen); + + return assuan_process_done (ctx, rc); +} + /** * assuan_process: * @ctx: assuan context @@ -610,24 +748,6 @@ assuan_process (assuan_context_t ctx) /** - * assuan_process_next: - * @ctx: Assuan context - * - * Same as assuan_process() but the user has to provide the outer - * loop. He should loop as long as the return code is zero and stop - * otherwise; -1 is regular end. - * - * See also: assuan_get_active_fds() - * Return value: -1 for end of server, 0 on success or an error code - **/ -int -assuan_process_next (assuan_context_t ctx) -{ - return process_request (ctx); -} - - -/** * assuan_get_active_fds: * @ctx: Assuan context * @what: 0 for read fds, 1 for write fds @@ -646,7 +766,7 @@ assuan_process_next (assuan_context_t ct **/ int assuan_get_active_fds (assuan_context_t ctx, int what, - int *fdarray, int fdarraysize) + assuan_fd_t *fdarray, int fdarraysize) { int n = 0; @@ -655,16 +775,16 @@ assuan_get_active_fds (assuan_context_t if (!what) { - if (ctx->inbound.fd != -1) + if (ctx->inbound.fd != ASSUAN_INVALID_FD) fdarray[n++] = ctx->inbound.fd; } else { - if (ctx->outbound.fd != -1) + if (ctx->outbound.fd != ASSUAN_INVALID_FD) fdarray[n++] = ctx->outbound.fd; if (ctx->outbound.data.fp) #ifdef HAVE_W32_SYSTEM - fdarray[n++] = _get_osfhandle (fileno (ctx->outbound.data.fp)); + fdarray[n++] = (void*)_get_osfhandle (fileno (ctx->outbound.data.fp)); #else fdarray[n++] = fileno (ctx->outbound.data.fp); #endif diff -urpNP gpgme-1.1.8/assuan/assuan-inquire.c gpgme-1.2.0/assuan/assuan-inquire.c --- gpgme-1.1.8/assuan/assuan-inquire.c 2006-09-19 13:22:27.000000000 +0000 +++ gpgme-1.2.0/assuan/assuan-inquire.c 2009-04-08 16:39:34.000000000 +0000 @@ -1,5 +1,5 @@ /* assuan-inquire.c - handle inquire stuff - * Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. + * Copyright (C) 2001, 2002, 2003, 2005, 2007 Free Software Foundation, Inc. * * This file is part of Assuan. * @@ -14,9 +14,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. + * License along with this program; if not, see . */ #include @@ -44,7 +42,7 @@ struct membuf -/* A simple implemnation of a dynamic buffer. Use init_membuf() to +/* A simple implementation of a dynamic buffer. Use init_membuf() to create a buffer, put_membuf to append bytes and get_membuf to release and return the buffer. Allocation errors are detected but only returned at the final get_membuf(), this helps not to clutter @@ -171,7 +169,7 @@ assuan_inquire (assuan_context_t ctx, co { do { - rc = _assuan_read_line (ctx); + rc = _assuan_read_line (ctx); if (rc) goto leave; line = (unsigned char *) ctx->inbound.line; @@ -234,8 +232,154 @@ assuan_inquire (assuan_context_t ctx, co return rc; } + +void +_assuan_inquire_release (assuan_context_t ctx) +{ + if (ctx->in_inquire) + { + if (ctx->inquire_membuf) + { + free_membuf (ctx->inquire_membuf); + free (ctx->inquire_membuf); + } + ctx->in_inquire = 0; + } +} +int +_assuan_inquire_ext_cb (assuan_context_t ctx) +{ + int rc; + unsigned char *line; + int linelen; + struct membuf *mb; + unsigned char *p; + + line = (unsigned char *) ctx->inbound.line; + linelen = ctx->inbound.linelen; + mb = ctx->inquire_membuf; + + if (line[0] == 'C' && line[1] == 'A' && line[2] == 'N') + { + rc = _assuan_error (ASSUAN_Canceled); + goto leave; + } + if (line[0] == 'E' && line[1] == 'N' && line[2] == 'D' + && (!line[3] || line[3] == ' ')) + { + rc = 0; + goto leave; + } + + if (line[0] != 'D' || line[1] != ' ' || mb == NULL) + { + rc = _assuan_error (ASSUAN_Unexpected_Command); + goto leave; + } + + if (linelen < 3) + return 0; + line += 2; + linelen -= 2; + + p = line; + while (linelen) + { + for (;linelen && *p != '%'; linelen--, p++) + ; + put_membuf (mb, line, p-line); + if (linelen > 2) + { /* handle escaping */ + unsigned char tmp[1]; + p++; + *tmp = xtoi_2 (p); + p += 2; + linelen -= 3; + put_membuf (mb, tmp, 1); + } + line = p; + } + if (mb->too_large) + { + rc = _assuan_error (ASSUAN_Too_Much_Data); + goto leave; + } + return 0; + leave: + { + size_t buf_len = 0; + unsigned char *buf = NULL; + + if (mb) + { + buf = get_membuf (mb, &buf_len); + if (!buf) + rc = _assuan_error (ASSUAN_Out_Of_Core); + free_membuf (mb); + free (mb); + ctx->inquire_membuf = NULL; + } + ctx->in_inquire = 0; + rc = (ctx->inquire_cb) (ctx->inquire_cb_data, rc, buf, buf_len); + } + return rc; +} +/** + * assuan_inquire_ext: + * @ctx: An assuan context + * @keyword: The keyword used for the inquire + * @maxlen: If not 0, the size limit of the inquired data. + * @cb: A callback handler which is invoked after the operation completed. + * @cb_data: A user-provided value passed to the callback handler. + * + * A Server may use this to Send an inquire. r_buffer, r_length and + * maxlen may all be NULL/0 to indicate that no real data is expected. + * When this function returns, + * + * Return value: 0 on success or an ASSUAN error code + **/ +assuan_error_t +assuan_inquire_ext (assuan_context_t ctx, const char *keyword, size_t maxlen, + int (*cb) (void *cb_data, int rc, unsigned char *buf, + size_t len), + void *cb_data) +{ + assuan_error_t rc; + struct membuf *mb = NULL; + char cmdbuf[LINELENGTH-10]; /* (10 = strlen ("INQUIRE ")+CR,LF) */ + + if (!ctx || !keyword || (10 + strlen (keyword) >= sizeof (cmdbuf))) + return _assuan_error (ASSUAN_Invalid_Value); + if (!ctx->is_server) + return _assuan_error (ASSUAN_Not_A_Server); + if (ctx->in_inquire) + return _assuan_error (ASSUAN_Nested_Commands); + + mb = malloc (sizeof (struct membuf)); + if (!mb) + return _assuan_error (ASSUAN_Out_Of_Core); + init_membuf (mb, maxlen ? maxlen : 1024, maxlen); + + strcpy (stpcpy (cmdbuf, "INQUIRE "), keyword); + rc = assuan_write_line (ctx, cmdbuf); + if (rc) + { + free_membuf (mb); + free (mb); + return rc; + } + + ctx->in_inquire = 1; + + /* Set up the continuation. */ + ctx->inquire_cb = cb; + ctx->inquire_cb_data = cb_data; + ctx->inquire_membuf = mb; + + return 0; +} diff -urpNP gpgme-1.1.8/assuan/assuan-io.c gpgme-1.2.0/assuan/assuan-io.c --- gpgme-1.1.8/assuan/assuan-io.c 2007-07-13 00:44:14.000000000 +0000 +++ gpgme-1.2.0/assuan/assuan-io.c 2009-03-09 14:10:31.000000000 +0000 @@ -1,5 +1,5 @@ /* assuan-io.c - Wraps the read and write functions. - * Copyright (C) 2002, 2004, 2006 Free Software Foundation, Inc. + * Copyright (C) 2002, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. * * This file is part of Assuan. * @@ -14,15 +14,14 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. + * License along with this program; if not, see . */ #ifdef HAVE_CONFIG_H #include #endif +#include #include #include #ifdef HAVE_SYS_SOCKET_H @@ -48,8 +47,8 @@ _assuan_waitpid (pid_t pid, int *status, #endif -ssize_t -_assuan_simple_read (assuan_context_t ctx, void *buffer, size_t size) +static ssize_t +do_io_read (assuan_fd_t fd, void *buffer, size_t size) { #if defined(HAVE_W32_SYSTEM) && !defined(_ASSUAN_IN_GPGME_BUILD_ASSUAN) /* Due to the peculiarities of the W32 API we can't use read for a @@ -57,32 +56,71 @@ _assuan_simple_read (assuan_context_t ct read if recv detects that it is not a network socket. */ int n; - n = recv (ctx->inbound.fd, buffer, size, 0); - if (n == -1 && WSAGetLastError () == WSAENOTSOCK) + n = recv (HANDLE2SOCKET(fd), buffer, size, 0); + if (n == -1) { - DWORD nread = 0; - - n = ReadFile ((HANDLE)ctx->inbound.fd, buffer, size, &nread, NULL); - if (!n) + switch (WSAGetLastError ()) { - switch (GetLastError()) - { - case ERROR_BROKEN_PIPE: errno = EPIPE; break; - default: errno = EIO; - } - n = -1; + case WSAENOTSOCK: + { + DWORD nread = 0; + + n = ReadFile (fd, buffer, size, &nread, NULL); + if (!n) + { + switch (GetLastError()) + { + case ERROR_BROKEN_PIPE: errno = EPIPE; break; + default: errno = EIO; + } + n = -1; + } + else + n = (int)nread; + } + break; + + case WSAEWOULDBLOCK: errno = EAGAIN; break; + case ERROR_BROKEN_PIPE: errno = EPIPE; break; + default: errno = EIO; break; } - else - n = (int)nread; } return n; #else /*!HAVE_W32_SYSTEM*/ - return read (ctx->inbound.fd, buffer, size); + return read (fd, buffer, size); #endif /*!HAVE_W32_SYSTEM*/ } + ssize_t -_assuan_simple_write (assuan_context_t ctx, const void *buffer, size_t size) +_assuan_io_read (assuan_fd_t fd, void *buffer, size_t size) +{ + ssize_t retval; + + if (_assuan_io_hooks.read_hook + && _assuan_io_hooks.read_hook (NULL, fd, buffer, size, &retval) == 1) + return retval; + + return do_io_read (fd, buffer, size); +} + +ssize_t +_assuan_simple_read (assuan_context_t ctx, void *buffer, size_t size) +{ + ssize_t retval; + + if (_assuan_io_hooks.read_hook + && _assuan_io_hooks.read_hook (ctx, ctx->inbound.fd, + buffer, size, &retval) == 1) + return retval; + + return do_io_read (ctx->inbound.fd, buffer, size); +} + + + +static ssize_t +do_io_write (assuan_fd_t fd, const void *buffer, size_t size) { #if defined(HAVE_W32_SYSTEM) && !defined(_ASSUAN_IN_GPGME_BUILD_ASSUAN) /* Due to the peculiarities of the W32 API we can't use write for a @@ -90,12 +128,12 @@ _assuan_simple_write (assuan_context_t c write if send detects that it is not a network socket. */ int n; - n = send (ctx->outbound.fd, buffer, size, 0); + n = send (HANDLE2SOCKET(fd), buffer, size, 0); if (n == -1 && WSAGetLastError () == WSAENOTSOCK) { DWORD nwrite; - n = WriteFile ((HANDLE)ctx->outbound.fd, buffer, size, &nwrite, NULL); + n = WriteFile (fd, buffer, size, &nwrite, NULL); if (!n) { switch (GetLastError ()) @@ -111,10 +149,34 @@ _assuan_simple_write (assuan_context_t c } return n; #else /*!HAVE_W32_SYSTEM*/ - return write (ctx->outbound.fd, buffer, size); + return write (fd, buffer, size); #endif /*!HAVE_W32_SYSTEM*/ } +ssize_t +_assuan_io_write (assuan_fd_t fd, const void *buffer, size_t size) +{ + ssize_t retval; + + if (_assuan_io_hooks.write_hook + && _assuan_io_hooks.write_hook (NULL, fd, buffer, size, &retval) == 1) + return retval; + return do_io_write (fd, buffer, size); +} + +ssize_t +_assuan_simple_write (assuan_context_t ctx, const void *buffer, size_t size) +{ + ssize_t retval; + + if (_assuan_io_hooks.write_hook + && _assuan_io_hooks.write_hook (ctx, ctx->outbound.fd, + buffer, size, &retval) == 1) + return retval; + + return do_io_write (ctx->outbound.fd, buffer, size); +} + #ifdef HAVE_W32_SYSTEM int @@ -152,3 +214,32 @@ _assuan_simple_recvmsg (assuan_context_t return ret; #endif } + + +void +_assuan_usleep (unsigned int usec) +{ + if (usec) + { +#ifdef HAVE_NANOSLEEP + struct timespec req; + struct timespec rem; + + req.tv_sec = 0; + req.tv_nsec = usec * 1000; + + while (nanosleep (&req, &rem) < 0 && errno == EINTR) + req = rem; + +#elif defined(HAVE_W32_SYSTEM) + Sleep (usec / 1000); +#else + struct timeval tv; + + tv.tv_sec = usec / 1000000; + tv.tv_usec = usec % 1000000; + select (0, NULL, NULL, NULL, &tv); +#endif + } +} + diff -urpNP gpgme-1.1.8/assuan/assuan-listen.c gpgme-1.2.0/assuan/assuan-listen.c --- gpgme-1.1.8/assuan/assuan-listen.c 2006-09-19 13:22:27.000000000 +0000 +++ gpgme-1.2.0/assuan/assuan-listen.c 2009-03-09 14:10:31.000000000 +0000 @@ -14,9 +14,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. + * License along with this program; if not, see . */ #include @@ -116,17 +114,17 @@ assuan_accept (assuan_context_t ctx) -int +assuan_fd_t assuan_get_input_fd (assuan_context_t ctx) { - return ctx? ctx->input_fd : -1; + return ctx? ctx->input_fd : ASSUAN_INVALID_FD; } -int +assuan_fd_t assuan_get_output_fd (assuan_context_t ctx) { - return ctx? ctx->output_fd : -1; + return ctx? ctx->output_fd : ASSUAN_INVALID_FD; } @@ -135,10 +133,10 @@ assuan_get_output_fd (assuan_context_t c assuan_error_t assuan_close_input_fd (assuan_context_t ctx) { - if (!ctx || ctx->input_fd == -1) + if (!ctx || ctx->input_fd == ASSUAN_INVALID_FD) return _assuan_error (ASSUAN_Invalid_Value); _assuan_close (ctx->input_fd); - ctx->input_fd = -1; + ctx->input_fd = ASSUAN_INVALID_FD; return 0; } @@ -147,11 +145,11 @@ assuan_close_input_fd (assuan_context_t assuan_error_t assuan_close_output_fd (assuan_context_t ctx) { - if (!ctx || ctx->output_fd == -1) + if (!ctx || ctx->output_fd == ASSUAN_INVALID_FD) return _assuan_error (ASSUAN_Invalid_Value); _assuan_close (ctx->output_fd); - ctx->output_fd = -1; + ctx->output_fd = ASSUAN_INVALID_FD; return 0; } diff -urpNP gpgme-1.1.8/assuan/assuan-logging.c gpgme-1.2.0/assuan/assuan-logging.c --- gpgme-1.1.8/assuan/assuan-logging.c 2007-08-09 20:20:36.000000000 +0000 +++ gpgme-1.2.0/assuan/assuan-logging.c 2009-03-09 14:10:31.000000000 +0000 @@ -14,9 +14,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. + * License along with this program; if not, see . */ #ifdef HAVE_CONFIG_H @@ -37,23 +35,6 @@ static char prefix_buffer[80]; static FILE *_assuan_log; static int full_logging; -static int log_level = 1; /* Defaults to logging enabled. */ - - -/* Set the log level for general assuan commands. 0 is no logging at - all, 1 is the standard logging and the default. Higher leveles may - be defined in the future. Passing a level of -1 will not change - the current log level. Returns previosu log level. */ -int -assuan_set_assuan_log_level (int level) -{ - int old = log_level; - - if (level != -1) - log_level = level; - return old; -} - void _assuan_set_default_log_stream (FILE *fp) @@ -122,9 +103,6 @@ _assuan_log_printf (const char *format, FILE *fp; const char *prf; int save_errno = errno; - - if (!log_level) - return; fp = assuan_get_assuan_log_stream (); prf = assuan_get_assuan_log_prefix (); @@ -134,29 +112,31 @@ _assuan_log_printf (const char *format, va_start (arg_ptr, format); vfprintf (fp, format, arg_ptr ); va_end (arg_ptr); + /* If the log stream is a file, the output would be buffered. This + is bad for debugging, thus we flush the stream if FORMAT ends + with a LF. */ + if (format && *format && format[strlen(format)-1] == '\n') + fflush (fp); errno = save_errno; } /* Dump a possibly binary string (used for debugging). Distinguish ascii text from binary and print it accordingly. This function - takes FILE pointer arg becuase logging may be enabled on a per - context basis. */ + takes FILE pointer arg because logging may be enabled on a per + context basis. */ void _assuan_log_print_buffer (FILE *fp, const void *buffer, size_t length) { const unsigned char *s; - int n; - - if (!log_level) - return; + unsigned int n; - for (n=length,s=buffer; n; n--, s++) - if ((!isascii (*s) || iscntrl (*s) || !isprint (*s)) && !(*s >= 0x80)) + for (n = length, s = buffer; n; n--, s++) + if ((! isascii (*s) || iscntrl (*s) || ! isprint (*s)) && !(*s >= 0x80)) break; s = buffer; - if (!n && *s != '[') + if (! n && *s != '[') fwrite (buffer, length, 1, fp); else { @@ -164,15 +144,15 @@ _assuan_log_print_buffer (FILE *fp, cons flockfile (fp); #endif putc_unlocked ('[', fp); - if ( length > 16 && !full_logging) + if (length > 16 && ! full_logging) { - for (n=0; n < 12; n++, s++) + for (n = 0; n < 12; n++, s++) fprintf (fp, " %02x", *s); - fprintf (fp, " ...(%d bytes skipped)", (int)length - 12); + fprintf (fp, " ...(%d bytes skipped)", (int) length - 12); } else { - for (n=0; n < length; n++, s++) + for (n = 0; n < length; n++, s++) fprintf (fp, " %02x", *s); } putc_unlocked (' ', fp); @@ -189,16 +169,11 @@ void _assuan_log_sanitized_string (const char *string) { const unsigned char *s = (const unsigned char *) string; - FILE *fp; + FILE *fp = assuan_get_assuan_log_stream (); - if (!log_level) + if (! *s) return; - if (!*s) - return; - - fp = assuan_get_assuan_log_stream (); - #ifdef HAVE_FLOCKFILE flockfile (fp); #endif diff -urpNP gpgme-1.1.8/assuan/assuan-pipe-connect.c gpgme-1.2.0/assuan/assuan-pipe-connect.c --- gpgme-1.1.8/assuan/assuan-pipe-connect.c 2008-11-03 15:24:19.000000000 +0000 +++ gpgme-1.2.0/assuan/assuan-pipe-connect.c 2009-06-17 12:36:07.000000000 +0000 @@ -1,5 +1,6 @@ /* assuan-pipe-connect.c - Establish a pipe connection (client) - * Copyright (C) 2001, 2002, 2003, 2005, 2006 Free Software Foundation, Inc. + * Copyright (C) 2001, 2002, 2003, 2005, 2006, + * 2007 Free Software Foundation, Inc. * * This file is part of Assuan. * @@ -14,9 +15,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. + * License along with this program; if not, see . */ #ifdef HAVE_CONFIG_H @@ -52,7 +51,7 @@ struct spawn_fd_item_s int _gpgme_io_pipe (int filedes[2], int inherit_idx); -int _gpgme_io_spawn (const char *path, char *const argv[], +int _gpgme_io_spawn (const char *path, char *const argv[], unsigned int flags, struct spawn_fd_item_s *fd_list, pid_t *r_pid); #endif @@ -75,17 +74,6 @@ int _gpgme_io_spawn (const char *path, c #define MAX_OPEN_FDS 20 #endif -#ifdef HAVE_W32_SYSTEM -/* We assume that a HANDLE can be represented by an int which should - be true for all i386 systems (HANDLE is defined as void *) and - these are the only systems for which Windows is available. Further - we assume that -1 denotes an invalid handle. */ -#define fd_to_handle(a) ((HANDLE)(a)) -#define handle_to_fd(a) ((int)(a)) -#define pid_to_handle(a) ((HANDLE)(a)) -#define handle_to_pid(a) ((int)(a)) -#endif /*HAVE_W32_SYSTEM*/ - /* This should be called to make sure that SIGPIPE gets ignored. */ static void @@ -139,31 +127,35 @@ writen (int fd, const char *buffer, size static int do_finish (assuan_context_t ctx) { - if (ctx->inbound.fd != -1) + if (ctx->inbound.fd != ASSUAN_INVALID_FD) { _assuan_close (ctx->inbound.fd); if (ctx->inbound.fd == ctx->outbound.fd) - ctx->outbound.fd = -1; - ctx->inbound.fd = -1; + ctx->outbound.fd = ASSUAN_INVALID_FD; + ctx->inbound.fd = ASSUAN_INVALID_FD; } - if (ctx->outbound.fd != -1) + if (ctx->outbound.fd != ASSUAN_INVALID_FD) { _assuan_close (ctx->outbound.fd); - ctx->outbound.fd = -1; + ctx->outbound.fd = ASSUAN_INVALID_FD; } - if (ctx->pid != -1 && ctx->pid) + if (ctx->pid != (pid_t)(-1) && ctx->pid) { #ifndef HAVE_W32_SYSTEM #ifndef _ASSUAN_USE_DOUBLE_FORK if (!ctx->flags.no_waitpid) _assuan_waitpid (ctx->pid, NULL, 0); - ctx->pid = -1; + ctx->pid =(pid_t)(-1); #endif -#endif /*!HAVE_W32_SYSTEM*/ +#else /*!HAVE_W32_SYSTEM*/ + CloseHandle ((HANDLE) ctx->pid); + ctx->pid = (pid_t) INVALID_HANDLE_VALUE; +#endif /*HAVE_W32_SYSTEM*/ } return 0; } + static void do_deinit (assuan_context_t ctx) { @@ -209,13 +201,15 @@ pipe_connect_unix (assuan_context_t *ctx const char *name, const char *const argv[], int *fd_child_list, void (*atfork) (void *opaque, int reserved), - void *atforkvalue) + void *atforkvalue, unsigned int flags) { assuan_error_t err; int rp[2]; int wp[2]; char mypidstr[50]; + (void)flags; + if (!ctx || !name || !argv || !argv[0]) return _assuan_error (ASSUAN_Invalid_Value); @@ -581,7 +575,7 @@ pipe_connect_gpgme (assuan_context_t *ct const char *name, const char *const argv[], int *fd_child_list, void (*atfork) (void *opaque, int reserved), - void *atforkvalue) + void *atforkvalue, unsigned int flags) { assuan_error_t err; int res; @@ -665,7 +659,7 @@ pipe_connect_gpgme (assuan_context_t *ct child_fds[nr].dup_to = -1; /* Start the process. */ - res = _gpgme_io_spawn (name, (char *const *) argv, child_fds, NULL); + res = _gpgme_io_spawn (name, (char *const *) argv, 0, child_fds, NULL); if (res == -1) { _assuan_log_printf ("CreateProcess failed: %s\n", strerror (errno)); @@ -744,9 +738,9 @@ build_w32_commandline (const char * cons #ifdef HAVE_W32_SYSTEM -/* Create pipe where one end is inheritable. */ +/* Create pipe where one end end is inheritable. */ static int -create_inheritable_pipe (int filedes[2], int for_write) +create_inheritable_pipe (assuan_fd_t filedes[2], int for_write) { HANDLE r, w, h; SECURITY_ATTRIBUTES sec_attr; @@ -781,14 +775,12 @@ create_inheritable_pipe (int filedes[2], w = h; } - _assuan_log_printf ("created pipe: read=%p%s, write=%p%s\n", - r, for_write? " (inherit)":"", - w, for_write? "":" (inherit)"); - filedes[0] = handle_to_fd (r); - filedes[1] = handle_to_fd (w); + filedes[0] = r; + filedes[1] = w; return 0; } -#endif /* HAVE_W32_SYSTEM */ +#endif /*HAVE_W32_SYSTEM*/ + #ifdef HAVE_W32_SYSTEM #define pipe_connect pipe_connect_w32 @@ -798,11 +790,11 @@ pipe_connect_w32 (assuan_context_t *ctx, const char *name, const char *const argv[], int *fd_child_list, void (*atfork) (void *opaque, int reserved), - void *atforkvalue) + void *atforkvalue, unsigned int flags) { assuan_error_t err; - int rp[2]; - int wp[2]; + assuan_fd_t rp[2]; + assuan_fd_t wp[2]; char mypidstr[50]; char *cmdline; SECURITY_ATTRIBUTES sec_attr; @@ -837,8 +829,8 @@ pipe_connect_w32 (assuan_context_t *ctx, if (create_inheritable_pipe (wp, 1)) { - CloseHandle (fd_to_handle (rp[0])); - CloseHandle (fd_to_handle (rp[1])); + CloseHandle (rp[0]); + CloseHandle (rp[1]); xfree (cmdline); return _assuan_error (ASSUAN_General_Error); } @@ -847,10 +839,10 @@ pipe_connect_w32 (assuan_context_t *ctx, err = _assuan_new_context (ctx); if (err) { - CloseHandle (fd_to_handle (rp[0])); - CloseHandle (fd_to_handle (rp[1])); - CloseHandle (fd_to_handle (wp[0])); - CloseHandle (fd_to_handle (wp[1])); + CloseHandle (rp[0]); + CloseHandle (rp[1]); + CloseHandle (wp[0]); + CloseHandle (wp[1]); xfree (cmdline); return _assuan_error (ASSUAN_General_Error); } @@ -877,8 +869,8 @@ pipe_connect_w32 (assuan_context_t *ctx, memset (&si, 0, sizeof si); si.cb = sizeof (si); si.dwFlags = STARTF_USESTDHANDLES; - si.hStdInput = fd_to_handle (wp[0]); - si.hStdOutput = fd_to_handle (rp[1]); + si.hStdInput = wp[0]; + si.hStdOutput = rp[1]; /* Dup stderr to /dev/null unless it is in the list of FDs to be passed to the child. */ @@ -894,14 +886,13 @@ pipe_connect_w32 (assuan_context_t *ctx, nullfd = CreateFile ("nul", GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); - _assuan_log_printf ("created nul device, hd=%p\n", nullfd); if (nullfd == INVALID_HANDLE_VALUE) { _assuan_log_printf ("can't open `nul': %s\n", w32_strerror (-1)); - CloseHandle (fd_to_handle (rp[0])); - CloseHandle (fd_to_handle (rp[1])); - CloseHandle (fd_to_handle (wp[0])); - CloseHandle (fd_to_handle (wp[1])); + CloseHandle (rp[0]); + CloseHandle (rp[1]); + CloseHandle (wp[0]); + CloseHandle (wp[1]); xfree (cmdline); _assuan_release_context (*ctx); return -1; @@ -909,23 +900,21 @@ pipe_connect_w32 (assuan_context_t *ctx, si.hStdError = nullfd; } else - si.hStdError = fd_to_handle (_get_osfhandle (fd)); + si.hStdError = (void*)_get_osfhandle (fd); /* Note: We inherit all handles flagged as inheritable. This seems to be a security flaw but there seems to be no way of selecting handles to inherit. */ - _assuan_log_printf ("CreateProcess, path=`%s' cmdline=`%s'\n", - name, cmdline); - _assuan_log_printf (" stdin=%p stdout=%p stderr=%p\n", - si.hStdInput, si.hStdOutput, si.hStdError); + /* _assuan_log_printf ("CreateProcess, path=`%s' cmdline=`%s'\n", */ + /* name, cmdline); */ if (!CreateProcess (name, /* Program to start. */ cmdline, /* Command line arguments. */ &sec_attr, /* Process security attributes. */ &sec_attr, /* Thread security attributes. */ TRUE, /* Inherit handles. */ (CREATE_DEFAULT_ERROR_MODE - | DETACHED_PROCESS + | ((flags & 128)? DETACHED_PROCESS : 0) | GetPriorityClass (GetCurrentProcess ()) | CREATE_SUSPENDED), /* Creation flags. */ NULL, /* Environment. */ @@ -935,10 +924,10 @@ pipe_connect_w32 (assuan_context_t *ctx, )) { _assuan_log_printf ("CreateProcess failed: %s\n", w32_strerror (-1)); - CloseHandle (fd_to_handle (rp[0])); - CloseHandle (fd_to_handle (rp[1])); - CloseHandle (fd_to_handle (wp[0])); - CloseHandle (fd_to_handle (wp[1])); + CloseHandle (rp[0]); + CloseHandle (rp[1]); + CloseHandle (wp[0]); + CloseHandle (wp[1]); if (nullfd != INVALID_HANDLE_VALUE) CloseHandle (nullfd); xfree (cmdline); @@ -953,20 +942,17 @@ pipe_connect_w32 (assuan_context_t *ctx, nullfd = INVALID_HANDLE_VALUE; } - _assuan_log_printf ("closing handles %p and %p\n", - fd_to_handle (rp[1]), fd_to_handle (wp[0]) ); - CloseHandle (fd_to_handle (rp[1])); - CloseHandle (fd_to_handle (wp[0])); - - _assuan_log_printf ("CreateProcess ready: hProcess=%p hThread=%p" - " dwProcessID=%d dwThreadId=%d\n", - pi.hProcess, pi.hThread, - (int) pi.dwProcessId, (int) pi.dwThreadId); + CloseHandle (rp[1]); + CloseHandle (wp[0]); + + /* _assuan_log_printf ("CreateProcess ready: hProcess=%p hThread=%p" */ + /* " dwProcessID=%d dwThreadId=%d\n", */ + /* pi.hProcess, pi.hThread, */ + /* (int) pi.dwProcessId, (int) pi.dwThreadId); */ ResumeThread (pi.hThread); CloseHandle (pi.hThread); - (*ctx)->pid = 0; /* We don't use the PID. */ - CloseHandle (pi.hProcess); /* We don't need to wait for the process. */ + (*ctx)->pid = (pid_t) pi.hProcess; return initial_handshake (ctx); } @@ -982,7 +968,7 @@ assuan_error_t assuan_pipe_connect (assuan_context_t *ctx, const char *name, const char *const argv[], int *fd_child_list) { - return pipe_connect (ctx, name, argv, fd_child_list, NULL, NULL); + return pipe_connect (ctx, name, argv, fd_child_list, NULL, NULL, 0); } @@ -994,7 +980,7 @@ assuan_pipe_connect2 (assuan_context_t * void (*atfork) (void *opaque, int reserved), void *atforkvalue) { - return pipe_connect (ctx, name, argv, fd_child_list, atfork, atforkvalue); + return pipe_connect (ctx, name, argv, fd_child_list, atfork, atforkvalue, 0); } @@ -1007,9 +993,19 @@ assuan_pipe_connect2 (assuan_context_t * as the second argument. The ATFORK function should only act if the second value is 0. - For now FLAGS may either take the value 0 to behave like - assuan_pipe_connect2 or 1 to enable the described full-duplex - socket behaviour. + FLAGS is a bit vector and controls how the function acts: + Bit 0: If cleared a simple pipe based server is expected and the + function behaves similar to `assuan_pipe_connect'. + + If set a server based on full-duplex pipes is expected. Such + pipes are usually created using the `socketpair' function. + It also enables features only available with such servers. + + Bit 7: If set and there is a need to start ther server it will be + started as a background process. This flag is useful under + W32 systems, so that no new console is created and pops up a + console window when starting the server + If NAME as well as ARGV are NULL, no exec is done but the same process is continued. However all file descriptors are closed and @@ -1033,6 +1029,7 @@ assuan_pipe_connect_ext (assuan_context_ #endif } else - return pipe_connect (ctx, name, argv, fd_child_list, atfork, atforkvalue); + return pipe_connect (ctx, name, argv, fd_child_list, atfork, atforkvalue, + flags); } diff -urpNP gpgme-1.1.8/assuan/assuan-pipe-server.c gpgme-1.2.0/assuan/assuan-pipe-server.c --- gpgme-1.1.8/assuan/assuan-pipe-server.c 2007-07-04 20:08:19.000000000 +0000 +++ gpgme-1.2.0/assuan/assuan-pipe-server.c 2009-03-09 14:10:31.000000000 +0000 @@ -14,9 +14,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. + * License along with this program; if not, see . */ #include @@ -69,14 +67,14 @@ _assuan_new_context (assuan_context_t *r ctx = xtrycalloc (1, sizeof *ctx); if (!ctx) return _assuan_error (ASSUAN_Out_Of_Core); - ctx->input_fd = -1; - ctx->output_fd = -1; + ctx->input_fd = ASSUAN_INVALID_FD; + ctx->output_fd = ASSUAN_INVALID_FD; - ctx->inbound.fd = -1; - ctx->outbound.fd = -1; + ctx->inbound.fd = ASSUAN_INVALID_FD; + ctx->outbound.fd = ASSUAN_INVALID_FD; ctx->io = &io; - ctx->listen_fd = -1; + ctx->listen_fd = ASSUAN_INVALID_FD; /* Use the pipe server handler as a default. */ ctx->deinit_handler = deinit_pipe_server; ctx->accept_handler = accept_connection; @@ -121,11 +119,11 @@ assuan_init_pipe_server (assuan_context_ #ifdef HAVE_W32_SYSTEM /* MS Windows has so many different types of handle that one needs to tranlsate them at many place forth and back. Also - make sure that the fiel descriptos are in binary mode. */ + make sure that the file descriptors are in binary mode. */ setmode (filedes[0], O_BINARY); setmode (filedes[1], O_BINARY); - ctx->inbound.fd = _get_osfhandle (filedes[0]); - ctx->outbound.fd = _get_osfhandle (filedes[1]); + ctx->inbound.fd = (void*)_get_osfhandle (filedes[0]); + ctx->outbound.fd = (void*)_get_osfhandle (filedes[1]); #else s = getenv ("_assuan_connection_fd"); if (s && *s && is_valid_socket (s) ) @@ -137,7 +135,8 @@ assuan_init_pipe_server (assuan_context_ _assuan_init_uds_io (ctx); ctx->deinit_handler = _assuan_uds_deinit; } - else if (filedes && filedes[0] != -1 && filedes[1] != -1 ) + else if (filedes && filedes[0] != ASSUAN_INVALID_FD + && filedes[1] != ASSUAN_INVALID_FD ) { /* Standard pipe server. */ ctx->inbound.fd = filedes[0]; @@ -168,6 +167,7 @@ _assuan_release_context (assuan_context_ { if (ctx) { + _assuan_inquire_release (ctx); xfree (ctx->hello_line); xfree (ctx->okay_line); xfree (ctx->cmdtbl); diff -urpNP gpgme-1.1.8/assuan/assuan-socket-connect.c gpgme-1.2.0/assuan/assuan-socket-connect.c --- gpgme-1.1.8/assuan/assuan-socket-connect.c 2006-09-19 13:22:27.000000000 +0000 +++ gpgme-1.2.0/assuan/assuan-socket-connect.c 2009-03-09 14:10:31.000000000 +0000 @@ -14,9 +14,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. + * License along with this program; if not, see . */ #include @@ -57,12 +55,12 @@ static int do_finish (assuan_context_t ctx) { - if (ctx->inbound.fd != -1) + if (ctx->inbound.fd != ASSUAN_INVALID_FD) { _assuan_close (ctx->inbound.fd); } - ctx->inbound.fd = -1; - ctx->outbound.fd = -1; + ctx->inbound.fd = ASSUAN_INVALID_FD; + ctx->outbound.fd = ASSUAN_INVALID_FD; return 0; } @@ -87,18 +85,17 @@ assuan_socket_connect (assuan_context_t /* Make a connection to the Unix domain socket NAME and return a new Assuan context in CTX. SERVER_PID is currently not used but may become handy in the future. With flags set to 1 sendmsg and - recvmesg are used. */ + recvmsg are used. */ assuan_error_t assuan_socket_connect_ext (assuan_context_t *r_ctx, const char *name, pid_t server_pid, unsigned int flags) { - static struct assuan_io io = { _assuan_simple_read, - _assuan_simple_write }; - + static struct assuan_io io = { _assuan_simple_read, _assuan_simple_write, + NULL, NULL }; assuan_error_t err; assuan_context_t ctx; - int fd; + assuan_fd_t fd; struct sockaddr_un srvr_addr; size_t len; const char *s; @@ -109,7 +106,7 @@ assuan_socket_connect_ext (assuan_contex /* We require that the name starts with a slash, so that we eventually can reuse this function for other socket types. To - make things easier we allow an optional dirver prefix. */ + make things easier we allow an optional driver prefix. */ s = name; if (*s && s[1] == ':') s += 2; @@ -126,7 +123,7 @@ assuan_socket_connect_ext (assuan_contex ctx->finish_handler = do_finish; fd = _assuan_sock_new (PF_LOCAL, SOCK_STREAM, 0); - if (fd == -1) + if (fd == ASSUAN_INVALID_FD) { _assuan_log_printf ("can't create socket: %s\n", strerror (errno)); _assuan_release_context (ctx); @@ -139,8 +136,7 @@ assuan_socket_connect_ext (assuan_contex srvr_addr.sun_path[sizeof (srvr_addr.sun_path) - 1] = 0; len = SUN_LEN (&srvr_addr); - - if (_assuan_sock_connect (fd, (struct sockaddr *) &srvr_addr, len) == -1) + if ( _assuan_sock_connect (fd, (struct sockaddr *) &srvr_addr, len) == -1 ) { _assuan_log_printf ("can't connect to `%s': %s\n", name, strerror (errno)); diff -urpNP gpgme-1.1.8/assuan/assuan-socket-server.c gpgme-1.2.0/assuan/assuan-socket-server.c --- gpgme-1.1.8/assuan/assuan-socket-server.c 2007-07-04 20:08:19.000000000 +0000 +++ gpgme-1.2.0/assuan/assuan-socket-server.c 2009-03-09 14:10:31.000000000 +0000 @@ -1,5 +1,5 @@ /* assuan-socket-server.c - Assuan socket based server - * Copyright (C) 2002 Free Software Foundation, Inc. + * Copyright (C) 2002, 2007 Free Software Foundation, Inc. * * This file is part of Assuan. * @@ -14,9 +14,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. + * License along with this program; if not, see . */ #include @@ -40,14 +38,13 @@ #include "assuan-defs.h" -static struct assuan_io io = { _assuan_simple_read, - _assuan_simple_write }; - +static struct assuan_io io = { _assuan_simple_read, _assuan_simple_write, + NULL, NULL }; static int accept_connection_bottom (assuan_context_t ctx) { - int fd = ctx->connected_fd; + assuan_fd_t fd = ctx->connected_fd; ctx->peercred.valid = 0; #ifdef HAVE_SO_PEERCRED @@ -89,16 +86,23 @@ accept_connection_bottom (assuan_context static int accept_connection (assuan_context_t ctx) { - int fd; + assuan_fd_t fd; struct sockaddr_un clnt_addr; socklen_t len = sizeof clnt_addr; - fd = accept (ctx->listen_fd, (struct sockaddr*)&clnt_addr, &len ); - if (fd == -1) + fd = SOCKET2HANDLE(accept (HANDLE2SOCKET(ctx->listen_fd), + (struct sockaddr*)&clnt_addr, &len )); + if (fd == ASSUAN_INVALID_FD) { ctx->os_errno = errno; return _assuan_error (ASSUAN_Accept_Failed); } + if (_assuan_sock_check_nonce (fd, &ctx->listen_nonce)) + { + _assuan_close (fd); + ctx->os_errno = EACCES; + return _assuan_error (ASSUAN_Accept_Failed); + } ctx->connected_fd = fd; return accept_connection_bottom (ctx); @@ -107,12 +111,12 @@ accept_connection (assuan_context_t ctx) static int finish_connection (assuan_context_t ctx) { - if (ctx->inbound.fd != -1) + if (ctx->inbound.fd != ASSUAN_INVALID_FD) { _assuan_close (ctx->inbound.fd); } - ctx->inbound.fd = -1; - ctx->outbound.fd = -1; + ctx->inbound.fd = ASSUAN_INVALID_FD; + ctx->outbound.fd = ASSUAN_INVALID_FD; return 0; } @@ -126,15 +130,15 @@ deinit_socket_server (assuan_context_t c /* Initialize a server for the socket LISTEN_FD which has already be put into listen mode */ int -assuan_init_socket_server (assuan_context_t *r_ctx, int listen_fd) +assuan_init_socket_server (assuan_context_t *r_ctx, assuan_fd_t listen_fd) { return assuan_init_socket_server_ext (r_ctx, listen_fd, 0); } /* Initialize a server using the already accepted socket FD. This - fucntion is deprecated. */ + function is deprecated. */ int -assuan_init_connected_socket_server (assuan_context_t *r_ctx, int fd) +assuan_init_connected_socket_server (assuan_context_t *r_ctx, assuan_fd_t fd) { return assuan_init_socket_server_ext (r_ctx, fd, 2); } @@ -145,7 +149,7 @@ assuan_init_connected_socket_server (ass 1 - FD has already been accepted. */ int -assuan_init_socket_server_ext (assuan_context_t *r_ctx, int fd, +assuan_init_socket_server_ext (assuan_context_t *r_ctx, assuan_fd_t fd, unsigned int flags) { assuan_context_t ctx; @@ -158,21 +162,21 @@ assuan_init_socket_server_ext (assuan_co ctx->is_server = 1; if ((flags & 2)) ctx->pipe_mode = 1; /* We want a second accept to indicate EOF. */ - ctx->input_fd = -1; - ctx->output_fd = -1; + ctx->input_fd = ASSUAN_INVALID_FD; + ctx->output_fd = ASSUAN_INVALID_FD; - ctx->inbound.fd = -1; - ctx->outbound.fd = -1; + ctx->inbound.fd = ASSUAN_INVALID_FD; + ctx->outbound.fd = ASSUAN_INVALID_FD; if ((flags & 2)) { - ctx->listen_fd = -1; + ctx->listen_fd = ASSUAN_INVALID_FD; ctx->connected_fd = fd; } else { ctx->listen_fd = fd; - ctx->connected_fd = -1; + ctx->connected_fd = ASSUAN_INVALID_FD; } ctx->deinit_handler = (flags & 1)? _assuan_uds_deinit:deinit_socket_server; ctx->accept_handler = ((flags & 2) @@ -191,3 +195,14 @@ assuan_init_socket_server_ext (assuan_co *r_ctx = ctx; return rc; } + + +/* Save a copy of NONCE in context CTX. This should be used to + register the server's nonce with an context established by + assuan_init_socket_server. */ +void +assuan_set_sock_nonce (assuan_context_t ctx, assuan_sock_nonce_t *nonce) +{ + if (ctx && nonce) + ctx->listen_nonce = *nonce; +} diff -urpNP gpgme-1.1.8/assuan/assuan-socket.c gpgme-1.2.0/assuan/assuan-socket.c --- gpgme-1.1.8/assuan/assuan-socket.c 2007-07-16 17:27:22.000000000 +0000 +++ gpgme-1.2.0/assuan/assuan-socket.c 2009-04-01 20:50:30.000000000 +0000 @@ -14,20 +14,26 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. + * License along with this program; if not, see . */ #include #include +#include #ifdef HAVE_W32_SYSTEM +#define WIN32_LEAN_AND_MEAN #include +#include #include #else #include #include #endif +#include +#include +#include +#include + #include "assuan-defs.h" /* Hacks for Slowaris. */ @@ -42,107 +48,423 @@ # define AF_LOCAL AF_UNIX #endif +#ifdef HAVE_W32_SYSTEM +#ifndef S_IRGRP +# define S_IRGRP 0 +# define S_IWGRP 0 +#endif +#endif + + +#ifdef HAVE_W32_SYSTEM +int +_assuan_sock_wsa2errno (int err) +{ + switch (err) + { + case WSAENOTSOCK: + return EINVAL; + case WSAEWOULDBLOCK: + return EAGAIN; + case ERROR_BROKEN_PIPE: + return EPIPE; + case WSANOTINITIALISED: + return ENOSYS; + default: + return EIO; + } +} + + +/* W32: Fill BUFFER with LENGTH bytes of random. Returns -1 on + failure, 0 on success. Sets errno on failure. */ +static int +get_nonce (char *buffer, size_t nbytes) +{ + HCRYPTPROV prov; + int ret = -1; + + if (!CryptAcquireContext (&prov, NULL, NULL, PROV_RSA_FULL, + (CRYPT_VERIFYCONTEXT|CRYPT_SILENT)) ) + errno = ENODEV; + else + { + if (!CryptGenRandom (prov, nbytes, buffer)) + errno = ENODEV; + else + ret = 0; + CryptReleaseContext (prov, 0); + } + return ret; +} + + +/* W32: The buffer for NONCE needs to be at least 16 bytes. Returns 0 on + success and sets errno on failure. */ +static int +read_port_and_nonce (const char *fname, unsigned short *port, char *nonce) +{ + FILE *fp; + char buffer[50], *p; + size_t nread; + int aval; + + fp = fopen (fname, "rb"); + if (!fp) + return -1; + nread = fread (buffer, 1, sizeof buffer - 1, fp); + fclose (fp); + if (!nread) + { + errno = ENOFILE; + return -1; + } + buffer[nread] = 0; + aval = atoi (buffer); + if (aval < 1 || aval > 65535) + { + errno = EINVAL; + return -1; + } + *port = (unsigned int)aval; + for (p=buffer; nread && *p != '\n'; p++, nread--) + ; + if (*p != '\n' || nread != 17) + { + errno = EINVAL; + return -1; + } + p++; nread--; + memcpy (nonce, p, 16); + return 0; +} +#endif /*HAVE_W32_SYSTEM*/ + + + int -_assuan_close (int fd) +_assuan_close (assuan_fd_t fd) { -#if defined (HAVE_W32_SYSTEM) && !defined(_ASSUAN_IN_GPGME_BUILD_ASSUAN) - int rc = closesocket (fd); +#ifdef _ASSUAN_CUSTOM_IO + return _assuan_custom_close (fd); +#else +#ifdef (HAVE_W32_SYSTEM) + int rc = closesocket (HANDLE2SOCKET(fd)); + if (rc) + errno = _assuan_sock_wsa2errno (WSAGetLastError ()); if (rc && WSAGetLastError () == WSAENOTSOCK) - rc = CloseHandle (fd); + { + rc = CloseHandle (fd); + if (rc) + /* FIXME. */ + errno = EIO; + } return rc; #else return close (fd); #endif +#endif } -int +/* Return a new socket. Note that under W32 we consider a socket the + same as an System Handle; all functions using such a handle know + about this dual use and act accordingly. */ +assuan_fd_t _assuan_sock_new (int domain, int type, int proto) { -#ifndef HAVE_W32_SYSTEM - return socket (domain, type, proto); -#else +#ifdef HAVE_W32_SYSTEM + assuan_fd_t res; if (domain == AF_UNIX || domain == AF_LOCAL) domain = AF_INET; + +#ifdef _ASSUAN_CUSTOM_IO + return _assuan_custom_socket (domain, type, proto); +#else + res = SOCKET2HANDLE(socket (domain, type, proto)); + if (res == ASSUAN_INVALID_FD) + errno = _assuan_sock_wsa2errno (WSAGetLastError ()); + return res; +#endif + +#else + +#ifdef _ASSUAN_CUSTOM_IO + return _gpgme_io_socket (domain, type, proto); +#else return socket (domain, type, proto); #endif + +#endif } int -_assuan_sock_connect (int sockfd, struct sockaddr * addr, int addrlen) +_assuan_sock_connect (assuan_fd_t sockfd, struct sockaddr *addr, int addrlen) { -#ifndef HAVE_W32_SYSTEM - return connect (sockfd, addr, addrlen); -#else - struct sockaddr_in myaddr; - struct sockaddr_un * unaddr; - FILE * fp; - int port = 0; - - unaddr = (struct sockaddr_un *)addr; - fp = fopen (unaddr->sun_path, "rb"); - if (!fp) - return -1; - fscanf (fp, "%d", &port); - fclose (fp); - /* XXX: set errno in this case */ - if (port < 0 || port > 65535) - return -1; +#ifdef HAVE_W32_SYSTEM + if (addr->sa_family == AF_LOCAL || addr->sa_family == AF_UNIX) + { + struct sockaddr_in myaddr; + struct sockaddr_un *unaddr; + unsigned short port; + char nonce[16]; + int ret; + + unaddr = (struct sockaddr_un *)addr; + if (read_port_and_nonce (unaddr->sun_path, &port, nonce)) + return -1; + + myaddr.sin_family = AF_INET; + myaddr.sin_port = htons (port); + myaddr.sin_addr.s_addr = htonl (INADDR_LOOPBACK); - myaddr.sin_family = AF_INET; - myaddr.sin_port = port; - myaddr.sin_addr.s_addr = htonl (INADDR_LOOPBACK); - - /* we need this later. */ - unaddr->sun_family = myaddr.sin_family; - unaddr->sun_port = myaddr.sin_port; - unaddr->sun_addr.s_addr = myaddr.sin_addr.s_addr; + /* Set return values. */ + unaddr->sun_family = myaddr.sin_family; + unaddr->sun_port = myaddr.sin_port; + unaddr->sun_addr.s_addr = myaddr.sin_addr.s_addr; - return connect (sockfd, (struct sockaddr *)&myaddr, sizeof myaddr); +#ifdef _ASSUAN_CUSTOM_IO + ret = _assuan_custom_connect (sockfd, + (struct sockaddr *)&myaddr, sizeof myaddr); +#else + ret = connect (HANDLE2SOCKET(sockfd), + (struct sockaddr *)&myaddr, sizeof myaddr); +#endif + + if (!ret) + { + /* Send the nonce. */ + + ret = _assuan_io_write (sockfd, nonce, 16); + if (ret >= 0 && ret != 16) + { + errno = EIO; + ret = -1; + } + } + else + errno = _assuan_sock_wsa2errno (WSAGetLastError ()); + return ret; + } + else + { + int res; + res = connect (HANDLE2SOCKET (sockfd), addr, addrlen); + if (res < 0) + errno = _assuan_sock_wsa2errno (WSAGetLastError ()); + return res; + } +#else + +#ifdef _ASSUAN_CUSTOM_IO + return _assuan_custom_connect (sockfd, addr, addrlen); +#else + return connect (sockfd, addr, addrlen); +#endif + #endif } int -_assuan_sock_bind (int sockfd, struct sockaddr * addr, int addrlen) +_assuan_sock_bind (assuan_fd_t sockfd, struct sockaddr *addr, int addrlen) { -#ifndef HAVE_W32_SYSTEM - return bind (sockfd, addr, addrlen); -#else +#ifdef HAVE_W32_SYSTEM if (addr->sa_family == AF_LOCAL || addr->sa_family == AF_UNIX) { struct sockaddr_in myaddr; - struct sockaddr_un * unaddr; - FILE * fp; + struct sockaddr_un *unaddr; + int filefd; + FILE *fp; int len = sizeof myaddr; int rc; + char nonce[16]; + + if (get_nonce (nonce, 16)) + return -1; + + unaddr = (struct sockaddr_un *)addr; myaddr.sin_port = 0; myaddr.sin_family = AF_INET; myaddr.sin_addr.s_addr = htonl (INADDR_LOOPBACK); - rc = bind (sockfd, (struct sockaddr *)&myaddr, len); - if (rc) - return rc; - rc = getsockname (sockfd, (struct sockaddr *)&myaddr, &len); - if (rc) - return rc; - unaddr = (struct sockaddr_un *)addr; - fp = fopen (unaddr->sun_path, "wb"); + filefd = open (unaddr->sun_path, + (O_WRONLY|O_CREAT|O_EXCL|O_BINARY), + (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP)); + if (filefd == -1) + { + if (errno == EEXIST) + errno = WSAEADDRINUSE; + return -1; + } + fp = fdopen (filefd, "wb"); if (!fp) - return -1; - fprintf (fp, "%d", myaddr.sin_port); + { + int save_e = errno; + close (filefd); + errno = save_e; + return -1; + } + + rc = bind (HANDLE2SOCKET (sockfd), (struct sockaddr *)&myaddr, len); + if (!rc) + rc = getsockname (HANDLE2SOCKET (sockfd), + (struct sockaddr *)&myaddr, &len); + if (rc) + { + int save_e = errno; + fclose (fp); + remove (unaddr->sun_path); + errno = save_e; + return rc; + } + fprintf (fp, "%d\n", ntohs (myaddr.sin_port)); + fwrite (nonce, 16, 1, fp); fclose (fp); - /* we need this later. */ - unaddr->sun_family = myaddr.sin_family; - unaddr->sun_port = myaddr.sin_port; - unaddr->sun_addr.s_addr = myaddr.sin_addr.s_addr; - return 0; } + else + { + int res = bind (HANDLE2SOCKET(sockfd), addr, addrlen); + if (res < 0) + errno = _assuan_sock_wsa2errno (WSAGetLastError ()); + return res; + } +#else return bind (sockfd, addr, addrlen); #endif } + +int +_assuan_sock_get_nonce (struct sockaddr *addr, int addrlen, + assuan_sock_nonce_t *nonce) +{ +#ifdef HAVE_W32_SYSTEM + if (addr->sa_family == AF_LOCAL || addr->sa_family == AF_UNIX) + { + struct sockaddr_un *unaddr; + unsigned short port; + + if (sizeof nonce->nonce != 16) + { + errno = EINVAL; + return -1; + } + nonce->length = 16; + unaddr = (struct sockaddr_un *)addr; + if (read_port_and_nonce (unaddr->sun_path, &port, nonce->nonce)) + return -1; + } + else + { + nonce->length = 42; /* Arbitrary valuie to detect unitialized nonce. */ + nonce->nonce[0] = 42; + } +#else + (void)addr; + (void)addrlen; + nonce->length = 0; +#endif + return 0; +} + + +int +_assuan_sock_check_nonce (assuan_fd_t fd, assuan_sock_nonce_t *nonce) +{ +#ifdef HAVE_W32_SYSTEM + char buffer[16], *p; + size_t nleft; + int n; + + if (sizeof nonce->nonce != 16) + { + errno = EINVAL; + return -1; + } + + if (nonce->length == 42 && nonce->nonce[0] == 42) + return 0; /* Not a Unix domain socket. */ + + if (nonce->length != 16) + { + errno = EINVAL; + return -1; + } + + p = buffer; + nleft = 16; + while (nleft) + { + n = _assuan_io_read (SOCKET2HANDLE(fd), p, nleft); + if (n < 0 && errno == EINTR) + ; + else if (n < 0 && errno == EAGAIN) + Sleep (100); + else if (n < 0) + return -1; + else if (!n) + { + errno = EIO; + return -1; + } + else + { + p += n; + nleft -= n; + } + } + if (memcmp (buffer, nonce->nonce, 16)) + { + errno = EACCES; + return -1; + } +#else + (void)fd; + (void)nonce; +#endif + return 0; +} + + +/* Public API. */ +int +assuan_sock_close (assuan_fd_t fd) +{ + return _assuan_close (fd); +} + +assuan_fd_t +assuan_sock_new (int domain, int type, int proto) +{ + return _assuan_sock_new (domain, type, proto); +} + +int +assuan_sock_connect (assuan_fd_t sockfd, struct sockaddr *addr, int addrlen) +{ + return _assuan_sock_connect (sockfd, addr, addrlen); +} + +int +assuan_sock_bind (assuan_fd_t sockfd, struct sockaddr *addr, int addrlen) +{ + return _assuan_sock_bind (sockfd, addr, addrlen); +} + +int +assuan_sock_get_nonce (struct sockaddr *addr, int addrlen, + assuan_sock_nonce_t *nonce) +{ + return _assuan_sock_get_nonce (addr, addrlen, nonce); +} + +int +assuan_sock_check_nonce (assuan_fd_t fd, assuan_sock_nonce_t *nonce) +{ + return _assuan_sock_check_nonce (fd, nonce); +} diff -urpNP gpgme-1.1.8/assuan/assuan-uds.c gpgme-1.2.0/assuan/assuan-uds.c --- gpgme-1.1.8/assuan/assuan-uds.c 2007-07-04 20:08:19.000000000 +0000 +++ gpgme-1.2.0/assuan/assuan-uds.c 2009-03-09 14:10:31.000000000 +0000 @@ -14,9 +14,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. + * License along with this program; if not, see . */ #ifdef HAVE_CONFIG_H @@ -72,9 +70,9 @@ static ssize_t uds_reader (assuan_context_t ctx, void *buf, size_t buflen) { +#ifndef HAVE_W32_SYSTEM int len = ctx->uds.buffersize; -#ifndef HAVE_W32_SYSTEM if (!ctx->uds.bufferallocated) { ctx->uds.buffer = xtrymalloc (2048); @@ -141,12 +139,6 @@ uds_reader (assuan_context_t ctx, void * #endif /*USE_DESCRIPTOR_PASSING*/ } -#else /*HAVE_W32_SYSTEM*/ - - len = recvfrom (ctx->inbound.fd, buf, buflen, 0, NULL, NULL); - -#endif /*HAVE_W32_SYSTEM*/ - /* Return some data to the user. */ if (len > buflen) /* We have more than the user requested. */ @@ -159,6 +151,12 @@ uds_reader (assuan_context_t ctx, void * assert (ctx->uds.bufferoffset <= ctx->uds.bufferallocated); return len; +#else /*HAVE_W32_SYSTEM*/ + int res = recvfrom (HANDLE2SOCKET(ctx->inbound.fd), buf, buflen, 0, NULL, NULL); + if (res < 0) + errno = _assuan_sock_wsa2errno (WSAGetLastError ()); + return res; +#endif /*HAVE_W32_SYSTEM*/ } @@ -181,19 +179,21 @@ uds_writer (assuan_context_t ctx, const iovec.iov_len = buflen; len = _assuan_simple_sendmsg (ctx, &msg); + + return len; #else /*HAVE_W32_SYSTEM*/ - int len; - - len = sendto (ctx->outbound.fd, buf, buflen, 0, - (struct sockaddr *)&ctx->serveraddr, - sizeof (struct sockaddr_in)); + int res = sendto (HANDLE2SOCKET(ctx->outbound.fd), buf, buflen, 0, + (struct sockaddr *)&ctx->serveraddr, + sizeof (struct sockaddr_in)); + if (res < 0) + errno = _assuan_sock_wsa2errno (WSAGetLastError ()); + return res; #endif /*HAVE_W32_SYSTEM*/ - return len; } static assuan_error_t -uds_sendfd (assuan_context_t ctx, int fd) +uds_sendfd (assuan_context_t ctx, assuan_fd_t fd) { #ifdef USE_DESCRIPTOR_PASSING struct msghdr msg; @@ -243,7 +243,7 @@ uds_sendfd (assuan_context_t ctx, int fd static assuan_error_t -uds_receivefd (assuan_context_t ctx, int *fd) +uds_receivefd (assuan_context_t ctx, assuan_fd_t *fd) { #ifdef USE_DESCRIPTOR_PASSING int i; diff -urpNP gpgme-1.1.8/assuan/assuan-util.c gpgme-1.2.0/assuan/assuan-util.c --- gpgme-1.1.8/assuan/assuan-util.c 2006-11-29 16:02:27.000000000 +0000 +++ gpgme-1.2.0/assuan/assuan-util.c 2009-03-09 14:10:31.000000000 +0000 @@ -14,9 +14,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. + * License along with this program; if not, see . */ #include @@ -32,6 +30,10 @@ static void *(*alloc_func)(size_t n) = m static void *(*realloc_func)(void *p, size_t n) = realloc; static void (*free_func)(void*) = free; +struct assuan_io_hooks _assuan_io_hooks; + + + void assuan_set_malloc_hooks ( void *(*new_alloc_func)(size_t n), void *(*new_realloc_func)(void *p, size_t n), @@ -42,6 +44,20 @@ assuan_set_malloc_hooks ( void *(*new_al free_func = new_free_func; } + +void +assuan_set_io_hooks (assuan_io_hooks_t io_hooks) +{ + _assuan_io_hooks.read_hook = NULL; + _assuan_io_hooks.write_hook = NULL; + if (io_hooks) + { + _assuan_io_hooks.read_hook = io_hooks->read_hook; + _assuan_io_hooks.write_hook = io_hooks->write_hook; + } +} + + void * _assuan_malloc (size_t n) { @@ -152,6 +168,7 @@ assuan_set_flag (assuan_context_t ctx, a switch (flag) { case ASSUAN_NO_WAITPID: ctx->flags.no_waitpid = value; break; + case ASSUAN_CONFIDENTIAL: ctx->confidential = value; break; } } @@ -164,8 +181,8 @@ assuan_get_flag (assuan_context_t ctx, a switch (flag) { case ASSUAN_NO_WAITPID: return ctx->flags.no_waitpid; + case ASSUAN_CONFIDENTIAL: return ctx->confidential; } return 0; } - diff -urpNP gpgme-1.1.8/assuan/assuan.h gpgme-1.2.0/assuan/assuan.h --- gpgme-1.1.8/assuan/assuan.h 2007-09-27 08:27:34.000000000 +0000 +++ gpgme-1.2.0/assuan/assuan.h 2009-04-01 20:49:15.000000000 +0000 @@ -1,5 +1,6 @@ /* assuan.h - Definitions for the Assuan IPC library - * Copyright (C) 2001, 2002, 2003, 2005, 2007 Free Software Foundation, Inc. + * Copyright (C) 2001, 2002, 2003, 2005, 2007, + * 2008 Free Software Foundation, Inc. * * This file is part of Assuan. * @@ -14,9 +15,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. + * License along with this program; if not, see . */ #ifndef ASSUAN_H @@ -25,18 +24,28 @@ #include #include #include - +#ifndef _ASSUAN_NO_SOCKET_WRAPPER +#ifdef _WIN32 +#include +#else +#include +#endif +#endif /*!_ASSUAN_NO_SOCKET_WRAPPER*/ /* To use this file with libraries the following macros are useful: #define _ASSUAN_EXT_SYM_PREFIX _foo_ - This prefixes all external symbols with "_foo_". + This prefixes all external symbols with "_foo_". #define _ASSUAN_ONLY_GPG_ERRORS - If this is defined all old-style Assuan error codes are made - inactive as well as other dereacted stuff. + If this is defined all old-style Assuan error codes are made + inactive as well as other deprecated stuff. + + #define _ASSUAN_NO_SOCKET_WRAPPER + + Do not include the definitions for the socket wrapper feature. The follwing macros are used internally in the implementation of libassuan: @@ -68,6 +77,9 @@ int _gpgme_io_read (int fd, void *buffer int _gpgme_io_write (int fd, const void *buffer, size_t count); int _gpgme_io_sendmsg (int sock, const struct msghdr *msg, int flags); int _gpgme_io_recvmsg (int sock, struct msghdr *msg, int flags); +int _gpgme_io_socket (int domain, int type, int proto); + +#define _assuan_funopen _gpgme_funopen #define close _gpgme_io_close #define read _gpgme_io_read @@ -79,6 +91,15 @@ int _gpgme_io_recvmsg (int sock, struct #define sendmsg _gpgme_io_sendmsg #define recvmsg _gpgme_io_recvmsg #endif /*_ASSUAN_IN_GPGME_BUILD_ASSUAN*/ + +#define _ASSUAN_CUSTOM_IO 1 +#define _assuan_custom_close _gpgme_io_close +#define _assuan_custom_read _gpgme_io_read +#define _assuan_custom_write _gpgme_io_write +#define _assuan_custom_pipe _gpgme_io_pipe +#define _assuan_custom_socket _gpgme_io_socket +#define _assuan_custom_connect _gpgme_io_connect + /**** End GPGME specific modifications. ******/ @@ -103,6 +124,7 @@ int _gpgme_io_recvmsg (int sock, struct _ASSUAN_PREFIX(assuan_register_option_handler) #define assuan_process _ASSUAN_PREFIX(assuan_process) #define assuan_process_next _ASSUAN_PREFIX(assuan_process_next) +#define assuan_process_done _ASSUAN_PREFIX(assuan_process_done) #define assuan_get_active_fds _ASSUAN_PREFIX(assuan_get_active_fds) #define assuan_get_data_fp _ASSUAN_PREFIX(assuan_get_data_fp) #define assuan_set_okay_line _ASSUAN_PREFIX(assuan_set_okay_line) @@ -130,6 +152,7 @@ int _gpgme_io_recvmsg (int sock, struct #define assuan_get_peercred _ASSUAN_PREFIX(assuan_get_peercred) #define assuan_transact _ASSUAN_PREFIX(assuan_transact) #define assuan_inquire _ASSUAN_PREFIX(assuan_inquire) +#define assuan_inquire_ext _ASSUAN_PREFIX(assuan_inquire_ext) #define assuan_read_line _ASSUAN_PREFIX(assuan_read_line) #define assuan_pending_line _ASSUAN_PREFIX(assuan_pending_line) #define assuan_write_line _ASSUAN_PREFIX(assuan_write_line) @@ -137,7 +160,7 @@ int _gpgme_io_recvmsg (int sock, struct #define assuan_sendfd _ASSUAN_PREFIX(assuan_sendfd) #define assuan_receivefd _ASSUAN_PREFIX(assuan_receivefd) #define assuan_set_malloc_hooks _ASSUAN_PREFIX(assuan_set_malloc_hooks) -#define assuan_set_assuan_log_level _ASSUAN_PREFIX(assuan_set_assuan_log_level) +#define assuan_set_io_hooks _ASSUAN_PREFIX(assuan_set_io_hooks) #define assuan_set_log_stream _ASSUAN_PREFIX(assuan_set_log_stream) #define assuan_set_error _ASSUAN_PREFIX(assuan_set_error) #define assuan_set_pointer _ASSUAN_PREFIX(assuan_set_pointer) @@ -159,6 +182,13 @@ int _gpgme_io_recvmsg (int sock, struct #define assuan_pipe_connect2 _ASSUAN_PREFIX(assuan_pipe_connect2) #define assuan_set_assuan_log_prefix \ _ASSUAN_PREFIX(assuan_set_assuan_log_prefix) +#define assuan_sock_close _ASSUAN_PREFIX(assuan_sock_close) +#define assuan_sock_new _ASSUAN_PREFIX(assuan_sock_new) +#define assuan_sock_connect _ASSUAN_PREFIX(assuan_sock_connect) +#define assuan_sock_bind _ASSUAN_PREFIX(assuan_sock_bind) +#define assuan_sock_get_nonce _ASSUAN_PREFIX(assuan_sock_get_nonce) +#define assuan_sock_check_nonce _ASSUAN_PREFIX(assuan_sock_check_nonce) + /* And now the internal functions, argh... */ #define _assuan_read_line _ASSUAN_PREFIX(_assuan_read_line) @@ -170,8 +200,9 @@ int _gpgme_io_recvmsg (int sock, struct _ASSUAN_PREFIX(_assuan_register_std_commands) #define _assuan_simple_read _ASSUAN_PREFIX(_assuan_simple_read) #define _assuan_simple_write _ASSUAN_PREFIX(_assuan_simple_write) -#define _assuan_simple_read _ASSUAN_PREFIX(_assuan_simple_read) -#define _assuan_simple_write _ASSUAN_PREFIX(_assuan_simple_write) +#define _assuan_io_read _ASSUAN_PREFIX(_assuan_io_read) +#define _assuan_io_write _ASSUAN_PREFIX(_assuan_io_write) +#define _assuan_io_hooks _ASSUAN_PREFIX(_assuan_io_hooks) #define _assuan_new_context _ASSUAN_PREFIX(_assuan_new_context) #define _assuan_release_context _ASSUAN_PREFIX(_assuan_release_context) #define _assuan_malloc _ASSUAN_PREFIX(_assuan_malloc) @@ -188,19 +219,24 @@ int _gpgme_io_recvmsg (int sock, struct #define _assuan_gpg_strerror_r _ASSUAN_PREFIX(_assuan_gpg_strerror_r) #define _assuan_gpg_strsource _ASSUAN_PREFIX(_assuan_gpg_strsource) #define _assuan_write_line _ASSUAN_PREFIX(_assuan_write_line) -#define _assuan_close _ASSUAN_PREFIX(_assuan_close) -#define _assuan_sock_new _ASSUAN_PREFIX(_assuan_sock_new) -#define _assuan_sock_bind _ASSUAN_PREFIX(_assuan_sock_bind) -#define _assuan_sock_connect _ASSUAN_PREFIX(_assuan_sock_connect) #define _assuan_error _ASSUAN_PREFIX(_assuan_error) +#define _assuan_error_is_eagain _ASSUAN_PREFIX(_assuan_error_is_eagain) #define _assuan_init_uds_io _ASSUAN_PREFIX(_assuan_init_uds_io) #define _assuan_uds_close_fds _ASSUAN_PREFIX(_assuan_uds_close_fds) #define _assuan_uds_deinit _ASSUAN_PREFIX(_assuan_uds_deinit) #define _assuan_simple_recvmsg _ASSUAN_PREFIX(_assuan_simple_recvmsg) #define _assuan_simple_sendmsg _ASSUAN_PREFIX(_assuan_simple_sendmsg) #define _assuan_waitpid _ASSUAN_PREFIX(_assuan_waitpid) +#define _assuan_sock_wsa2errno _ASSUAN_PREFIX(_assuan_sock_wsa2errno) +#define _assuan_sock_close _ASSUAN_PREFIX(_assuan_sock_close) +#define _assuan_sock_new _ASSUAN_PREFIX(_assuan_sock_new) +#define _assuan_sock_connect _ASSUAN_PREFIX(_assuan_sock_connect) +#define _assuan_sock_bind _ASSUAN_PREFIX(_assuan_sock_bind) +#define _assuan_sock_get_nonce _ASSUAN_PREFIX(_assuan_sock_get_nonce) +#define _assuan_sock_check_nonce _ASSUAN_PREFIX(_assuan_sock_check_nonce) +#define _assuan_close _ASSUAN_PREFIX(_assuan_close) +#define _assuan_usleep _ASSUAN_PREFIX(_assuan_usleep) -#define _assuan_funopen _gpgme_funopen #endif /*_ASSUAN_EXT_SYM_PREFIX*/ @@ -350,7 +386,8 @@ typedef enum #else /*!_ASSUAN_ONLY_GPG_ERRORS*/ -typedef int assuan_error_t; +/* Choose a type compatible with gpg_error_t. */ +typedef unsigned int assuan_error_t; #endif /*!_ASSUAN_ONLY_GPG_ERRORS*/ @@ -363,7 +400,11 @@ typedef enum this is not desirable. By setting this flag, the waitpid will be skipped and the caller is responsible to cleanup a forked process. */ - ASSUAN_NO_WAITPID = 1 + ASSUAN_NO_WAITPID = 1, + /* This flag indicates whether Assuan logging is in confidential + mode. Use assuan_{begin,end}_condidential to change the + mode. */ + ASSUAN_CONFIDENTIAL = 2 } assuan_flag_t; @@ -375,6 +416,66 @@ typedef struct assuan_context_s *assuan_ typedef struct assuan_context_s *ASSUAN_CONTEXT _ASSUAN_DEPRECATED; #endif /*_ASSUAN_ONLY_GPG_ERRORS*/ +/* Because we use system handles and not libc low level file + descriptors on W32, we need to declare them as HANDLE (which + actually is a plain pointer). This is required to eventually + support 64 bit Windows systems. */ +#ifdef _WIN32 +typedef void *assuan_fd_t; +#define ASSUAN_INVALID_FD ((void*)(-1)) +#define ASSUAN_INT2FD(s) ((void *)(s)) +#define ASSUAN_FD2INT(h) ((unsigned int)(h)) +#else +typedef int assuan_fd_t; +#define ASSUAN_INVALID_FD (-1) +#define ASSUAN_INT2FD(s) ((s)) +#define ASSUAN_FD2INT(h) ((h)) +#endif + + +/* Assuan features an emulation of Unix domain sockets based on a + local TCP connections. To implement access permissions based on + file permissions a nonce is used which is expected by th server as + the first bytes received. This structure is used by the server to + save the nonce created initially by bind. On POSIX systems this is + a dummy operation. */ +struct assuan_sock_nonce_s +{ + size_t length; +#ifdef _WIN32 + char nonce[16]; +#endif +}; +typedef struct assuan_sock_nonce_s assuan_sock_nonce_t; + +/* Define the Unix domain socket structure for Windows. */ +#if defined(_WIN32) && !defined(_ASSUAN_NO_SOCKET_WRAPPER) +#ifndef AF_LOCAL +#define AF_LOCAL AF_UNIX +#endif +#define EADDRINUSE WSAEADDRINUSE +struct sockaddr_un +{ + short sun_family; + unsigned short sun_port; + struct in_addr sun_addr; + char sun_path[108-2-4]; +}; +#endif + + +/* Definition of hook functions used to conditionally replace the + default I/O functions. */ +struct assuan_io_hooks +{ + int (*read_hook)(assuan_context_t, assuan_fd_t, void *, size_t, ssize_t *); + int (*write_hook)(assuan_context_t, assuan_fd_t fd, + const void *, size_t, ssize_t *); +}; +typedef struct assuan_io_hooks *assuan_io_hooks_t; + + + /*-- assuan-handler.c --*/ int assuan_register_command (assuan_context_t ctx, const char *cmd_string, @@ -398,8 +499,9 @@ int assuan_register_option_handler (assu int assuan_process (assuan_context_t ctx); int assuan_process_next (assuan_context_t ctx); +int assuan_process_done (assuan_context_t ctx, int rc); int assuan_get_active_fds (assuan_context_t ctx, int what, - int *fdarray, int fdarraysize); + assuan_fd_t *fdarray, int fdarraysize); FILE *assuan_get_data_fp (assuan_context_t ctx); @@ -410,15 +512,17 @@ assuan_error_t assuan_write_status (assu /* Negotiate a file descriptor. If LINE contains "FD=N", returns N assuming a local file descriptor. If LINE contains "FD" reads a file descriptor via CTX and stores it in *RDF (the CTX must be - capable of passing file descriptors). */ + capable of passing file descriptors). Under W32 the returned FD is + a libc-type one. */ assuan_error_t assuan_command_parse_fd (assuan_context_t ctx, char *line, - int *rfd); + assuan_fd_t *rfd); + /*-- assuan-listen.c --*/ assuan_error_t assuan_set_hello_line (assuan_context_t ctx, const char *line); assuan_error_t assuan_accept (assuan_context_t ctx); -int assuan_get_input_fd (assuan_context_t ctx); -int assuan_get_output_fd (assuan_context_t ctx); +assuan_fd_t assuan_get_input_fd (assuan_context_t ctx); +assuan_fd_t assuan_get_output_fd (assuan_context_t ctx); assuan_error_t assuan_close_input_fd (assuan_context_t ctx); assuan_error_t assuan_close_output_fd (assuan_context_t ctx); @@ -428,11 +532,12 @@ int assuan_init_pipe_server (assuan_cont void assuan_deinit_server (assuan_context_t ctx); /*-- assuan-socket-server.c --*/ -int assuan_init_socket_server (assuan_context_t *r_ctx, int listen_fd); +int assuan_init_socket_server (assuan_context_t *r_ctx, assuan_fd_t listen_fd); int assuan_init_connected_socket_server (assuan_context_t *r_ctx, - int fd) _ASSUAN_DEPRECATED; -int assuan_init_socket_server_ext (assuan_context_t *r_ctx, int fd, + assuan_fd_t fd) _ASSUAN_DEPRECATED; +int assuan_init_socket_server_ext (assuan_context_t *r_ctx, assuan_fd_t fd, unsigned int flags); +void assuan_set_sock_nonce (assuan_context_t ctx, assuan_sock_nonce_t *nonce); /*-- assuan-pipe-connect.c --*/ assuan_error_t assuan_pipe_connect (assuan_context_t *ctx, @@ -465,7 +570,7 @@ assuan_error_t assuan_socket_connect_ext /*-- assuan-connect.c --*/ void assuan_disconnect (assuan_context_t ctx); pid_t assuan_get_pid (assuan_context_t ctx); -#ifndef HAVE_W32_SYSTEM +#ifndef _WIN32 assuan_error_t assuan_get_peercred (assuan_context_t ctx, pid_t *pid, uid_t *uid, gid_t *gid); #endif @@ -474,11 +579,11 @@ assuan_error_t assuan_get_peercred (assu assuan_error_t assuan_transact (assuan_context_t ctx, const char *command, - int (*data_cb)(void *, const void *, size_t), + assuan_error_t (*data_cb)(void *, const void *, size_t), void *data_cb_arg, - int (*inquire_cb)(void*, const char *), + assuan_error_t (*inquire_cb)(void*, const char *), void *inquire_cb_arg, - int (*status_cb)(void*, const char *), + assuan_error_t (*status_cb)(void*, const char *), void *status_cb_arg); @@ -486,7 +591,12 @@ assuan_transact (assuan_context_t ctx, assuan_error_t assuan_inquire (assuan_context_t ctx, const char *keyword, unsigned char **r_buffer, size_t *r_length, size_t maxlen); - +assuan_error_t assuan_inquire_ext (assuan_context_t ctx, const char *keyword, + size_t maxlen, + int (*cb) (void *cb_data, int rc, + unsigned char *buf, + size_t buf_len), + void *cb_data); /*-- assuan-buffer.c --*/ assuan_error_t assuan_read_line (assuan_context_t ctx, char **line, size_t *linelen); @@ -498,13 +608,15 @@ assuan_error_t assuan_send_data (assuan_ /* The file descriptor must be pending before assuan_receivefd is called. This means that assuan_sendfd should be called *before* the trigger is sent (normally via assuan_write_line ("INPUT FD")). */ -assuan_error_t assuan_sendfd (assuan_context_t ctx, int fd); -assuan_error_t assuan_receivefd (assuan_context_t ctx, int *fd); +assuan_error_t assuan_sendfd (assuan_context_t ctx, assuan_fd_t fd); +assuan_error_t assuan_receivefd (assuan_context_t ctx, assuan_fd_t *fd); + /*-- assuan-util.c --*/ void assuan_set_malloc_hooks ( void *(*new_alloc_func)(size_t n), void *(*new_realloc_func)(void *p, size_t n), void (*new_free_func)(void*) ); +void assuan_set_io_hooks (assuan_io_hooks_t io_hooks); void assuan_set_log_stream (assuan_context_t ctx, FILE *fp); int assuan_set_error (assuan_context_t ctx, int err, const char *text); void assuan_set_pointer (assuan_context_t ctx, void *pointer); @@ -545,14 +657,6 @@ void assuan_set_assuan_err_source (int e /*-- assuan-logging.c --*/ -/* Set the log level for general assuan commands. 0 is no logging at - all, 1 is the standard logging and the default. Higher leveles may - be defined in the future. Passing a level of -1 will not change - the current log level. Returns previous log level. Note, that - this function is not thread-safe and should in general be used - right at startup. */ -int assuan_set_assuan_log_level (int level); - /* Set the stream to which assuan should log message not associated with a context. By default, this is stderr. The default value will be changed when the first log stream is associated with a @@ -574,6 +678,21 @@ void assuan_set_assuan_log_prefix (const string, i.e. "" */ const char *assuan_get_assuan_log_prefix (void); + +/*-- assuan-socket.c --*/ + +/* These are socket wrapper functions to support an emulation of Unix + domain sockets on Windows W32. */ +int assuan_sock_close (assuan_fd_t fd); +assuan_fd_t assuan_sock_new (int domain, int type, int proto); +int assuan_sock_connect (assuan_fd_t sockfd, + struct sockaddr *addr, int addrlen); +int assuan_sock_bind (assuan_fd_t sockfd, struct sockaddr *addr, int addrlen); +int assuan_sock_get_nonce (struct sockaddr *addr, int addrlen, + assuan_sock_nonce_t *nonce); +int assuan_sock_check_nonce (assuan_fd_t fd, assuan_sock_nonce_t *nonce); + + #ifdef __cplusplus } #endif diff -urpNP gpgme-1.1.8/assuan/mkerrors gpgme-1.2.0/assuan/mkerrors --- gpgme-1.1.8/assuan/mkerrors 2007-11-23 15:24:05.000000000 +0000 +++ gpgme-1.2.0/assuan/mkerrors 2009-03-09 14:10:31.000000000 +0000 @@ -31,6 +31,7 @@ cat < 0 && errno < 4096) - { - n = (EAGAIN | (1 << 15)); - break; - } + n = (6 | (1 << 15)); + break; default: n = 270; /*GPG_ERR_ASS_READ_ERROR*/ break; } break; @@ -108,11 +106,8 @@ _assuan_error (int oldcode) { case 0: n = 16381; /*GPG_ERR_MISSING_ERRNO*/ break; case EAGAIN: - if (errno > 0 && errno < 4096) - { - n = (EAGAIN | (1 << 15)); - break; - } + n = (6 | (1 << 15)); + break; default: n = 271; /*GPG_ERR_ASS_WRITE_ERROR*/ break; } break; @@ -127,11 +122,8 @@ _assuan_error (int oldcode) n = 16381; /*GPG_ERR_MISSING_ERRNO*/ break; case ENOMEM: - if (errno > 0 && errno < 4096) - { - n = (ENOMEM | (1 << 15)); - break; - } + n = (86 | (1 << 15)); + break; default: n = 16382; /*GPG_ERR_UNKNOWN_ERRNO*/ break; @@ -150,6 +142,23 @@ _assuan_error (int oldcode) } +/* A small helper function to treat EAGAIN transparently to the + caller. */ +int +_assuan_error_is_eagain (assuan_error_t err) +{ + if ((!err_source && err == ASSUAN_Read_Error && errno == EAGAIN) + || (err_source && (err & ((1 << 24) - 1)) == (6 | (1 << 15)))) + { + /* Avoid spinning by sleeping for one tenth of a second. */ + _assuan_usleep (100000); + return 1; + } + else + return 0; +} + + /** * assuan_strerror: * @err: Error code diff -urpNP gpgme-1.1.8/autogen.sh gpgme-1.2.0/autogen.sh --- gpgme-1.1.8/autogen.sh 2008-01-30 14:00:42.000000000 +0000 +++ gpgme-1.2.0/autogen.sh 2009-01-26 14:15:26.000000000 +0000 @@ -159,4 +159,6 @@ $AUTOMAKE --gnu; echo "Running autoconf${FORCE} ..." $AUTOCONF${FORCE} -echo "You may now run \"./configure --enable-maintainer-mode && make\"." +echo "You may now run: + ./configure --enable-maintainer-mode && make +" diff -urpNP gpgme-1.1.8/complus/Makefile.in gpgme-1.2.0/complus/Makefile.in --- gpgme-1.1.8/complus/Makefile.in 2008-12-08 18:41:52.000000000 +0000 +++ gpgme-1.2.0/complus/Makefile.in 2009-06-18 16:13:40.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -163,6 +163,7 @@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ +NEED__FILE_OFFSET_BITS = @NEED__FILE_OFFSET_BITS@ NETLIBS = @NETLIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -235,6 +236,7 @@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = gpgcom.idl gpgcom.tlb gpgcom.rc vbtest.html vbtest.vbs README @@ -257,8 +259,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_ @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -340,7 +342,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS diff -urpNP gpgme-1.1.8/config.h.in gpgme-1.2.0/config.h.in --- gpgme-1.1.8/config.h.in 2008-12-08 18:42:06.000000000 +0000 +++ gpgme-1.2.0/config.h.in 2009-06-18 16:13:39.000000000 +0000 @@ -163,23 +163,50 @@ /* Defined if descriptor passing is enabled and supported */ #undef USE_DESCRIPTOR_PASSING +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# undef _GNU_SOURCE +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# undef _POSIX_PTHREAD_SEMANTICS +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# undef _TANDEM_SOURCE +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif + + /* Version of this package */ #undef VERSION /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS -/* Enable GNU extensions on systems that have them. */ -#ifndef _GNU_SOURCE -# undef _GNU_SOURCE -#endif - /* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ #undef _LARGEFILE_SOURCE /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES +/* Define to 1 if on MINIX. */ +#undef _MINIX + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +#undef _POSIX_1_SOURCE + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +#undef _POSIX_SOURCE + /* To allow the use of GPGME in multithreaded programs we have to use special features from the library. IMPORTANT: gpgme is not yet fully reentrant and you should use it diff -urpNP gpgme-1.1.8/configure gpgme-1.2.0/configure --- gpgme-1.1.8/configure 2008-12-08 18:41:53.000000000 +0000 +++ gpgme-1.2.0/configure 2009-06-18 16:13:41.000000000 +0000 @@ -1,11 +1,11 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for gpgme 1.1.8. +# Generated by GNU Autoconf 2.63 for gpgme 1.2.0. # # Report bugs to . # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## @@ -17,7 +17,7 @@ DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # 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 @@ -39,17 +39,45 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTE as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh + 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 # Support unset when possible. @@ -65,8 +93,6 @@ fi # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) -as_nl=' -' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. @@ -89,7 +115,7 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi @@ -102,17 +128,10 @@ PS2='> ' PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && @@ -134,7 +153,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | +$as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -160,7 +179,7 @@ else as_have_required=no fi - if test $as_have_required = yes && (eval ": + if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } @@ -242,7 +261,7 @@ IFS=$as_save_IFS if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # 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 @@ -263,7 +282,7 @@ _ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # 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 @@ -343,10 +362,10 @@ fi if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi @@ -415,9 +434,10 @@ fi test \$exitcode = 0") || { echo No shell found that supports shell functions. - echo Please tell autoconf@gnu.org about your system, - echo including any error possibly output before this - echo message + echo Please tell bug-autoconf@gnu.org about your system, + echo including any error possibly output before this message. + echo This can help us improve future autoconf versions. + echo Configuration will now proceed without shell functions. } @@ -453,7 +473,7 @@ test \$exitcode = 0") || { s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems @@ -481,7 +501,6 @@ case `echo -n x` in *) ECHO_N='-n';; esac - if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -494,19 +513,22 @@ if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir - mkdir conf$$.dir + mkdir conf$$.dir 2>/dev/null fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln + fi else as_ln_s='cp -p' fi @@ -531,10 +553,10 @@ else as_test_x=' eval sh -c '\'' if test -d "$1"; then - test -d "$1/."; + test -d "$1/."; else case $1 in - -*)set "./$1";; + -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi @@ -730,8 +752,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='gpgme' PACKAGE_TARNAME='gpgme' -PACKAGE_VERSION='1.1.8' -PACKAGE_STRING='gpgme 1.1.8' +PACKAGE_VERSION='1.2.0' +PACKAGE_STRING='gpgme 1.2.0' PACKAGE_BUGREPORT='bug-gpgme@gnupg.org' ac_unique_file="src/gpgme.h.in" @@ -771,180 +793,211 @@ ac_includes_default="\ # include #endif" -ac_subst_vars='SHELL -PATH_SEPARATOR -PACKAGE_NAME -PACKAGE_TARNAME -PACKAGE_VERSION -PACKAGE_STRING -PACKAGE_BUGREPORT -exec_prefix -prefix -program_transform_name -bindir -sbindir -libexecdir -datarootdir -datadir -sysconfdir -sharedstatedir -localstatedir -includedir -oldincludedir -docdir -infodir -htmldir -dvidir -pdfdir -psdir -libdir -localedir -mandir -DEFS -ECHO_C -ECHO_N -ECHO_T -LIBS +ac_subst_vars='LTLIBOBJS +GPGME_CONFIG_CFLAGS +GPGME_CONFIG_LIBS +GPGME_CONFIG_API_VERSION +BUILD_FILEVERSION +BUILD_TIMESTAMP +BUILD_REVISION +BUILD_COMPLUS_FALSE +BUILD_COMPLUS_TRUE +USE_DESCRIPTOR_PASSING_FALSE +USE_DESCRIPTOR_PASSING_TRUE +BUILD_ASSUAN_FALSE +BUILD_ASSUAN_TRUE +BUILD_GPGCONF_FALSE +BUILD_GPGCONF_TRUE +RUN_GPGCONF_TESTS_FALSE +RUN_GPGCONF_TESTS_TRUE +HAVE_GPGCONF_FALSE +HAVE_GPGCONF_TRUE +GPGCONF +RUN_GPGSM_TESTS_FALSE +RUN_GPGSM_TESTS_TRUE +HAVE_GPGSM_FALSE +HAVE_GPGSM_TRUE +GPGSM +GPG_PATH +RUN_GPG_TESTS_FALSE +RUN_GPG_TESTS_TRUE +GPG +GPG_ERROR_LIBS +GPG_ERROR_CFLAGS +GPG_ERROR_CONFIG +GLIBC21 +LIBOBJS +NETLIBS +NEED__FILE_OFFSET_BITS +HAVE_PTHREAD_FALSE +HAVE_PTHREAD_TRUE +HAVE_PTH_FALSE +HAVE_PTH_TRUE +BUILD_W32_QT_FALSE +BUILD_W32_QT_TRUE +BUILD_W32_GLIB_FALSE +BUILD_W32_GLIB_TRUE +HAVE_W32_SYSTEM_FALSE +HAVE_W32_SYSTEM_TRUE +HAVE_DOSISH_SYSTEM_FALSE +HAVE_DOSISH_SYSTEM_TRUE +PTH_LIBS +PTH_LDFLAGS +PTH_CFLAGS +PTH_CPPFLAGS +QT4_CORE_LIBS +QT4_CORE_CFLAGS +GLIB_MKENUMS +GOBJECT_QUERY +GLIB_GENMARSHAL +GLIB_LIBS +GLIB_CFLAGS +PKG_CONFIG +HAVE_LD_VERSION_SCRIPT_FALSE +HAVE_LD_VERSION_SCRIPT_TRUE +LIBTOOL +ac_ct_F77 +FFLAGS +F77 +CXXCPP +OBJDUMP +AS +DLLTOOL +RANLIB +AR +ECHO +LN_S +RC +LIBGPGME_LT_REVISION +LIBGPGME_LT_AGE +LIBGPGME_LT_CURRENT +am__fastdepCXX_FALSE +am__fastdepCXX_TRUE +CXXDEPMODE +ac_ct_CXX +CXXFLAGS +CXX +EGREP +GREP +CPP +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +MAINT +MAINTAINER_MODE_FALSE +MAINTAINER_MODE_TRUE +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias build_alias -host_alias -target_alias -INSTALL_PROGRAM -INSTALL_SCRIPT -INSTALL_DATA -am__isrc -CYGPATH_W -PACKAGE -VERSION -ACLOCAL -AUTOCONF -AUTOMAKE -AUTOHEADER -MAKEINFO -install_sh -STRIP -INSTALL_STRIP_PROGRAM -mkdir_p -AWK -SET_MAKE -am__leading_dot -AMTAR -am__tar -am__untar -MAINTAINER_MODE_TRUE -MAINTAINER_MODE_FALSE -MAINT -build -build_cpu -build_vendor -build_os -host -host_cpu -host_vendor -host_os -CC -CFLAGS -LDFLAGS -CPPFLAGS -ac_ct_CC -EXEEXT -OBJEXT -DEPDIR -am__include -am__quote -AMDEP_TRUE -AMDEP_FALSE -AMDEPBACKSLASH -CCDEPMODE -am__fastdepCC_TRUE -am__fastdepCC_FALSE -CXX -CXXFLAGS -ac_ct_CXX -CXXDEPMODE -am__fastdepCXX_TRUE -am__fastdepCXX_FALSE -LIBGPGME_LT_CURRENT -LIBGPGME_LT_AGE -LIBGPGME_LT_REVISION -RC -GREP -EGREP -LN_S -ECHO -AR -RANLIB -DLLTOOL -AS -OBJDUMP -CPP -CXXCPP -F77 -FFLAGS -ac_ct_F77 -LIBTOOL -HAVE_LD_VERSION_SCRIPT_TRUE -HAVE_LD_VERSION_SCRIPT_FALSE -PKG_CONFIG -GLIB_CFLAGS -GLIB_LIBS -GLIB_GENMARSHAL -GOBJECT_QUERY -GLIB_MKENUMS -QT4_CORE_CFLAGS -QT4_CORE_LIBS -PTH_CPPFLAGS -PTH_CFLAGS -PTH_LDFLAGS -PTH_LIBS -HAVE_DOSISH_SYSTEM_TRUE -HAVE_DOSISH_SYSTEM_FALSE -HAVE_W32_SYSTEM_TRUE -HAVE_W32_SYSTEM_FALSE -BUILD_W32_GLIB_TRUE -BUILD_W32_GLIB_FALSE -BUILD_W32_QT_TRUE -BUILD_W32_QT_FALSE -HAVE_PTH_TRUE -HAVE_PTH_FALSE -HAVE_PTHREAD_TRUE -HAVE_PTHREAD_FALSE -NETLIBS -LIBOBJS -GLIBC21 -GPG_ERROR_CONFIG -GPG_ERROR_CFLAGS -GPG_ERROR_LIBS -GPG -RUN_GPG_TESTS_TRUE -RUN_GPG_TESTS_FALSE -GPG_PATH -GPGSM -HAVE_GPGSM_TRUE -HAVE_GPGSM_FALSE -RUN_GPGSM_TESTS_TRUE -RUN_GPGSM_TESTS_FALSE -GPGCONF -HAVE_GPGCONF_TRUE -HAVE_GPGCONF_FALSE -RUN_GPGCONF_TESTS_TRUE -RUN_GPGCONF_TESTS_FALSE -BUILD_GPGCONF_TRUE -BUILD_GPGCONF_FALSE -BUILD_ASSUAN_TRUE -BUILD_ASSUAN_FALSE -USE_DESCRIPTOR_PASSING_TRUE -USE_DESCRIPTOR_PASSING_FALSE -BUILD_COMPLUS_TRUE -BUILD_COMPLUS_FALSE -BUILD_REVISION -BUILD_TIMESTAMP -BUILD_FILEVERSION -GPGME_CONFIG_API_VERSION -GPGME_CONFIG_LIBS -GPGME_CONFIG_CFLAGS -LTLIBOBJS' -ac_subst_files='' - ac_precious_vars='build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_maintainer_mode +enable_dependency_tracking +enable_static +enable_shared +enable_fast_install +with_gnu_ld +enable_libtool_lock +with_pic +with_tags +enable_glibtest +enable_w32_glib +enable_w32_qt +with_pth +with_pth_test +enable_largefile +with_gpg_error_prefix +with_gpg_version +with_gpgsm_version +with_gpgconf_version +with_gpg +enable_gpg_test +with_gpgsm +enable_gpgsm_test +with_gpgconf +enable_gpgconf_test +enable_fd_passing +' + ac_precious_vars='build_alias host_alias target_alias CC @@ -952,10 +1005,10 @@ CFLAGS LDFLAGS LIBS CPPFLAGS +CPP CXX CXXFLAGS CCC -CPP CXXCPP F77 FFLAGS' @@ -964,6 +1017,8 @@ FFLAGS' # Initialize some variables set by options. ac_init_help= ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null @@ -1062,13 +1117,21 @@ do datarootdir=$ac_optarg ;; -disable-* | --disable-*) - ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=no ;; + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; @@ -1081,13 +1144,21 @@ do dvidir=$ac_optarg ;; -enable-* | --enable-*) - ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=\$ac_optarg ;; + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -1278,22 +1349,38 @@ do ac_init_version=: ;; -with-* | --with-*) - ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=\$ac_optarg ;; + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=no ;; + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. @@ -1313,7 +1400,7 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) { echo "$as_me: error: unrecognized option: $ac_option + -*) { $as_echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; @@ -1322,16 +1409,16 @@ Try \`$0 --help' for more information." ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; @@ -1340,22 +1427,38 @@ done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { echo "$as_me: error: missing argument to $ac_option" >&2 + { $as_echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi -# Be sure to have absolute directory names. +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 + { (exit 1); exit 1; }; } ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac - { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done @@ -1370,7 +1473,7 @@ target=$target_alias if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes @@ -1386,10 +1489,10 @@ 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 .` || - { echo "$as_me: error: Working directory cannot be determined" >&2 + { $as_echo "$as_me: error: working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { echo "$as_me: error: pwd does not report name of working directory" >&2 + { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } @@ -1397,12 +1500,12 @@ test "X$ac_ls_di" = "X$ac_pwd_ls_di" || if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$0" || -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X"$0" | + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1429,12 +1532,12 @@ else fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 + cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. @@ -1461,7 +1564,7 @@ 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 gpgme 1.1.8 to adapt to many kinds of systems. +\`configure' configures gpgme 1.2.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1483,9 +1586,9 @@ Configuration: Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] + [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] + [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify @@ -1495,25 +1598,25 @@ for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/gpgme] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/gpgme] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF @@ -1531,11 +1634,12 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of gpgme 1.1.8:";; + short | recursive ) echo "Configuration of gpgme 1.2.0:";; esac cat <<\_ACEOF Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful @@ -1584,9 +1688,9 @@ Some influential environment variables: LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory + CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags - CPP C preprocessor CXXCPP C++ preprocessor F77 Fortran 77 compiler command FFLAGS Fortran 77 compiler flags @@ -1602,15 +1706,17 @@ 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" || 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=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -1646,7 +1752,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_ echo && $SHELL "$ac_srcdir/configure" --help=recursive else - echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done @@ -1655,11 +1761,11 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -gpgme configure 1.1.8 -generated by GNU Autoconf 2.61 +gpgme configure 1.2.0 +generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1669,8 +1775,8 @@ 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 gpgme $as_me 1.1.8, which was -generated by GNU Autoconf 2.61. Invocation command line was +It was created by gpgme $as_me 1.2.0, which was +generated by GNU Autoconf 2.63. Invocation command line was $ $0 $@ @@ -1706,7 +1812,7 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - echo "PATH: $as_dir" + $as_echo "PATH: $as_dir" done IFS=$as_save_IFS @@ -1741,7 +1847,7 @@ do | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; @@ -1793,11 +1899,12 @@ _ASBOX case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac @@ -1827,9 +1934,9 @@ _ASBOX do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - echo "$ac_var='\''$ac_val'\''" + $as_echo "$ac_var='\''$ac_val'\''" done | sort echo @@ -1844,9 +1951,9 @@ _ASBOX do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - echo "$ac_var='\''$ac_val'\''" + $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi @@ -1862,8 +1969,8 @@ _ASBOX echo fi test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - echo "$as_me: exit $exit_status" + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && @@ -1905,21 +2012,24 @@ _ACEOF # Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - set x "$CONFIG_SITE" + ac_site_file1=$CONFIG_SITE elif test "x$prefix" != xNONE; then - set x "$prefix/share/config.site" "$prefix/etc/config.site" + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site else - set x "$ac_default_prefix/share/config.site" \ - "$ac_default_prefix/etc/config.site" + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site fi -shift -for ac_site_file +for ac_site_file in "$ac_site_file1" "$ac_site_file2" do + test "x$ac_site_file" = xNONE && continue if test -r "$ac_site_file"; then - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} + { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi @@ -1929,16 +2039,16 @@ if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi @@ -1952,29 +2062,38 @@ for ac_var in $ac_precious_vars; do eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -1984,10 +2103,12 @@ echo "$as_me: current value: $ac_new_v fi done if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi @@ -2030,18 +2151,18 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu # (Interfaces added: AGE++) # (Interfaces removed/changed: AGE=0) # -LIBGPGME_LT_CURRENT=17 +LIBGPGME_LT_CURRENT=18 # Subtract 2 from this value if you want to make the LFS transition an # ABI break. [Note to self: Remove this comment with the next regular break.] -LIBGPGME_LT_AGE=6 -LIBGPGME_LT_REVISION=6 +LIBGPGME_LT_AGE=7 +LIBGPGME_LT_REVISION=0 # If the API is changed in an incompatible way: increment the next counter. GPGME_CONFIG_API_VERSION=1 ############################################## -BUILD_REVISION=1351 +BUILD_REVISION=1385 PACKAGE=$PACKAGE_NAME VERSION=$PACKAGE_VERSION @@ -2067,8 +2188,8 @@ for ac_dir in "$srcdir" "$srcdir/.." "$s fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 -echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi @@ -2094,11 +2215,12 @@ ac_configure="$SHELL $ac_aux_dir/configu # 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. -{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -2127,17 +2249,29 @@ case $as_dir/ in # program-specific install script used by HP pwplus--don't use. : else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi fi fi done done ;; esac + done IFS=$as_save_IFS +rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then @@ -2150,8 +2284,8 @@ fi INSTALL=$ac_install_sh fi fi -{ echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6; } +{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -2161,8 +2295,8 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCR test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5 -echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file @@ -2185,9 +2319,9 @@ if ( # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". - { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken + { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 -echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +$as_echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi @@ -2198,26 +2332,23 @@ then # Ok. : else - { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! + { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 -echo "$as_me: error: newly created file is older than distributed files! +$as_echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi -{ echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } +{ $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" -# Double any \ or $. echo might interpret backslashes. +# Double any \ or $. # By default was `s,x,x', remove it if useless. -cat <<\_ACEOF >conftest.sed -s/[\\$]/&&/g;s/;s,x,x,$// -_ACEOF -program_transform_name=`echo $program_transform_name | sed -f conftest.sed` -rm -f conftest.sed +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` @@ -2228,15 +2359,15 @@ if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= - { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 -echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi -{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 -echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin @@ -2271,8 +2402,8 @@ fi MKDIR_P="$ac_install_sh -d" fi fi -{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5 -echo "${ECHO_T}$MKDIR_P" >&6; } +{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in @@ -2284,10 +2415,10 @@ for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AWK+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. @@ -2300,7 +2431,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2311,22 +2442,23 @@ fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - { echo "$as_me:$LINENO: result: $AWK" >&5 -echo "${ECHO_T}$AWK" >&6; } + { $as_echo "$as_me:$LINENO: result: $AWK" >&5 +$as_echo "$AWK" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi test -n "$AWK" && break done -{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } -set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh @@ -2343,12 +2475,12 @@ esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } SET_MAKE= else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi @@ -2367,8 +2499,8 @@ if test "`cd $srcdir && pwd`" != "`pwd`" am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then - { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 -echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +$as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi fi @@ -2423,10 +2555,10 @@ if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. @@ -2439,7 +2571,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2450,11 +2582,11 @@ fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - { echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6; } + { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2463,10 +2595,10 @@ if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. @@ -2479,7 +2611,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2490,11 +2622,11 @@ fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then @@ -2502,12 +2634,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP @@ -2531,8 +2659,8 @@ am__tar='${AMTAR} chof - "$$tardir"'; am -{ echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 -echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 +$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval @@ -2540,8 +2668,8 @@ else USE_MAINTAINER_MODE=no fi - { echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 -echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6; } + { $as_echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 +$as_echo "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' @@ -2555,34 +2683,34 @@ fi # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 -echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 +$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } -{ echo "$as_me:$LINENO: checking build system type" >&5 -echo $ECHO_N "checking build system type... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } if test "${ac_cv_build+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && - { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 -echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} + { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 +$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi -{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -echo "${ECHO_T}$ac_cv_build" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 -echo "$as_me: error: invalid value of canonical build" >&2;} +*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 +$as_echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build @@ -2599,27 +2727,27 @@ IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac -{ echo "$as_me:$LINENO: checking host system type" >&5 -echo $ECHO_N "checking host system type... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } if test "${ac_cv_host+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} + { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 +$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -echo "${ECHO_T}$ac_cv_host" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 -echo "$as_me: error: invalid value of canonical host" >&2;} +*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 +$as_echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; esac host=$ac_cv_host @@ -2638,14 +2766,66 @@ case $host_os in *\ *) host_os=`echo "$h # Enable GNU extensions on systems that have them. +DEPDIR="${am__leading_dot}deps" -cat >>confdefs.h <<\_ACEOF -#define _GNU_SOURCE 1 -_ACEOF +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi +{ $as_echo "$as_me:$LINENO: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then + enableval=$enable_dependency_tracking; +fi +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi ac_ext=c @@ -2656,10 +2836,10 @@ 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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2672,7 +2852,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2683,11 +2863,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2696,10 +2876,10 @@ 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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -2712,7 +2892,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2723,11 +2903,11 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -2735,12 +2915,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -2753,10 +2929,10 @@ 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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2769,7 +2945,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2780,11 +2956,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2793,10 +2969,10 @@ 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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2814,7 +2990,7 @@ do continue fi ac_cv_prog_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2837,11 +3013,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2852,10 +3028,10 @@ if test -z "$CC"; then 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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2868,7 +3044,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2879,11 +3055,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2896,10 +3072,10 @@ if test -z "$CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -2912,7 +3088,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2923,11 +3099,11 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2939,12 +3115,8 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -2954,44 +3126,50 @@ fi fi -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH +$as_echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } # Provide some information about the compiler. -echo "$as_me:$LINENO: checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` +$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF @@ -3010,27 +3188,22 @@ main () } _ACEOF ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe b.out" +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. -{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -# -# List of possible output files, starting from the most likely. -# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) -# only as a last resort. b.out is created by i960 compilers. -ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' -# -# The IRIX 6 linker writes into existing files which may not be -# executable, retaining their permissions. Remove them first so a -# subsequent execution test works. +{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + ac_rmfiles= for ac_file in $ac_files do case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done @@ -3041,10 +3214,11 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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' @@ -3055,7 +3229,7 @@ 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 | *.o | *.obj ) + *.$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 @@ -3082,25 +3256,27 @@ else ac_file='' fi -{ echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } if test -z "$ac_file"; then - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 -echo "$as_me: error: C compiler cannot create executables +$as_echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then @@ -3109,49 +3285,53 @@ if test "$cross_compiling" != yes; then *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { echo "$as_me:$LINENO: error: cannot run C compiled programs. + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run C compiled programs. +$as_echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi fi fi -{ echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } +{ $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } -rm -f a.out a.exe conftest$ac_cv_exeext b.out +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } -{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } -{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will @@ -3160,31 +3340,33 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec 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 | *.o | *.obj ) ;; + *.$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 - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi rm -f conftest$ac_cv_exeext -{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } if test "${ac_cv_objext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3207,40 +3389,43 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile +$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3266,20 +3451,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no @@ -3289,15 +3475,19 @@ rm -f core conftest.err conftest.$ac_obj ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } -GCC=`test $ac_compiler_gnu = yes && echo yes` +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes @@ -3324,20 +3514,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" @@ -3362,20 +3553,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag @@ -3401,20 +3593,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -3429,8 +3622,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -3446,10 +3639,10 @@ else CFLAGS= fi fi -{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC @@ -3520,20 +3713,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -3549,15 +3743,15 @@ fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) - { echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6; } ;; + { $as_echo "$as_me:$LINENO: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; xno) - { echo "$as_me:$LINENO: result: unsupported" >&5 -echo "${ECHO_T}unsupported" >&6; } ;; + { $as_echo "$as_me:$LINENO: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" - { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; + { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac @@ -3566,75 +3760,13 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -DEPDIR="${am__leading_dot}deps" - -ac_config_commands="$ac_config_commands depfiles" - - -am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo done -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 -echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; } -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# We grep out `Entering directory' and `Leaving directory' -# messages which can occur if `w' ends up in MAKEFLAGS. -# In particular we don't look at `^make:' because GNU make might -# be invoked under some other name (usually "gmake"), in which -# case it prints its new name instead of `make'. -if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then - am__include=include - am__quote= - _am_result=GNU -fi -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then - am__include=.include - am__quote="\"" - _am_result=BSD - fi -fi - - -{ echo "$as_me:$LINENO: result: $_am_result" >&5 -echo "${ECHO_T}$_am_result" >&6; } -rm -f confinc confmf - -# Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then - enableval=$enable_dependency_tracking; -fi - -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' -fi - if test "x$enable_dependency_tracking" != xno; then - AMDEP_TRUE= - AMDEP_FALSE='#' -else - AMDEP_TRUE='#' - AMDEP_FALSE= -fi - - depcc="$CC" am_compiler_list= -{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 -echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up @@ -3722,8 +3854,8 @@ else fi fi -{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 -echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } +{ $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if @@ -3737,1457 +3869,1074 @@ else fi -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test -z "$CXX"; then - if test -n "$CCC"; then - CXX=$CCC - else - if test -n "$ac_tool_prefix"; then - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CXX"; then - ac_cv_prog_CXX="$CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -CXX=$ac_cv_prog_CXX -if test -n "$CXX"; then - { echo "$as_me:$LINENO: result: $CXX" >&5 -echo "${ECHO_T}$CXX" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - test -n "$CXX" && break - done +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= fi -if test -z "$CXX"; then - ac_ct_CXX=$CXX - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CXX"; then - ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + $as_echo_n "(cached) " >&6 else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CXX="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_CXX=$ac_cv_prog_ac_ct_CXX -if test -n "$ac_ct_CXX"; then - { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 -echo "${ECHO_T}$ac_ct_CXX" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$ac_ct_CXX" && break -done - - if test "x$ac_ct_CXX" = x; then - CXX="g++" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - CXX=$ac_ct_CXX - fi -fi - - fi -fi -# Provide some information about the compiler. -echo "$as_me:$LINENO: checking for C++ compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (ac_try="$ac_compiler --version >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler --version >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -V >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -{ echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; } -if test "${ac_cv_cxx_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me +#ifdef __STDC__ +# include +#else +# include #endif - - ; - return 0; -} + Syntax error _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" +if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_compiler_gnu=yes + }; then + : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_compiler_gnu=no + # Broken: fails on valid input. +continue fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_cxx_compiler_gnu=$ac_compiler_gnu +rm -f conftest.err conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; } -GXX=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CXXFLAGS=${CXXFLAGS+set} -ac_save_CXXFLAGS=$CXXFLAGS -{ echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 -echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; } -if test "${ac_cv_prog_cxx_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_save_cxx_werror_flag=$ac_cxx_werror_flag - ac_cxx_werror_flag=yes - ac_cv_prog_cxx_g=no - CXXFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} +#include _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" +if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cxx_g=yes + }; then + # Broken: success on invalid input. +continue else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - CXXFLAGS="" - cat >conftest.$ac_ext <<_ACEOF + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:$LINENO: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" +if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then + }; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cxx_werror_flag=$ac_save_cxx_werror_flag - CXXFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} +#include _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" +if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cxx_g=yes + }; then + # Broken: success on invalid input. +continue else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + # Passes both tests. +ac_preproc_ok=: +break fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi +rm -f conftest.err conftest.$ac_ext -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cxx_werror_flag=$ac_save_cxx_werror_flag -fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; } -if test "$ac_test_CXXFLAGS" = set; then - CXXFLAGS=$ac_save_CXXFLAGS -elif test $ac_cv_prog_cxx_g = yes; then - if test "$GXX" = yes; then - CXXFLAGS="-g -O2" - else - CXXFLAGS="-g" - fi +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : else - if test "$GXX" = yes; then - CXXFLAGS="-O2" - else - CXXFLAGS= - fi + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; }; } fi + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -depcc="$CXX" am_compiler_list= -{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 -echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } -if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + $as_echo_n "(cached) " >&6 else - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CXX_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - case $depmode in - nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - none) break ;; - esac - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. - if depmode=$depmode \ - source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CXX_dependencies_compiler_type=$depmode - break - fi + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + 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 - cd .. - rm -rf conftest.dir + $ac_path_GREP_found && break 3 + done + done +done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } + fi else - am_cv_CXX_dependencies_compiler_type=none + ac_cv_path_GREP=$GREP fi fi -{ echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 -echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6; } -CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" - if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then - am__fastdepCXX_TRUE= - am__fastdepCXX_FALSE='#' + +{ $as_echo "$as_me:$LINENO: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + $as_echo_n "(cached) " >&6 else - am__fastdepCXX_TRUE='#' - am__fastdepCXX_FALSE= -fi - + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + 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_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } + fi +else + ac_cv_path_EGREP=$EGREP +fi + fi +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" +{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +int +main () +{ + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_stdc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -cat >>confdefs.h <<_ACEOF -#define PACKAGE "$PACKAGE" +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ _ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include - -cat >>confdefs.h <<_ACEOF -#define VERSION "$VERSION" _ACEOF - - -# Don't default to build static libs. -# Check whether --enable-static was given. -if test "${enable_static+set}" = set; then - enableval=$enable_static; p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : else - enable_static=no + ac_cv_header_stdc=no fi +rm -f conftest* +fi +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* +fi -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args. -set dummy ${ac_tool_prefix}windres; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_RC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : else - if test -n "$RC"; then - ac_cv_prog_RC="$RC" # Let the user override the test. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +rm -f 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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { 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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_RC="${ac_tool_prefix}windres" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +( exit $ac_status ) +ac_cv_header_stdc=no fi -fi -RC=$ac_cv_prog_RC -if test -n "$RC"; then - { echo "$as_me:$LINENO: result: $RC" >&5 -echo "${ECHO_T}$RC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } +rm -rf conftest.dSYM +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -if test -z "$ac_cv_prog_RC"; then - ac_ct_RC=$RC - # Extract the first word of "windres", so it can be a program name with args. -set dummy windres; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_RC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_RC"; then - ac_cv_prog_ac_ct_RC="$ac_ct_RC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_RC="windres" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_RC=$ac_cv_prog_ac_ct_RC -if test -n "$ac_ct_RC"; then - { echo "$as_me:$LINENO: result: $ac_ct_RC" >&5 -echo "${ECHO_T}$ac_ct_RC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF - if test "x$ac_ct_RC" = x; then - RC="no" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - RC=$ac_ct_RC - fi -else - RC="$ac_cv_prog_RC" fi +# On IRIX 5.3, sys/types and inttypes.h are conflicting. -# Check whether --enable-shared was given. -if test "${enable_shared+set}" = set; then - enableval=$enable_shared; p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_shared=yes -fi -# Check whether --enable-fast-install was given. -if test "${enable_fast_install+set}" = set; then - enableval=$enable_fast_install; p=${PACKAGE-default} - case $enableval in - yes) enable_fast_install=yes ;; - no) enable_fast_install=no ;; - *) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_fast_install=yes -fi -{ echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 -echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; } -if test "${lt_cv_path_SED+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Loop through the user's path and test for sed and gsed. -# Then use that list of sed's as ones to test for truncation. -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for lt_ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then - lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" - fi - done - done -done -lt_ac_max=0 -lt_ac_count=0 -# Add /usr/xpg4/bin/sed as it is typically found on Solaris -# along with /bin/sed that truncates output. -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f $lt_ac_sed && break - cat /dev/null > conftest.in - lt_ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >conftest.in - # Check for GNU sed and select it if it is found. - if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then - lt_cv_path_SED=$lt_ac_sed - break - fi - while true; do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo >>conftest.nl - $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break - cmp -s conftest.out conftest.nl || break - # 10000 chars as input seems more than enough - test $lt_ac_count -gt 10 && break - lt_ac_count=`expr $lt_ac_count + 1` - if test $lt_ac_count -gt $lt_ac_max; then - lt_ac_max=$lt_ac_count - lt_cv_path_SED=$lt_ac_sed - fi - done -done -SED=$lt_cv_path_SED - -fi - -{ echo "$as_me:$LINENO: result: $SED" >&5 -echo "${ECHO_T}$SED" >&6; } - -{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 -echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } -if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Extract the first word of "grep ggrep" to use in msg output -if test -z "$GREP"; then -set dummy grep ggrep; ac_prog_name=$2 -if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 else - ac_path_GREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue - # Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - echo 'GREP' >> "conftest.nl" - "$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 - ac_count=`expr $ac_count + 1` - 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 + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + eval "$as_ac_Header=no" fi -GREP="$ac_cv_path_GREP" -if test -z "$GREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF -else - ac_cv_path_GREP=$GREP fi +done -fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 -echo "${ECHO_T}$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" -{ echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - # Extract the first word of "egrep" to use in msg output -if test -z "$EGREP"; then -set dummy egrep; ac_prog_name=$2 -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + if test "${ac_cv_header_minix_config_h+set}" = set; then + { $as_echo "$as_me:$LINENO: checking for minix/config.h" >&5 +$as_echo_n "checking for minix/config.h... " >&6; } +if test "${ac_cv_header_minix_config_h+set}" = set; then + $as_echo_n "(cached) " >&6 +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 +$as_echo "$ac_cv_header_minix_config_h" >&6; } else - ac_path_EGREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue - # Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` - 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;; + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking minix/config.h usability" >&5 +$as_echo_n "checking minix/config.h usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - - $ac_path_EGREP_found && break 3 - done -done - -done -IFS=$as_save_IFS - - + ac_header_compiler=no fi -EGREP="$ac_cv_path_EGREP" -if test -z "$EGREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } -fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking minix/config.h presence" >&5 +$as_echo_n "checking minix/config.h presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +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:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes else - ac_cv_path_EGREP=$EGREP -fi - + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - fi + ac_header_preproc=no fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 -echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } -# Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then - withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes -else - with_gnu_ld=no -fi - -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - { echo "$as_me:$LINENO: checking for ld used by $CC" >&5 -echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&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 +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: minix/config.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: minix/config.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: minix/config.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: minix/config.h: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ---------------------------------- ## +## Report this to bug-gpgme@gnupg.org ## +## ---------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 ;; - esac -elif test "$with_gnu_ld" = yes; then - { echo "$as_me:$LINENO: checking for GNU ld" >&5 -echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } -else - { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 -echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } -fi -if test "${lt_cv_path_LD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 &5 +$as_echo_n "checking for minix/config.h... " >&6; } +if test "${ac_cv_header_minix_config_h+set}" = set; then + $as_echo_n "(cached) " >&6 else - lt_cv_path_LD="$LD" # Let the user override the test with a path. -fi + ac_cv_header_minix_config_h=$ac_header_preproc fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 +$as_echo "$ac_cv_header_minix_config_h" >&6; } -LD="$lt_cv_path_LD" -if test -n "$LD"; then - { echo "$as_me:$LINENO: result: $LD" >&5 -echo "${ECHO_T}$LD" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } fi -test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 -echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} - { (exit 1); exit 1; }; } -{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 -echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } -if test "${lt_cv_prog_gnu_ld+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +if test "x$ac_cv_header_minix_config_h" = x""yes; then + MINIX=yes else - # I'd rather use --version here, but apparently some GNU ld's only accept -v. -case `$LD -v 2>&1 &5 -echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$lt_cv_prog_gnu_ld -{ echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 -echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6; } -if test "${lt_cv_ld_reload_flag+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_ld_reload_flag='-r' -fi -{ echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 -echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6; } -reload_flag=$lt_cv_ld_reload_flag -case $reload_flag in -"" | " "*) ;; -*) reload_flag=" $reload_flag" ;; -esac -reload_cmds='$LD$reload_flag -o $output$reload_objs' + if test "$MINIX" = yes; then -{ echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 -echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6; } -if test "${lt_cv_path_NM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +cat >>confdefs.h <<\_ACEOF +#define _POSIX_SOURCE 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define _POSIX_1_SOURCE 2 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define _MINIX 1 +_ACEOF + + fi + + + + { $as_echo "$as_me:$LINENO: checking whether it is safe to define __EXTENSIONS__" >&5 +$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if test "${ac_cv_safe_to_define___extensions__+set}" = set; then + $as_echo_n "(cached) " >&6 else - if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +# define __EXTENSIONS__ 1 + $ac_includes_default +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_safe_to_define___extensions__=yes else - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/${ac_tool_prefix}nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - esac - fi - done - IFS="$lt_save_ifs" - test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm -fi + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_safe_to_define___extensions__=no fi -{ echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 -echo "${ECHO_T}$lt_cv_path_NM" >&6; } -NM="$lt_cv_path_NM" -{ echo "$as_me:$LINENO: checking whether ln -s works" >&5 -echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; } -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } -else - { echo "$as_me:$LINENO: result: no, using $LN_S" >&5 -echo "${ECHO_T}no, using $LN_S" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_safe_to_define___extensions__" >&5 +$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } + test $ac_cv_safe_to_define___extensions__ = yes && + cat >>confdefs.h <<\_ACEOF +#define __EXTENSIONS__ 1 +_ACEOF -{ echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 -echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6; } -if test "${lt_cv_deplibs_check_method+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_file_magic_cmd='$MAGIC_CMD' -lt_cv_file_magic_test_file= -lt_cv_deplibs_check_method='unknown' -# Need to set the preceding variable on all platforms that support -# interlibrary dependencies. -# 'none' -- dependencies not supported. -# `unknown' -- same as none, but documents that we really don't know. -# 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. -# 'file_magic [[regex]]' -- check by looking for files in library path -# which responds to the $file_magic_cmd with a given extended regex. -# If you have `file' or equivalent on your system and you're not sure -# whether `pass_all' will *always* work, you probably want this one. + cat >>confdefs.h <<\_ACEOF +#define _ALL_SOURCE 1 +_ACEOF -case $host_os in -aix4* | aix5*) - lt_cv_deplibs_check_method=pass_all - ;; + cat >>confdefs.h <<\_ACEOF +#define _GNU_SOURCE 1 +_ACEOF -beos*) - lt_cv_deplibs_check_method=pass_all - ;; + cat >>confdefs.h <<\_ACEOF +#define _POSIX_PTHREAD_SEMANTICS 1 +_ACEOF -bsdi4*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' - lt_cv_file_magic_test_file=/shlib/libc.so - ;; + cat >>confdefs.h <<\_ACEOF +#define _TANDEM_SOURCE 1 +_ACEOF -cygwin*) - # func_win32_libid is a shell function defined in ltmain.sh - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - ;; -mingw* | pw32*) - # Base MSYS/MinGW do not provide the 'file' command needed by - # func_win32_libid shell function, so use a weaker test based on 'objdump'. - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; -darwin* | rhapsody*) - lt_cv_deplibs_check_method=pass_all - ;; -freebsd* | kfreebsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case "$host_cpu" in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; - -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be Linux ELF. -linux*) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd* | knetbsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi - ;; +done +done +IFS=$as_save_IFS -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi -nto-qnx*) - lt_cv_deplibs_check_method=unknown - ;; -openbsd*) - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' - else - lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi - ;; - -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; - -sco3.2v5*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; +done +done +IFS=$as_save_IFS -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi -sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; esac - + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" fi -{ echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 -echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; } -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown - - +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi -# Allow CC to be a program name with arguments. -compiler=$CC + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS -# Check whether --enable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then - enableval=$enable_libtool_lock; +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case `/usr/bin/file conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE="32" - ;; - *ELF-64*) - HPUX_IA64_MODE="64" - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out which ABI we are using. - echo '#line 5027 "configure"' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case "`/usr/bin/file conftest.o`" in - *32-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - { echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 -echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6; } -if test "${lt_cv_cc_needs_belf+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - lt_cv_cc_needs_belf=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - lt_cv_cc_needs_belf=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -{ echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 -echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6; } - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; -*-*-cygwin* | *-*-mingw* | *-*-pw32*) +if test -z "$CC"; then if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. -set dummy ${ac_tool_prefix}dlltool; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_DLLTOOL+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&6 else - if test -n "$DLLTOOL"; then - ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. + 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 @@ -5196,8 +4945,8 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5206,28 +4955,32 @@ IFS=$as_save_IFS fi fi -DLLTOOL=$ac_cv_prog_DLLTOOL -if test -n "$DLLTOOL"; then - { echo "$as_me:$LINENO: result: $DLLTOOL" >&5 -echo "${ECHO_T}$DLLTOOL" >&6; } +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$CC" && break + done fi -if test -z "$ac_cv_prog_DLLTOOL"; then - ac_ct_DLLTOOL=$DLLTOOL - # Extract the first word of "dlltool", so it can be a program name with args. -set dummy dlltool; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_DLLTOOL"; then - ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. + 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 @@ -5236,8 +4989,8 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_DLLTOOL="dlltool" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5246,724 +4999,2115 @@ IFS=$as_save_IFS fi fi -ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL -if test -n "$ac_ct_DLLTOOL"; then - { echo "$as_me:$LINENO: result: $ac_ct_DLLTOOL" >&5 -echo "${ECHO_T}$ac_ct_DLLTOOL" >&6; } +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi - if test "x$ac_ct_DLLTOOL" = x; then - DLLTOOL="false" + + 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:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - DLLTOOL=$ac_ct_DLLTOOL + CC=$ac_ct_CC fi -else - DLLTOOL="$ac_cv_prog_DLLTOOL" fi - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. -set dummy ${ac_tool_prefix}as; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_AS+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$AS"; then - ac_cv_prog_AS="$AS" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AS="${ac_tool_prefix}as" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -AS=$ac_cv_prog_AS -if test -n "$AS"; then - { echo "$as_me:$LINENO: result: $AS" >&5 -echo "${ECHO_T}$AS" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } fi -fi -if test -z "$ac_cv_prog_AS"; then - ac_ct_AS=$AS - # Extract the first word of "as", so it can be a program name with args. -set dummy as; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_AS+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_AS"; then - ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_AS="as" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_AS=$ac_cv_prog_ac_ct_AS -if test -n "$ac_ct_AS"; then - { echo "$as_me:$LINENO: result: $ac_ct_AS" >&5 -echo "${ECHO_T}$ac_ct_AS" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi +test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +$as_echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; }; } - if test "x$ac_ct_AS" = x; then - AS="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; +# Provide some information about the compiler. +$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; esac - AS=$ac_ct_AS - fi -else - AS="$ac_cv_prog_AS" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. -set dummy ${ac_tool_prefix}objdump; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_OBJDUMP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$OBJDUMP"; then - ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler --version >&5") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } -fi -fi -OBJDUMP=$ac_cv_prog_OBJDUMP -if test -n "$OBJDUMP"; then - { echo "$as_me:$LINENO: result: $OBJDUMP" >&5 -echo "${ECHO_T}$OBJDUMP" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then + $as_echo_n "(cached) " >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int +main () +{ +#ifndef __GNUC__ + choke me +#endif -fi -if test -z "$ac_cv_prog_OBJDUMP"; then - ac_ct_OBJDUMP=$OBJDUMP - # Extract the first word of "objdump", so it can be a program name with args. -set dummy objdump; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_OBJDUMP"; then - ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_compiler_gnu=yes else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_OBJDUMP="objdump" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_compiler_gnu=no fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + fi -ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP -if test -n "$ac_ct_OBJDUMP"; then - { echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5 -echo "${ECHO_T}$ac_ct_OBJDUMP" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + GCC= fi - - if test "x$ac_ct_OBJDUMP" = x; then - OBJDUMP="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - OBJDUMP=$ac_ct_OBJDUMP - fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then + $as_echo_n "(cached) " >&6 else - OBJDUMP="$ac_cv_prog_OBJDUMP" -fi + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ - ;; +int +main () +{ + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; esac - -need_locks="$enable_libtool_lock" - - -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 -{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error + +int +main () +{ + + ; + return 0; +} _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || test ! -s conftest.err - }; then + } && test -s conftest.$ac_objext; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - # Broken: fails on valid input. -continue -fi + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -rm -f conftest.err conftest.$ac_ext +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_c89=$ac_arg +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:$LINENO: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:$LINENO: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CXX+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { $as_echo "$as_me:$LINENO: result: $CXX" >&5 +$as_echo "$CXX" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +$as_echo "$as_me:$LINENO: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler --version >&5") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +if test "${ac_cv_cxx_compiler_gnu+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_compiler_gnu=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ $as_echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } +if test "${ac_cv_prog_cxx_g+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cxx_g=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CXXFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cxx_g=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CXX" am_compiler_list= + +{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi + + + + + + + + + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + + +# Don't default to build static libs. +# Check whether --enable-static was given. +if test "${enable_static+set}" = set; then + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_static=no +fi + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args. +set dummy ${ac_tool_prefix}windres; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_RC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$RC"; then + ac_cv_prog_RC="$RC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RC="${ac_tool_prefix}windres" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +RC=$ac_cv_prog_RC +if test -n "$RC"; then + { $as_echo "$as_me:$LINENO: result: $RC" >&5 +$as_echo "$RC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RC"; then + ac_ct_RC=$RC + # Extract the first word of "windres", so it can be a program name with args. +set dummy windres; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_RC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RC"; then + ac_cv_prog_ac_ct_RC="$ac_ct_RC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RC="windres" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_RC=$ac_cv_prog_ac_ct_RC +if test -n "$ac_ct_RC"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_RC" >&5 +$as_echo "$ac_ct_RC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RC" = x; then + RC="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RC=$ac_ct_RC + fi +else + RC="$ac_cv_prog_RC" +fi + + + + + + +# Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_shared=yes +fi + + +# Check whether --enable-fast-install was given. +if test "${enable_fast_install+set}" = set; then + enableval=$enable_fast_install; p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_fast_install=yes +fi + + +{ $as_echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if test "${lt_cv_path_SED+set}" = set; then + $as_echo_n "(cached) " >&6 +else + # Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && break + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +SED=$lt_cv_path_SED + +fi + +{ $as_echo "$as_me:$LINENO: result: $SED" >&5 +$as_echo "$SED" >&6; } + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if test "${lt_cv_path_LD+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +$as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +{ $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if test "${lt_cv_prog_gnu_ld+set}" = set; then + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU ld's only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + +{ $as_echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if test "${lt_cv_ld_reload_flag+set}" = set; then + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' + +{ $as_echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 +$as_echo_n "checking for BSD-compatible nm... " >&6; } +if test "${lt_cv_path_NM+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/${ac_tool_prefix}nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + esac + fi + done + IFS="$lt_save_ifs" + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +fi +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } +NM="$lt_cv_path_NM" + +{ $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + +{ $as_echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 +$as_echo_n "checking how to recognise dependent libraries... " >&6; } +if test "${lt_cv_deplibs_check_method+set}" = set; then + $as_echo_n "(cached) " >&6 +else + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case $host_os in +aix4* | aix5*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi4*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump'. + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | kfreebsd*-gnu) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case "$host_cpu" in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux*) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd* | knetbsd*-gnu) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +nto-qnx*) + lt_cv_deplibs_check_method=unknown + ;; + +openbsd*) + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' + else + lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +sco3.2v5*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ $as_echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$lt_cv_deplibs_check_method" >&6; } +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then + enableval=$enable_libtool_lock; +fi + +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '#line 6652 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case "`/usr/bin/file conftest.o`" in + *32-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + { $as_echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if test "${lt_cv_cc_needs_belf+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include + +int +main () +{ + + ; + return 0; +} _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext }; then - # Broken: success on invalid input. -continue + lt_cv_cc_needs_belf=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - # Passes both tests. -ac_preproc_ok=: -break + lt_cv_cc_needs_belf=no fi -rm -f conftest.err conftest.$ac_ext +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - break fi - - done - ac_cv_prog_CPP=$CPP +{ $as_echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$lt_cv_cc_needs_belf" >&6; } + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +*-*-cygwin* | *-*-mingw* | *-*-pw32*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DLLTOOL+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP fi -{ echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:$LINENO: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - # Broken: success on invalid input. -continue +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then + $as_echo_n "(cached) " >&6 else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS - # Passes both tests. -ac_preproc_ok=: -break fi - -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } -if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_header_stdc=yes + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AS+set}" = set; then + $as_echo_n "(cached) " >&6 else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AS="${ac_tool_prefix}as" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS - ac_cv_header_stdc=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no fi -rm -f conftest* - +AS=$ac_cv_prog_AS +if test -n "$AS"; then + { $as_echo "$as_me:$LINENO: result: $AS" >&5 +$as_echo "$AS" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no fi -rm -f conftest* +if test -z "$ac_cv_prog_AS"; then + ac_ct_AS=$AS + # Extract the first word of "as", so it can be a program name with args. +set dummy as; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_AS+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AS"; then + ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AS="as" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : +fi +ac_ct_AS=$ac_cv_prog_ac_ct_AS +if test -n "$ac_ct_AS"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_AS" >&5 +$as_echo "$ac_ct_AS" >&6; } else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; + if test "x$ac_ct_AS" = x; then + AS="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : + AS=$ac_ct_AS + fi else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + AS="$ac_cv_prog_AS" fi + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OBJDUMP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF - +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:$LINENO: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi -# On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" + OBJDUMP=$ac_ct_OBJDUMP + fi else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" + OBJDUMP="$ac_cv_prog_OBJDUMP" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + ;; -fi +esac -done +need_locks="$enable_libtool_lock" for ac_header in dlfcn.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5979,32 +7123,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6018,51 +7163,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------- ## ## Report this to bug-gpgme@gnupg.org ## @@ -6071,21 +7217,24 @@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -6097,11 +7246,11 @@ ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -{ echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 -echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 +$as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" @@ -6133,20 +7282,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. @@ -6170,13 +7320,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err @@ -6184,7 +7335,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. @@ -6209,8 +7360,8 @@ fi else ac_cv_prog_CXXCPP=$CXXCPP fi -{ echo "$as_me:$LINENO: result: $CXXCPP" >&5 -echo "${ECHO_T}$CXXCPP" >&6; } +{ $as_echo "$as_me:$LINENO: result: $CXXCPP" >&5 +$as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do @@ -6238,20 +7389,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. @@ -6275,13 +7427,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err @@ -6289,7 +7442,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. @@ -6305,11 +7458,13 @@ rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else - { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&5 -echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check +$as_echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi ac_ext=cpp @@ -6328,10 +7483,10 @@ if test -n "$ac_tool_prefix"; then 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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$F77"; then ac_cv_prog_F77="$F77" # Let the user override the test. @@ -6344,7 +7499,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_F77="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6355,11 +7510,11 @@ fi fi F77=$ac_cv_prog_F77 if test -n "$F77"; then - { echo "$as_me:$LINENO: result: $F77" >&5 -echo "${ECHO_T}$F77" >&6; } + { $as_echo "$as_me:$LINENO: result: $F77" >&5 +$as_echo "$F77" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -6372,10 +7527,10 @@ if test -z "$F77"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_F77"; then ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. @@ -6388,7 +7543,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_F77="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6399,11 +7554,11 @@ fi fi ac_ct_F77=$ac_cv_prog_ac_ct_F77 if test -n "$ac_ct_F77"; then - { echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 -echo "${ECHO_T}$ac_ct_F77" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 +$as_echo "$ac_ct_F77" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -6415,12 +7570,8 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac F77=$ac_ct_F77 @@ -6429,37 +7580,41 @@ fi # Provide some information about the compiler. -echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` +$as_echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5 +set X $ac_compile +ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } rm -f a.out @@ -6467,10 +7622,10 @@ rm -f a.out # input file. (Note that this only needs to work for GNU compilers.) ac_save_ext=$ac_ext ac_ext=F -{ echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 +$as_echo_n "checking whether we are using the GNU Fortran 77 compiler... " >&6; } if test "${ac_cv_f77_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF program main @@ -6486,20 +7641,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no @@ -6509,16 +7665,16 @@ rm -f core conftest.err conftest.$ac_obj ac_cv_f77_compiler_gnu=$ac_compiler_gnu fi -{ echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 +$as_echo "$ac_cv_f77_compiler_gnu" >&6; } ac_ext=$ac_save_ext ac_test_FFLAGS=${FFLAGS+set} ac_save_FFLAGS=$FFLAGS FFLAGS= -{ echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 -echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 +$as_echo_n "checking whether $F77 accepts -g... " >&6; } if test "${ac_cv_prog_f77_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else FFLAGS=-g cat >conftest.$ac_ext <<_ACEOF @@ -6532,20 +7688,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_f77_g=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_f77_g=no @@ -6554,8 +7711,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 -echo "${ECHO_T}$ac_cv_prog_f77_g" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 +$as_echo "$ac_cv_prog_f77_g" >&6; } if test "$ac_test_FFLAGS" = set; then FFLAGS=$ac_save_FFLAGS elif test $ac_cv_prog_f77_g = yes; then @@ -6572,7 +7729,11 @@ else fi fi -G77=`test $ac_compiler_gnu = yes && echo yes` +if test $ac_compiler_gnu = yes; then + G77=yes +else + G77= +fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -6584,10 +7745,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! # find the maximum length of command line arguments -{ echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 -echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } if test "${lt_cv_sys_max_cmd_len+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" @@ -6649,21 +7810,21 @@ else fi if test -n $lt_cv_sys_max_cmd_len ; then - { echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 -echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6; } + { $as_echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } else - { echo "$as_me:$LINENO: result: none" >&5 -echo "${ECHO_T}none" >&6; } + { $as_echo "$as_me:$LINENO: result: none" >&5 +$as_echo "none" >&6; } fi # Check for command to grab the raw symbol name followed by C symbol from nm. -{ echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 -echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. @@ -6752,14 +7913,14 @@ EOF if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Now try to grab the symbols. nlist=conftest.nm if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then @@ -6814,7 +7975,7 @@ EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext}; then pipe_works=yes fi @@ -6849,17 +8010,17 @@ if test -z "$lt_cv_sys_global_symbol_pip lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - { echo "$as_me:$LINENO: result: failed" >&5 -echo "${ECHO_T}failed" >&6; } + { $as_echo "$as_me:$LINENO: result: failed" >&5 +$as_echo "failed" >&6; } else - { echo "$as_me:$LINENO: result: ok" >&5 -echo "${ECHO_T}ok" >&6; } + { $as_echo "$as_me:$LINENO: result: ok" >&5 +$as_echo "ok" >&6; } fi -{ echo "$as_me:$LINENO: checking for objdir" >&5 -echo $ECHO_N "checking for objdir... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } if test "${lt_cv_objdir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null @@ -6871,8 +8032,8 @@ else fi rmdir .libs 2>/dev/null fi -{ echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 -echo "${ECHO_T}$lt_cv_objdir" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir @@ -6923,10 +8084,10 @@ with_gnu_ld="$lt_cv_prog_gnu_ld" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. @@ -6939,7 +8100,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="${ac_tool_prefix}ar" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6950,11 +8111,11 @@ fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then - { echo "$as_me:$LINENO: result: $AR" >&5 -echo "${ECHO_T}$AR" >&6; } + { $as_echo "$as_me:$LINENO: result: $AR" >&5 +$as_echo "$AR" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -6963,10 +8124,10 @@ if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. @@ -6979,7 +8140,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AR="ar" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6990,11 +8151,11 @@ fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then - { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 -echo "${ECHO_T}$ac_ct_AR" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_AR" = x; then @@ -7002,12 +8163,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR @@ -7019,10 +8176,10 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. @@ -7035,7 +8192,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7046,11 +8203,11 @@ fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - { echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6; } + { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -7059,10 +8216,10 @@ if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. @@ -7075,7 +8232,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7086,11 +8243,11 @@ fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then @@ -7098,12 +8255,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB @@ -7115,10 +8268,10 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. @@ -7131,7 +8284,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7142,11 +8295,11 @@ fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - { echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6; } + { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -7155,10 +8308,10 @@ if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. @@ -7171,7 +8324,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7182,11 +8335,11 @@ fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then @@ -7194,12 +8347,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP @@ -7250,10 +8399,10 @@ fi case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then - { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 -echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) @@ -7303,19 +8452,19 @@ fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then - { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -echo "${ECHO_T}$MAGIC_CMD" >&6; } + { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then - { echo "$as_me:$LINENO: checking for file" >&5 -echo $ECHO_N "checking for file... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) @@ -7365,11 +8514,11 @@ fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then - { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -echo "${ECHO_T}$MAGIC_CMD" >&6; } + { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi else @@ -7444,12 +8593,12 @@ if test "$GCC" = no; then esac fi if test -n "$lt_prog_cc_shlib"; then - { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&5 -echo "$as_me: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&5 +$as_echo "$as_me: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&2;} if echo "$old_CC $old_CFLAGS " | grep "[ ]$lt_prog_cc_shlib[ ]" >/dev/null; then : else - { echo "$as_me:$LINENO: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5 -echo "$as_me: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5 +$as_echo "$as_me: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;} lt_cv_prog_cc_can_build_shared=no fi fi @@ -7458,10 +8607,10 @@ fi # # Check to make sure the static flag actually works. # -{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_prog_compiler_static works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_prog_compiler_static works... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if $compiler static flag $lt_prog_compiler_static works" >&5 +$as_echo_n "checking if $compiler static flag $lt_prog_compiler_static works... " >&6; } if test "${lt_prog_compiler_static_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else lt_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" @@ -7481,8 +8630,8 @@ else LDFLAGS="$save_LDFLAGS" fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 +$as_echo "$lt_prog_compiler_static_works" >&6; } if test x"$lt_prog_compiler_static_works" = xyes; then : @@ -7503,10 +8652,10 @@ if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' -{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext @@ -7521,11 +8670,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7524: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8673: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7528: \$? = $ac_status" >&5 + echo "$as_me:8677: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -7536,8 +8685,8 @@ else $rm conftest* fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" @@ -7551,8 +8700,8 @@ lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= -{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' @@ -7728,18 +8877,18 @@ echo $ECHO_N "checking for $compiler opt esac fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 +$as_echo "$lt_prog_compiler_pic" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then -{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if test "${lt_prog_compiler_pic_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else lt_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext @@ -7754,11 +8903,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7757: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8906: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7761: \$? = $ac_status" >&5 + echo "$as_me:8910: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -7769,8 +8918,8 @@ else $rm conftest* fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 +$as_echo "$lt_prog_compiler_pic_works" >&6; } if test x"$lt_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in @@ -7793,10 +8942,10 @@ case "$host_os" in ;; esac -{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $rm -r conftest 2>/dev/null @@ -7814,11 +8963,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7817: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8966: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7821: \$? = $ac_status" >&5 + echo "$as_me:8970: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -7838,34 +8987,34 @@ else $rm conftest* fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user - { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no - { echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6; } + { $as_echo "$as_me:$LINENO: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi -{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= @@ -8203,18 +9352,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` @@ -8222,12 +9374,13 @@ aix_libpath=`dump -H conftest$ac_exeext if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi @@ -8262,18 +9415,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` @@ -8281,12 +9437,13 @@ aix_libpath=`dump -H conftest$ac_exeext if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi @@ -8709,8 +9866,8 @@ if test -z "$aix_libpath"; then aix_libp esac fi -{ echo "$as_me:$LINENO: result: $ld_shlibs" >&5 -echo "${ECHO_T}$ld_shlibs" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" @@ -8735,15 +9892,15 @@ x|xyes) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. - { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest @@ -8760,7 +9917,7 @@ echo $ECHO_N "checking whether -lc shoul if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc=no @@ -8772,16 +9929,16 @@ echo $ECHO_N "checking whether -lc shoul cat conftest.err 1>&5 fi $rm conftest* - { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 -echo "${ECHO_T}$archive_cmds_need_lc" >&6; } + { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 +$as_echo "$archive_cmds_need_lc" >&6; } ;; esac fi ;; esac -{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= @@ -9320,12 +10477,12 @@ uts4*) dynamic_linker=no ;; esac -{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$dynamic_linker" >&6; } +{ $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no -{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var " || \ @@ -9349,8 +10506,8 @@ else # directories. hardcode_action=unsupported fi -{ echo "$as_me:$LINENO: result: $hardcode_action" >&5 -echo "${ECHO_T}$hardcode_action" >&6; } +{ $as_echo "$as_me:$LINENO: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink; then # Fast installation is not supported @@ -9363,29 +10520,29 @@ fi striplib= old_striplib= -{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 -echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi ;; *) - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } ;; esac fi @@ -9417,10 +10574,10 @@ else darwin*) # if libdl is installed we need to link against it - { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" @@ -9452,33 +10609,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_dl_dlopen=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } -if test $ac_cv_lib_dl_dlopen = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else @@ -9491,10 +10652,10 @@ fi ;; *) - { echo "$as_me:$LINENO: checking for shl_load" >&5 -echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for shl_load" >&5 +$as_echo_n "checking for shl_load... " >&6; } if test "${ac_cv_func_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -9547,38 +10708,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func_shl_load=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 -echo "${ECHO_T}$ac_cv_func_shl_load" >&6; } -if test $ac_cv_func_shl_load = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +$as_echo "$ac_cv_func_shl_load" >&6; } +if test "x$ac_cv_func_shl_load" = x""yes; then lt_cv_dlopen="shl_load" else - { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" @@ -9610,39 +10775,43 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_dld_shl_load=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } -if test $ac_cv_lib_dld_shl_load = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = x""yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else - { echo "$as_me:$LINENO: checking for dlopen" >&5 -echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for dlopen" >&5 +$as_echo_n "checking for dlopen... " >&6; } if test "${ac_cv_func_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -9695,38 +10864,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func_dlopen=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 -echo "${ECHO_T}$ac_cv_func_dlopen" >&6; } -if test $ac_cv_func_dlopen = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +$as_echo "$ac_cv_func_dlopen" >&6; } +if test "x$ac_cv_func_dlopen" = x""yes; then lt_cv_dlopen="dlopen" else - { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" @@ -9758,39 +10931,43 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_dl_dlopen=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } -if test $ac_cv_lib_dl_dlopen = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else - { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 -echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } if test "${ac_cv_lib_svld_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" @@ -9822,39 +10999,43 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_svld_dlopen=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; } -if test $ac_cv_lib_svld_dlopen = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = x""yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else - { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 -echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } if test "${ac_cv_lib_dld_dld_link+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" @@ -9886,33 +11067,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_dld_dld_link=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; } -if test $ac_cv_lib_dld_dld_link = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = x""yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi @@ -9951,10 +11136,10 @@ fi save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" - { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 -echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross @@ -9962,7 +11147,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? @@ -10044,15 +11229,15 @@ rm -fr conftest* fi -{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" - { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 -echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self_static+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross @@ -10060,7 +11245,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? @@ -10142,8 +11327,8 @@ rm -fr conftest* fi -{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" @@ -10165,13 +11350,13 @@ fi # Report which librarie types wil actually be built -{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 -echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } -{ echo "$as_me:$LINENO: result: $can_build_shared" >&5 -echo "${ECHO_T}$can_build_shared" >&6; } +{ $as_echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } +{ $as_echo "$as_me:$LINENO: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } -{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 -echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and @@ -10228,15 +11413,15 @@ aix4* | aix5*) fi ;; esac -{ echo "$as_me:$LINENO: result: $enable_shared" >&5 -echo "${ECHO_T}$enable_shared" >&6; } +{ $as_echo "$as_me:$LINENO: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } -{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5 -echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes -{ echo "$as_me:$LINENO: result: $enable_static" >&5 -echo "${ECHO_T}$enable_static" >&6; } +{ $as_echo "$as_me:$LINENO: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh @@ -10327,8 +11512,8 @@ if test -f "$ltmain"; then cfgfile="${ofile}T" trap "$rm \"$cfgfile\"; exit 1" 1 2 15 $rm -f "$cfgfile" - { echo "$as_me:$LINENO: creating $ofile" >&5 -echo "$as_me: creating $ofile" >&6;} + { $as_echo "$as_me:$LINENO: creating $ofile" >&5 +$as_echo "$as_me: creating $ofile" >&6;} cat <<__EOF__ >> "$cfgfile" #! $SHELL @@ -10727,18 +11912,18 @@ fi if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then - { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 -echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 +$as_echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then - { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 -echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 +$as_echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} else - { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 -echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 +$as_echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} fi fi @@ -10752,16 +11937,16 @@ echo "$as_me: WARNING: using \`LTCC=$LTC # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in "") ;; - *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 -echo "$as_me: error: invalid tag name: $tagname" >&2;} + *) { { $as_echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 +$as_echo "$as_me: error: invalid tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then - { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 -echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} + { { $as_echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 +$as_echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} { (exit 1); exit 1; }; } fi @@ -10874,8 +12059,8 @@ fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. - { echo "$as_me:$LINENO: checking for ld used by $CC" >&5 -echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -10904,14 +12089,14 @@ echo $ECHO_N "checking for ld used by $C ;; esac elif test "$with_gnu_ld" = yes; then - { echo "$as_me:$LINENO: checking for GNU ld" >&5 -echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } else - { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 -echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } fi if test "${lt_cv_path_LD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR @@ -10941,19 +12126,19 @@ fi LD="$lt_cv_path_LD" if test -n "$LD"; then - { echo "$as_me:$LINENO: result: $LD" >&5 -echo "${ECHO_T}$LD" >&6; } + { $as_echo "$as_me:$LINENO: result: $LD" >&5 +$as_echo "$LD" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi -test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 -echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} +test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +$as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } -{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 -echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. case `$LD -v 2>&1 &1 &5 -echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld @@ -11016,8 +12201,8 @@ else fi # PORTME: fill in a description of your system's C++ link characteristics -{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) @@ -11129,18 +12314,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` @@ -11148,12 +12336,13 @@ aix_libpath=`dump -H conftest$ac_exeext if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi @@ -11189,18 +12378,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` @@ -11208,12 +12400,13 @@ aix_libpath=`dump -H conftest$ac_exeext if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi @@ -11840,8 +13033,8 @@ if test -z "$aix_libpath"; then aix_libp ld_shlibs_CXX=no ;; esac -{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 -echo "${ECHO_T}$ld_shlibs_CXX" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 +$as_echo "$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no GCC_CXX="$GXX" @@ -11865,7 +13058,7 @@ EOF if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. @@ -11961,8 +13154,8 @@ lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= -{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then @@ -12213,18 +13406,18 @@ echo $ECHO_N "checking for $compiler opt esac fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 +$as_echo "$lt_prog_compiler_pic_CXX" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then -{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else lt_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext @@ -12239,11 +13432,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12242: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13435: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:12246: \$? = $ac_status" >&5 + echo "$as_me:13439: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -12254,8 +13447,8 @@ else $rm conftest* fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 +$as_echo "$lt_prog_compiler_pic_works_CXX" >&6; } if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in @@ -12278,10 +13471,10 @@ case "$host_os" in ;; esac -{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $rm -r conftest 2>/dev/null @@ -12299,11 +13492,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12302: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13495: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:12306: \$? = $ac_status" >&5 + echo "$as_me:13499: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -12323,34 +13516,34 @@ else $rm conftest* fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user - { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no - { echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6; } + { $as_echo "$as_me:$LINENO: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi -{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in @@ -12377,8 +13570,8 @@ echo $ECHO_N "checking whether the $comp ;; esac -{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 -echo "${ECHO_T}$ld_shlibs_CXX" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 +$as_echo "$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" @@ -12403,15 +13596,15 @@ x|xyes) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. - { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest @@ -12428,7 +13621,7 @@ echo $ECHO_N "checking whether -lc shoul if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_CXX=no @@ -12440,16 +13633,16 @@ echo $ECHO_N "checking whether -lc shoul cat conftest.err 1>&5 fi $rm conftest* - { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; } + { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 +$as_echo "$archive_cmds_need_lc_CXX" >&6; } ;; esac fi ;; esac -{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= @@ -12988,12 +14181,12 @@ uts4*) dynamic_linker=no ;; esac -{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$dynamic_linker" >&6; } +{ $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no -{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || \ test -n "$runpath_var CXX" || \ @@ -13017,8 +14210,8 @@ else # directories. hardcode_action_CXX=unsupported fi -{ echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 -echo "${ECHO_T}$hardcode_action_CXX" >&6; } +{ $as_echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 +$as_echo "$hardcode_action_CXX" >&6; } if test "$hardcode_action_CXX" = relink; then # Fast installation is not supported @@ -13031,29 +14224,29 @@ fi striplib= old_striplib= -{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 -echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi ;; *) - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } ;; esac fi @@ -13085,10 +14278,10 @@ else darwin*) # if libdl is installed we need to link against it - { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" @@ -13120,33 +14313,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_dl_dlopen=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } -if test $ac_cv_lib_dl_dlopen = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else @@ -13159,10 +14356,10 @@ fi ;; *) - { echo "$as_me:$LINENO: checking for shl_load" >&5 -echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for shl_load" >&5 +$as_echo_n "checking for shl_load... " >&6; } if test "${ac_cv_func_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -13215,38 +14412,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func_shl_load=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 -echo "${ECHO_T}$ac_cv_func_shl_load" >&6; } -if test $ac_cv_func_shl_load = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +$as_echo "$ac_cv_func_shl_load" >&6; } +if test "x$ac_cv_func_shl_load" = x""yes; then lt_cv_dlopen="shl_load" else - { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" @@ -13278,39 +14479,43 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_dld_shl_load=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } -if test $ac_cv_lib_dld_shl_load = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = x""yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else - { echo "$as_me:$LINENO: checking for dlopen" >&5 -echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for dlopen" >&5 +$as_echo_n "checking for dlopen... " >&6; } if test "${ac_cv_func_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -13363,38 +14568,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func_dlopen=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 -echo "${ECHO_T}$ac_cv_func_dlopen" >&6; } -if test $ac_cv_func_dlopen = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +$as_echo "$ac_cv_func_dlopen" >&6; } +if test "x$ac_cv_func_dlopen" = x""yes; then lt_cv_dlopen="dlopen" else - { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" @@ -13426,39 +14635,43 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_dl_dlopen=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } -if test $ac_cv_lib_dl_dlopen = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else - { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 -echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } if test "${ac_cv_lib_svld_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" @@ -13490,39 +14703,43 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_svld_dlopen=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; } -if test $ac_cv_lib_svld_dlopen = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = x""yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else - { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 -echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } if test "${ac_cv_lib_dld_dld_link+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" @@ -13554,33 +14771,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_dld_dld_link=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; } -if test $ac_cv_lib_dld_dld_link = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = x""yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi @@ -13619,10 +14840,10 @@ fi save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" - { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 -echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross @@ -13630,7 +14851,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? @@ -13712,15 +14933,15 @@ rm -fr conftest* fi -{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" - { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 -echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self_static+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross @@ -13728,7 +14949,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? @@ -13810,8 +15031,8 @@ rm -fr conftest* fi -{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" @@ -14310,13 +15531,13 @@ compiler=$CC compiler_F77=$CC cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` -{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 -echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } -{ echo "$as_me:$LINENO: result: $can_build_shared" >&5 -echo "${ECHO_T}$can_build_shared" >&6; } +{ $as_echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } +{ $as_echo "$as_me:$LINENO: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } -{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 -echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and @@ -14333,15 +15554,15 @@ aix4* | aix5*) test "$enable_shared" = yes && enable_static=no ;; esac -{ echo "$as_me:$LINENO: result: $enable_shared" >&5 -echo "${ECHO_T}$enable_shared" >&6; } +{ $as_echo "$as_me:$LINENO: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } -{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5 -echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes -{ echo "$as_me:$LINENO: result: $enable_static" >&5 -echo "${ECHO_T}$enable_static" >&6; } +{ $as_echo "$as_me:$LINENO: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } test "$ld_shlibs_F77" = no && can_build_shared=no @@ -14352,8 +15573,8 @@ lt_prog_compiler_wl_F77= lt_prog_compiler_pic_F77= lt_prog_compiler_static_F77= -{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl_F77='-Wl,' @@ -14529,18 +15750,18 @@ echo $ECHO_N "checking for $compiler opt esac fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 +$as_echo "$lt_prog_compiler_pic_F77" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_F77"; then -{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... " >&6; } if test "${lt_prog_compiler_pic_works_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else lt_prog_compiler_pic_works_F77=no ac_outfile=conftest.$ac_objext @@ -14555,11 +15776,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14558: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15779: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14562: \$? = $ac_status" >&5 + echo "$as_me:15783: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -14570,8 +15791,8 @@ else $rm conftest* fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 +$as_echo "$lt_prog_compiler_pic_works_F77" >&6; } if test x"$lt_prog_compiler_pic_works_F77" = xyes; then case $lt_prog_compiler_pic_F77 in @@ -14594,10 +15815,10 @@ case "$host_os" in ;; esac -{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_F77=no $rm -r conftest 2>/dev/null @@ -14615,11 +15836,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14618: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15839: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:14622: \$? = $ac_status" >&5 + echo "$as_me:15843: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -14639,34 +15860,34 @@ else $rm conftest* fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 +$as_echo "$lt_cv_prog_compiler_c_o_F77" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user - { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no - { echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6; } + { $as_echo "$as_me:$LINENO: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi -{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag_F77= @@ -14994,18 +16215,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` @@ -15013,12 +16237,13 @@ aix_libpath=`dump -H conftest$ac_exeext if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi @@ -15043,18 +16268,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` @@ -15062,12 +16290,13 @@ aix_libpath=`dump -H conftest$ac_exeext if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi @@ -15490,8 +16719,8 @@ if test -z "$aix_libpath"; then aix_libp esac fi -{ echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 -echo "${ECHO_T}$ld_shlibs_F77" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 +$as_echo "$ld_shlibs_F77" >&6; } test "$ld_shlibs_F77" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" @@ -15516,15 +16745,15 @@ x|xyes) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. - { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest @@ -15541,7 +16770,7 @@ echo $ECHO_N "checking whether -lc shoul if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_F77=no @@ -15553,16 +16782,16 @@ echo $ECHO_N "checking whether -lc shoul cat conftest.err 1>&5 fi $rm conftest* - { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6; } + { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 +$as_echo "$archive_cmds_need_lc_F77" >&6; } ;; esac fi ;; esac -{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= @@ -16101,12 +17330,12 @@ uts4*) dynamic_linker=no ;; esac -{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$dynamic_linker" >&6; } +{ $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no -{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_F77= if test -n "$hardcode_libdir_flag_spec_F77" || \ test -n "$runpath_var F77" || \ @@ -16130,8 +17359,8 @@ else # directories. hardcode_action_F77=unsupported fi -{ echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 -echo "${ECHO_T}$hardcode_action_F77" >&6; } +{ $as_echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 +$as_echo "$hardcode_action_F77" >&6; } if test "$hardcode_action_F77" = relink; then # Fast installation is not supported @@ -16144,29 +17373,29 @@ fi striplib= old_striplib= -{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 -echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi ;; *) - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } ;; esac fi @@ -16631,10 +17860,10 @@ if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' -{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext @@ -16649,11 +17878,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16652: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17881: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16656: \$? = $ac_status" >&5 + echo "$as_me:17885: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -16664,8 +17893,8 @@ else $rm conftest* fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" @@ -16679,8 +17908,8 @@ lt_prog_compiler_wl_GCJ= lt_prog_compiler_pic_GCJ= lt_prog_compiler_static_GCJ= -{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl_GCJ='-Wl,' @@ -16856,18 +18085,18 @@ echo $ECHO_N "checking for $compiler opt esac fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 +$as_echo "$lt_prog_compiler_pic_GCJ" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_GCJ"; then -{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... " >&6; } if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else lt_prog_compiler_pic_works_GCJ=no ac_outfile=conftest.$ac_objext @@ -16882,11 +18111,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16885: $lt_compile\"" >&5) + (eval echo "\"\$as_me:18114: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16889: \$? = $ac_status" >&5 + echo "$as_me:18118: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -16897,8 +18126,8 @@ else $rm conftest* fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 +$as_echo "$lt_prog_compiler_pic_works_GCJ" >&6; } if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then case $lt_prog_compiler_pic_GCJ in @@ -16921,10 +18150,10 @@ case "$host_os" in ;; esac -{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_GCJ=no $rm -r conftest 2>/dev/null @@ -16942,11 +18171,11 @@ else -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16945: $lt_compile\"" >&5) + (eval echo "\"\$as_me:18174: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:16949: \$? = $ac_status" >&5 + echo "$as_me:18178: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -16966,34 +18195,34 @@ else $rm conftest* fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 +$as_echo "$lt_cv_prog_compiler_c_o_GCJ" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user - { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no - { echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6; } + { $as_echo "$as_me:$LINENO: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi -{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag_GCJ= @@ -17331,18 +18560,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` @@ -17350,12 +18582,13 @@ aix_libpath=`dump -H conftest$ac_exeext if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi @@ -17390,18 +18623,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` @@ -17409,12 +18645,13 @@ aix_libpath=`dump -H conftest$ac_exeext if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi @@ -17837,8 +19074,8 @@ if test -z "$aix_libpath"; then aix_libp esac fi -{ echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 -echo "${ECHO_T}$ld_shlibs_GCJ" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 +$as_echo "$ld_shlibs_GCJ" >&6; } test "$ld_shlibs_GCJ" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" @@ -17863,15 +19100,15 @@ x|xyes) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. - { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest @@ -17888,7 +19125,7 @@ echo $ECHO_N "checking whether -lc shoul if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_GCJ=no @@ -17900,16 +19137,16 @@ echo $ECHO_N "checking whether -lc shoul cat conftest.err 1>&5 fi $rm conftest* - { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6; } + { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 +$as_echo "$archive_cmds_need_lc_GCJ" >&6; } ;; esac fi ;; esac -{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= @@ -18448,12 +19685,12 @@ uts4*) dynamic_linker=no ;; esac -{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$dynamic_linker" >&6; } +{ $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no -{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_GCJ= if test -n "$hardcode_libdir_flag_spec_GCJ" || \ test -n "$runpath_var GCJ" || \ @@ -18477,8 +19714,8 @@ else # directories. hardcode_action_GCJ=unsupported fi -{ echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 -echo "${ECHO_T}$hardcode_action_GCJ" >&6; } +{ $as_echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 +$as_echo "$hardcode_action_GCJ" >&6; } if test "$hardcode_action_GCJ" = relink; then # Fast installation is not supported @@ -18491,29 +19728,29 @@ fi striplib= old_striplib= -{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 -echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi ;; *) - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } ;; esac fi @@ -18545,10 +19782,10 @@ else darwin*) # if libdl is installed we need to link against it - { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" @@ -18580,33 +19817,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_dl_dlopen=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } -if test $ac_cv_lib_dl_dlopen = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else @@ -18619,10 +19860,10 @@ fi ;; *) - { echo "$as_me:$LINENO: checking for shl_load" >&5 -echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for shl_load" >&5 +$as_echo_n "checking for shl_load... " >&6; } if test "${ac_cv_func_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18675,38 +19916,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func_shl_load=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 -echo "${ECHO_T}$ac_cv_func_shl_load" >&6; } -if test $ac_cv_func_shl_load = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +$as_echo "$ac_cv_func_shl_load" >&6; } +if test "x$ac_cv_func_shl_load" = x""yes; then lt_cv_dlopen="shl_load" else - { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" @@ -18738,39 +19983,43 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_dld_shl_load=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } -if test $ac_cv_lib_dld_shl_load = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = x""yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else - { echo "$as_me:$LINENO: checking for dlopen" >&5 -echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for dlopen" >&5 +$as_echo_n "checking for dlopen... " >&6; } if test "${ac_cv_func_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18823,38 +20072,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func_dlopen=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 -echo "${ECHO_T}$ac_cv_func_dlopen" >&6; } -if test $ac_cv_func_dlopen = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +$as_echo "$ac_cv_func_dlopen" >&6; } +if test "x$ac_cv_func_dlopen" = x""yes; then lt_cv_dlopen="dlopen" else - { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" @@ -18886,39 +20139,43 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_dl_dlopen=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } -if test $ac_cv_lib_dl_dlopen = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else - { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 -echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } if test "${ac_cv_lib_svld_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" @@ -18950,39 +20207,43 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_svld_dlopen=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; } -if test $ac_cv_lib_svld_dlopen = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = x""yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else - { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 -echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } if test "${ac_cv_lib_dld_dld_link+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" @@ -19014,33 +20275,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_dld_dld_link=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; } -if test $ac_cv_lib_dld_dld_link = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = x""yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi @@ -19079,10 +20344,10 @@ fi save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" - { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 -echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross @@ -19090,7 +20355,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? @@ -19172,15 +20437,15 @@ rm -fr conftest* fi -{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" - { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 -echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self_static+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross @@ -19188,7 +20453,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? @@ -19270,8 +20535,8 @@ rm -fr conftest* fi -{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" @@ -20146,8 +21411,8 @@ CC="$lt_save_CC" ;; *) - { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 -echo "$as_me: error: Unsupported tag name: $tagname" >&2;} + { { $as_echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 +$as_echo "$as_me: error: Unsupported tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac @@ -20166,8 +21431,8 @@ echo "$as_me: error: Unsupported tag nam chmod +x "$ofile" else rm -f "${ofile}T" - { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 -echo "$as_me: error: unable to update list of available tagged configurations." >&2;} + { { $as_echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 +$as_echo "$as_me: error: unable to update list of available tagged configurations." >&2;} { (exit 1); exit 1; }; } fi fi @@ -20277,10 +21542,10 @@ fi # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -20295,7 +21560,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -20308,11 +21573,11 @@ esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then - { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6; } + { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -20332,8 +21597,8 @@ fi fi min_glib_version=2.0.0 - { echo "$as_me:$LINENO: checking for GLIB - version >= $min_glib_version" >&5 -echo $ECHO_N "checking for GLIB - version >= $min_glib_version... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for GLIB - version >= $min_glib_version" >&5 +$as_echo_n "checking for GLIB - version >= $min_glib_version... " >&6; } if test x$PKG_CONFIG != xno ; then ## don't try to run the test against uninstalled libtool libs @@ -20456,29 +21721,32 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) no_glib=yes fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -20488,12 +21756,12 @@ fi fi fi if test "x$no_glib" = x ; then - { echo "$as_me:$LINENO: result: yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&5 -echo "${ECHO_T}yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&6; } + { $as_echo "$as_me:$LINENO: result: yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&5 +$as_echo "yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&6; } : else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } if test "$PKG_CONFIG" = "no" ; then echo "*** A new enough version of pkg-config was not found." echo "*** See http://www.freedesktop.org/software/pkgconfig/" @@ -20530,18 +21798,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GLIB or finding the wrong" echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your" @@ -20552,13 +21823,14 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GLIB is incorrectly installed." fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$ac_save_CFLAGS" @@ -20608,11 +21880,11 @@ PTH_LIBS='' -{ echo "$as_me:$LINENO: checking for GNU Pth" >&5 -echo $ECHO_N "checking for GNU Pth... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for GNU Pth" >&5 +$as_echo_n "checking for GNU Pth... " >&6; } if test ".$verbose" = .yes; then - { echo "$as_me:$LINENO: result: " >&5 -echo "${ECHO_T} " >&6; } + { $as_echo "$as_me:$LINENO: result: " >&5 +$as_echo " " >&6; } fi @@ -20632,18 +21904,18 @@ else fi if test ".$verbose" = .yes; then - { echo "$as_me:$LINENO: result: + Command Line Options:" >&5 -echo "${ECHO_T} + Command Line Options:" >&6; } + { $as_echo "$as_me:$LINENO: result: + Command Line Options:" >&5 +$as_echo " + Command Line Options:" >&6; } fi if test ".$verbose" = .yes; then - { echo "$as_me:$LINENO: result: o --with-pth=$with_pth" >&5 -echo "${ECHO_T} o --with-pth=$with_pth" >&6; } + { $as_echo "$as_me:$LINENO: result: o --with-pth=$with_pth" >&5 +$as_echo " o --with-pth=$with_pth" >&6; } fi if test ".$verbose" = .yes; then - { echo "$as_me:$LINENO: result: o --with-pth-test=$with_pth_test" >&5 -echo "${ECHO_T} o --with-pth-test=$with_pth_test" >&6; } + { $as_echo "$as_me:$LINENO: result: o --with-pth-test=$with_pth_test" >&5 +$as_echo " o --with-pth-test=$with_pth_test" >&6; } fi if test ".$with_pth" != .no; then @@ -20750,18 +22022,18 @@ if test ".$with_pth" != .no; then fi fi if test ".$verbose" = .yes; then - { echo "$as_me:$LINENO: result: + Determined Location:" >&5 -echo "${ECHO_T} + Determined Location:" >&6; } + { $as_echo "$as_me:$LINENO: result: + Determined Location:" >&5 +$as_echo " + Determined Location:" >&6; } fi if test ".$verbose" = .yes; then - { echo "$as_me:$LINENO: result: o path: $_pth_location" >&5 -echo "${ECHO_T} o path: $_pth_location" >&6; } + { $as_echo "$as_me:$LINENO: result: o path: $_pth_location" >&5 +$as_echo " o path: $_pth_location" >&6; } fi if test ".$verbose" = .yes; then - { echo "$as_me:$LINENO: result: o type: $_pth_type" >&5 -echo "${ECHO_T} o type: $_pth_type" >&6; } + { $as_echo "$as_me:$LINENO: result: o type: $_pth_type" >&5 +$as_echo " o type: $_pth_type" >&6; } fi if test ".$_pth_version" = .; then @@ -20784,18 +22056,18 @@ fi eval "${_var}_hex=\"\$_hex\"" done if test ".$verbose" = .yes; then - { echo "$as_me:$LINENO: result: + Determined Versions:" >&5 -echo "${ECHO_T} + Determined Versions:" >&6; } + { $as_echo "$as_me:$LINENO: result: + Determined Versions:" >&5 +$as_echo " + Determined Versions:" >&6; } fi if test ".$verbose" = .yes; then - { echo "$as_me:$LINENO: result: o existing: $_pth_version -> 0x$_pth_version_hex" >&5 -echo "${ECHO_T} o existing: $_pth_version -> 0x$_pth_version_hex" >&6; } + { $as_echo "$as_me:$LINENO: result: o existing: $_pth_version -> 0x$_pth_version_hex" >&5 +$as_echo " o existing: $_pth_version -> 0x$_pth_version_hex" >&6; } fi if test ".$verbose" = .yes; then - { echo "$as_me:$LINENO: result: o required: $_req_version -> 0x$_req_version_hex" >&5 -echo "${ECHO_T} o required: $_req_version -> 0x$_req_version_hex" >&6; } + { $as_echo "$as_me:$LINENO: result: o required: $_req_version -> 0x$_req_version_hex" >&5 +$as_echo " o required: $_req_version -> 0x$_req_version_hex" >&6; } fi _ok=0 @@ -20807,8 +22079,8 @@ fi fi fi if test ".$_ok" = .0; then - { echo "$as_me:$LINENO: result: *FAILED*" >&5 -echo "${ECHO_T}*FAILED*" >&6; } + { $as_echo "$as_me:$LINENO: result: *FAILED*" >&5 +$as_echo "*FAILED*" >&6; } cat <>/ /' 1>&2 Found Pth version $_pth_version, but required at least version $_req_version. Upgrade Pth under $_pth_location to $_req_version or higher first, please. @@ -20826,41 +22098,41 @@ exit 1 LDFLAGS="$LDFLAGS $_pth_ldflags" LIBS="$LIBS $_pth_libs" if test ".$verbose" = .yes; then - { echo "$as_me:$LINENO: result: + Test Build Environment:" >&5 -echo "${ECHO_T} + Test Build Environment:" >&6; } + { $as_echo "$as_me:$LINENO: result: + Test Build Environment:" >&5 +$as_echo " + Test Build Environment:" >&6; } fi if test ".$verbose" = .yes; then - { echo "$as_me:$LINENO: result: o CPPFLAGS=\"$CPPFLAGS\"" >&5 -echo "${ECHO_T} o CPPFLAGS=\"$CPPFLAGS\"" >&6; } + { $as_echo "$as_me:$LINENO: result: o CPPFLAGS=\"$CPPFLAGS\"" >&5 +$as_echo " o CPPFLAGS=\"$CPPFLAGS\"" >&6; } fi if test ".$verbose" = .yes; then - { echo "$as_me:$LINENO: result: o CFLAGS=\"$CFLAGS\"" >&5 -echo "${ECHO_T} o CFLAGS=\"$CFLAGS\"" >&6; } + { $as_echo "$as_me:$LINENO: result: o CFLAGS=\"$CFLAGS\"" >&5 +$as_echo " o CFLAGS=\"$CFLAGS\"" >&6; } fi if test ".$verbose" = .yes; then - { echo "$as_me:$LINENO: result: o LDFLAGS=\"$LDFLAGS\"" >&5 -echo "${ECHO_T} o LDFLAGS=\"$LDFLAGS\"" >&6; } + { $as_echo "$as_me:$LINENO: result: o LDFLAGS=\"$LDFLAGS\"" >&5 +$as_echo " o LDFLAGS=\"$LDFLAGS\"" >&6; } fi if test ".$verbose" = .yes; then - { echo "$as_me:$LINENO: result: o LIBS=\"$LIBS\"" >&5 -echo "${ECHO_T} o LIBS=\"$LIBS\"" >&6; } + { $as_echo "$as_me:$LINENO: result: o LIBS=\"$LIBS\"" >&5 +$as_echo " o LIBS=\"$LIBS\"" >&6; } fi cross_compile=no if test ".$verbose" = .yes; then - { echo "$as_me:$LINENO: result: + Performing Sanity Checks:" >&5 -echo "${ECHO_T} + Performing Sanity Checks:" >&6; } + { $as_echo "$as_me:$LINENO: result: + Performing Sanity Checks:" >&5 +$as_echo " + Performing Sanity Checks:" >&6; } fi if test ".$verbose" = .yes; then - { echo "$as_me:$LINENO: result: o pre-processor test" >&5 -echo "${ECHO_T} o pre-processor test" >&6; } + { $as_echo "$as_me:$LINENO: result: o pre-processor test" >&5 +$as_echo " o pre-processor test" >&6; } fi cat >conftest.$ac_ext <<_ACEOF @@ -20878,20 +22150,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then _ok=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 _ok=no @@ -20899,8 +22172,8 @@ fi rm -f conftest.err conftest.$ac_ext if test ".$_ok" != .yes; then - { echo "$as_me:$LINENO: result: *FAILED*" >&5 -echo "${ECHO_T}*FAILED*" >&6; } + { $as_echo "$as_me:$LINENO: result: *FAILED*" >&5 +$as_echo "*FAILED*" >&6; } cat <>/ /' 1>&2 Found GNU Pth $_pth_version under $_pth_location, but was unable to perform a sanity pre-processor check. This means @@ -20914,8 +22187,8 @@ exit 1 fi if test ".$verbose" = .yes; then - { echo "$as_me:$LINENO: result: o link check" >&5 -echo "${ECHO_T} o link check" >&6; } + { $as_echo "$as_me:$LINENO: result: o link check" >&5 +$as_echo " o link check" >&6; } fi cat >conftest.$ac_ext <<_ACEOF @@ -20953,31 +22226,35 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then _ok=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 _ok=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test ".$_ok" != .yes; then - { echo "$as_me:$LINENO: result: *FAILED*" >&5 -echo "${ECHO_T}*FAILED*" >&6; } + { $as_echo "$as_me:$LINENO: result: *FAILED*" >&5 +$as_echo "*FAILED*" >&6; } cat <>/ /' 1>&2 Found GNU Pth $_pth_version under $_pth_location, but was unable to perform a sanity linker check. This means @@ -20993,8 +22270,8 @@ exit 1 fi if test ".$verbose" = .yes; then - { echo "$as_me:$LINENO: result: o run-time check" >&5 -echo "${ECHO_T} o run-time check" >&6; } + { $as_echo "$as_me:$LINENO: result: o run-time check" >&5 +$as_echo " o run-time check" >&6; } fi if test "$cross_compiling" = yes; then @@ -21040,37 +22317,40 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then _ok=`cat conftestval` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) _ok=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi if test ".$_ok" != .yes; then if test ".$_ok" = .no; then - { echo "$as_me:$LINENO: result: *FAILED*" >&5 -echo "${ECHO_T}*FAILED*" >&6; } + { $as_echo "$as_me:$LINENO: result: *FAILED*" >&5 +$as_echo "*FAILED*" >&6; } cat <>/ /' 1>&2 Found GNU Pth $_pth_version under $_pth_location, but was unable to perform a sanity execution check. This usually @@ -21089,8 +22369,8 @@ EOT exit 1 else - { echo "$as_me:$LINENO: result: *FAILED*" >&5 -echo "${ECHO_T}*FAILED*" >&6; } + { $as_echo "$as_me:$LINENO: result: *FAILED*" >&5 +$as_echo "*FAILED*" >&6; } cat <>/ /' 1>&2 Found GNU Pth $_pth_version under $_pth_location, but was unable to perform a sanity run-time check. This usually @@ -21136,53 +22416,53 @@ exit 1 if test ".$verbose" = .yes; then - { echo "$as_me:$LINENO: result: + Final Results:" >&5 -echo "${ECHO_T} + Final Results:" >&6; } + { $as_echo "$as_me:$LINENO: result: + Final Results:" >&5 +$as_echo " + Final Results:" >&6; } fi if test ".$verbose" = .yes; then - { echo "$as_me:$LINENO: result: o PTH_CPPFLAGS=\"$PTH_CPPFLAGS\"" >&5 -echo "${ECHO_T} o PTH_CPPFLAGS=\"$PTH_CPPFLAGS\"" >&6; } + { $as_echo "$as_me:$LINENO: result: o PTH_CPPFLAGS=\"$PTH_CPPFLAGS\"" >&5 +$as_echo " o PTH_CPPFLAGS=\"$PTH_CPPFLAGS\"" >&6; } fi if test ".$verbose" = .yes; then - { echo "$as_me:$LINENO: result: o PTH_CFLAGS=\"$PTH_CFLAGS\"" >&5 -echo "${ECHO_T} o PTH_CFLAGS=\"$PTH_CFLAGS\"" >&6; } + { $as_echo "$as_me:$LINENO: result: o PTH_CFLAGS=\"$PTH_CFLAGS\"" >&5 +$as_echo " o PTH_CFLAGS=\"$PTH_CFLAGS\"" >&6; } fi if test ".$verbose" = .yes; then - { echo "$as_me:$LINENO: result: o PTH_LDFLAGS=\"$PTH_LDFLAGS\"" >&5 -echo "${ECHO_T} o PTH_LDFLAGS=\"$PTH_LDFLAGS\"" >&6; } + { $as_echo "$as_me:$LINENO: result: o PTH_LDFLAGS=\"$PTH_LDFLAGS\"" >&5 +$as_echo " o PTH_LDFLAGS=\"$PTH_LDFLAGS\"" >&6; } fi if test ".$verbose" = .yes; then - { echo "$as_me:$LINENO: result: o PTH_LIBS=\"$PTH_LIBS\"" >&5 -echo "${ECHO_T} o PTH_LIBS=\"$PTH_LIBS\"" >&6; } + { $as_echo "$as_me:$LINENO: result: o PTH_LIBS=\"$PTH_LIBS\"" >&5 +$as_echo " o PTH_LIBS=\"$PTH_LIBS\"" >&6; } fi fi fi if test ".$with_pth" != .no; then - { echo "$as_me:$LINENO: result: version $_pth_version, $_pth_type under $_pth_location" >&5 -echo "${ECHO_T}version $_pth_version, $_pth_type under $_pth_location" >&6; } + { $as_echo "$as_me:$LINENO: result: version $_pth_version, $_pth_type under $_pth_location" >&5 +$as_echo "version $_pth_version, $_pth_type under $_pth_location" >&6; } have_pth=yes else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } : fi if test "$have_pth" = yes; then cat >>confdefs.h <<\_ACEOF -#define HAVE_PTH +#define HAVE_PTH /**/ _ACEOF fi - { echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5 -echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5 +$as_echo_n "checking for pthread_create in -lpthread... " >&6; } if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" @@ -21214,40 +22494,44 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_pthread_pthread_create=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread_pthread_create=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5 -echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6; } -if test $ac_cv_lib_pthread_pthread_create = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5 +$as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } +if test "x$ac_cv_lib_pthread_pthread_create" = x""yes; then have_pthread=yes fi if test "$have_pthread" = yes; then cat >>confdefs.h <<\_ACEOF -#define HAVE_PTHREAD +#define HAVE_PTHREAD /**/ _ACEOF fi @@ -21329,20 +22613,21 @@ fi for ac_header in sys/select.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21358,32 +22643,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21397,51 +22683,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------- ## ## Report this to bug-gpgme@gnupg.org ## @@ -21450,21 +22737,24 @@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -21474,10 +22764,10 @@ done # Type checks. -{ echo "$as_me:$LINENO: checking for inline" >&5 -echo $ECHO_N "checking for inline... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } if test "${ac_cv_c_inline+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do @@ -21500,20 +22790,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_inline=$ac_kw else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -21524,8 +22815,8 @@ rm -f core conftest.err conftest.$ac_obj done fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 -echo "${ECHO_T}$ac_cv_c_inline" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 +$as_echo "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in @@ -21543,68 +22834,14 @@ _ACEOF ;; esac -{ echo "$as_me:$LINENO: checking for unsigned int" >&5 -echo $ECHO_N "checking for unsigned int... $ECHO_C" >&6; } -if test "${ac_cv_type_unsigned_int+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef unsigned int ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_unsigned_int=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_unsigned_int=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_int" >&5 -echo "${ECHO_T}$ac_cv_type_unsigned_int" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of unsigned int" >&5 -echo $ECHO_N "checking size of unsigned int... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of unsigned int" >&5 +$as_echo_n "checking size of unsigned int... " >&6; } if test "${ac_cv_sizeof_unsigned_int+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -21615,11 +22852,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef unsigned int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (unsigned int))) >= 0)]; test_array [0] = 0 ; @@ -21632,13 +22868,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -21652,11 +22889,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef unsigned int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (unsigned int))) <= $ac_mid)]; test_array [0] = 0 ; @@ -21669,20 +22905,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -21696,7 +22933,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -21706,11 +22943,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef unsigned int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (unsigned int))) < 0)]; test_array [0] = 0 ; @@ -21723,13 +22959,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -21743,11 +22980,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef unsigned int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (unsigned int))) >= $ac_mid)]; test_array [0] = 0 ; @@ -21760,20 +22996,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -21787,7 +23024,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -21807,11 +23044,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef unsigned int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (unsigned int))) <= $ac_mid)]; test_array [0] = 0 ; @@ -21824,20 +23060,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -21848,11 +23085,13 @@ done case $ac_lo in ?*) ac_cv_sizeof_unsigned_int=$ac_lo;; '') if test "$ac_cv_type_unsigned_int" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned int) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned int) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (unsigned int) +$as_echo "$as_me: error: cannot compute sizeof (unsigned int) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_unsigned_int=0 fi ;; @@ -21865,9 +23104,8 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef unsigned int ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (unsigned int)); } +static unsigned long int ulongval () { return (long int) (sizeof (unsigned int)); } #include #include int @@ -21877,20 +23115,22 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (unsigned int))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (unsigned int)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (unsigned int)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -21903,43 +23143,48 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_unsigned_int=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_unsigned_int" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned int) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned int) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (unsigned int) +$as_echo "$as_me: error: cannot compute sizeof (unsigned int) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_unsigned_int=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_int" >&5 -echo "${ECHO_T}$ac_cv_sizeof_unsigned_int" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_int" >&5 +$as_echo "$ac_cv_sizeof_unsigned_int" >&6; } @@ -21955,10 +23200,10 @@ fi if test "$enable_largefile" != no; then - { echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 -echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 +$as_echo_n "checking for special C compiler options needed for large files... " >&6; } if test "${ac_cv_sys_largefile_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then @@ -21995,20 +23240,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -22022,20 +23268,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_sys_largefile_CC=' -n32'; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -22048,16 +23295,16 @@ rm -f core conftest.err conftest.$ac_obj rm -f conftest.$ac_ext fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 -echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 +$as_echo "$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi - { echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 -echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } if test "${ac_cv_sys_file_offset_bits+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else while :; do cat >conftest.$ac_ext <<_ACEOF @@ -22089,20 +23336,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_sys_file_offset_bits=no; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -22139,20 +23387,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_sys_file_offset_bits=64; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -22163,8 +23412,8 @@ rm -f core conftest.err conftest.$ac_obj break done fi -{ echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 -echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 +$as_echo "$ac_cv_sys_file_offset_bits" >&6; } case $ac_cv_sys_file_offset_bits in #( no | unknown) ;; *) @@ -22173,12 +23422,12 @@ cat >>confdefs.h <<_ACEOF _ACEOF ;; esac -rm -f conftest* +rm -rf conftest* if test $ac_cv_sys_file_offset_bits = unknown; then - { echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 -echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 +$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } if test "${ac_cv_sys_large_files+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else while :; do cat >conftest.$ac_ext <<_ACEOF @@ -22210,20 +23459,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_sys_large_files=no; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -22260,20 +23510,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_sys_large_files=1; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -22284,8 +23535,8 @@ rm -f core conftest.err conftest.$ac_obj break done fi -{ echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 -echo "${ECHO_T}$ac_cv_sys_large_files" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 +$as_echo "$ac_cv_sys_large_files" >&6; } case $ac_cv_sys_large_files in #( no | unknown) ;; *) @@ -22294,30 +23545,62 @@ cat >>confdefs.h <<_ACEOF _ACEOF ;; esac -rm -f conftest* +rm -rf conftest* fi fi -{ echo "$as_me:$LINENO: checking for off_t" >&5 -echo $ECHO_N "checking for off_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for off_t" >&5 +$as_echo_n "checking for off_t... " >&6; } if test "${ac_cv_type_off_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_off_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef off_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) +if (sizeof (off_t)) + return 0; + ; return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof ((off_t))) + return 0; ; return 0; } @@ -22328,30 +23611,39 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_off_t=yes + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_off_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_off_t=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 -echo "${ECHO_T}$ac_cv_type_off_t" >&6; } -if test $ac_cv_type_off_t = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 +$as_echo "$ac_cv_type_off_t" >&6; } +if test "x$ac_cv_type_off_t" = x""yes; then : else @@ -22362,6 +23654,18 @@ _ACEOF fi +# A simple compile time check in gpgme.h for GNU/Linux systems that +# prevents a file offset bits mismatch between gpgme and the application. +NEED__FILE_OFFSET_BITS=0 +case $ac_cv_sys_file_offset_bits in + no | unknown) ;; + *) + NEED__FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits + ;; +esac + + + # Checks for compiler features. if test "$GCC" = yes; then CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes" @@ -22371,10 +23675,10 @@ if test "$GCC" = yes; then fi # Network library fun. -{ echo "$as_me:$LINENO: checking for gethostbyname" >&5 -echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for gethostbyname" >&5 +$as_echo_n "checking for gethostbyname... " >&6; } if test "${ac_cv_func_gethostbyname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -22427,38 +23731,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func_gethostbyname=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_gethostbyname=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 -echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6; } -if test $ac_cv_func_gethostbyname = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 +$as_echo "$ac_cv_func_gethostbyname" >&6; } +if test "x$ac_cv_func_gethostbyname" = x""yes; then : else - { echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 -echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 +$as_echo_n "checking for gethostbyname in -lnsl... " >&6; } if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" @@ -22490,42 +23798,46 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_nsl_gethostbyname=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_gethostbyname=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 -echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6; } -if test $ac_cv_lib_nsl_gethostbyname = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 +$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } +if test "x$ac_cv_lib_nsl_gethostbyname" = x""yes; then NETLIBS="-lnsl $NETLIBS" fi fi -{ echo "$as_me:$LINENO: checking for setsockopt" >&5 -echo $ECHO_N "checking for setsockopt... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for setsockopt" >&5 +$as_echo_n "checking for setsockopt... " >&6; } if test "${ac_cv_func_setsockopt+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -22578,38 +23890,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func_setsockopt=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_setsockopt=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_setsockopt" >&5 -echo "${ECHO_T}$ac_cv_func_setsockopt" >&6; } -if test $ac_cv_func_setsockopt = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_setsockopt" >&5 +$as_echo "$ac_cv_func_setsockopt" >&6; } +if test "x$ac_cv_func_setsockopt" = x""yes; then : else - { echo "$as_me:$LINENO: checking for setsockopt in -lsocket" >&5 -echo $ECHO_N "checking for setsockopt in -lsocket... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for setsockopt in -lsocket" >&5 +$as_echo_n "checking for setsockopt in -lsocket... " >&6; } if test "${ac_cv_lib_socket_setsockopt+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" @@ -22641,33 +23957,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_socket_setsockopt=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_setsockopt=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_socket_setsockopt" >&5 -echo "${ECHO_T}$ac_cv_lib_socket_setsockopt" >&6; } -if test $ac_cv_lib_socket_setsockopt = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_socket_setsockopt" >&5 +$as_echo "$ac_cv_lib_socket_setsockopt" >&6; } +if test "x$ac_cv_lib_socket_setsockopt" = x""yes; then NETLIBS="-lsocket $NETLIBS" fi @@ -22676,10 +23996,10 @@ fi # Checks for library functions. -{ echo "$as_me:$LINENO: checking for _LARGEFILE_SOURCE value needed for large files" >&5 -echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for _LARGEFILE_SOURCE value needed for large files" >&5 +$as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; } if test "${ac_cv_sys_largefile_source+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else while :; do cat >conftest.$ac_ext <<_ACEOF @@ -22705,26 +24025,30 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_sys_largefile_source=no; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF @@ -22751,34 +24075,38 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_sys_largefile_source=1; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext ac_cv_sys_largefile_source=unknown break done fi -{ echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_source" >&5 -echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_source" >&5 +$as_echo "$ac_cv_sys_largefile_source" >&6; } case $ac_cv_sys_largefile_source in #( no | unknown) ;; *) @@ -22787,7 +24115,7 @@ cat >>confdefs.h <<_ACEOF _ACEOF ;; esac -rm -f conftest* +rm -rf conftest* # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug # in glibc 2.1.3, but that breaks too many other things. @@ -22804,11 +24132,11 @@ fi for ac_func in vasprintf do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -22861,35 +24189,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else @@ -22904,10 +24239,10 @@ done if test "$ac_cv_func_vasprintf" != yes; then - { echo "$as_me:$LINENO: checking whether va_lists must be copied by value" >&5 -echo $ECHO_N "checking whether va_lists must be copied by value... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether va_lists must be copied by value" >&5 +$as_echo_n "checking whether va_lists must be copied by value... " >&6; } if test "${gnupg_cv_must_copy_va_byval+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then @@ -22915,11 +24250,13 @@ else else gnupg_cv_must_copy_va_byval=no if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling +$as_echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -22953,27 +24290,30 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gnupg_cv_must_copy_va_byval=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -22990,11 +24330,11 @@ _ACEOF fi if test "$cross_compiling" = yes; then - { echo "$as_me:$LINENO: result: assuming $gnupg_cv_must_copy_va_byval" >&5 -echo "${ECHO_T}assuming $gnupg_cv_must_copy_va_byval" >&6; } + { $as_echo "$as_me:$LINENO: result: assuming $gnupg_cv_must_copy_va_byval" >&5 +$as_echo "assuming $gnupg_cv_must_copy_va_byval" >&6; } else - { echo "$as_me:$LINENO: result: $gnupg_cv_must_copy_va_byval" >&5 -echo "${ECHO_T}$gnupg_cv_must_copy_va_byval" >&6; } + { $as_echo "$as_me:$LINENO: result: $gnupg_cv_must_copy_va_byval" >&5 +$as_echo "$gnupg_cv_must_copy_va_byval" >&6; } fi fi @@ -23003,11 +24343,11 @@ fi for ac_func in ttyname_r do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -23060,35 +24400,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else @@ -23103,11 +24450,11 @@ done if test "$ac_cv_func_ttyname_r" != yes; then - { echo "$as_me:$LINENO: WARNING: + { $as_echo "$as_me:$LINENO: WARNING: *** *** ttyname() is not thread-safe and ttyname_r() does not exist ***" >&5 -echo "$as_me: WARNING: +$as_echo "$as_me: WARNING: *** *** ttyname() is not thread-safe and ttyname_r() does not exist ***" >&2;} @@ -23116,10 +24463,10 @@ fi # Try to find a thread-safe version of getenv(). have_thread_safe_getenv=no - { echo "$as_me:$LINENO: checking whether we are using the GNU C Library 2.1 or newer" >&5 -echo $ECHO_N "checking whether we are using the GNU C Library 2.1 or newer... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether we are using the GNU C Library 2.1 or newer" >&5 +$as_echo_n "checking whether we are using the GNU C Library 2.1 or newer... " >&6; } if test "${ac_cv_gnu_library_2_1+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -23147,8 +24494,8 @@ rm -f conftest* fi -{ echo "$as_me:$LINENO: result: $ac_cv_gnu_library_2_1" >&5 -echo "${ECHO_T}$ac_cv_gnu_library_2_1" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_gnu_library_2_1" >&5 +$as_echo "$ac_cv_gnu_library_2_1" >&6; } GLIBC21="$ac_cv_gnu_library_2_1" @@ -23167,11 +24514,11 @@ have_getenv_r=no for ac_func in getenv_r do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -23224,46 +24571,53 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF have_getenv_r=yes fi done if test $have_getenv_r = no && test $have_thread_safe_getenv = no; then - { echo "$as_me:$LINENO: WARNING: + { $as_echo "$as_me:$LINENO: WARNING: *** *** getenv() is not thread-safe and getenv_r() does not exist ***" >&5 -echo "$as_me: WARNING: +$as_echo "$as_me: WARNING: *** *** getenv() is not thread-safe and getenv_r() does not exist ***" >&2;} @@ -23274,11 +24628,11 @@ fi for ac_func in timegm do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -23331,47 +24685,54 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "$ac_cv_func_timegm" != yes; then - { echo "$as_me:$LINENO: WARNING: + { $as_echo "$as_me:$LINENO: WARNING: *** *** timegm() not available - a non-thread-safe kludge will be used *** and the TZ variable might be changed at runtime. ***" >&5 -echo "$as_me: WARNING: +$as_echo "$as_me: WARNING: *** *** timegm() not available - a non-thread-safe kludge will be used *** and the TZ variable might be changed at runtime. @@ -23395,10 +24756,10 @@ fi # Extract the first word of "gpg-error-config", so it can be a program name with args. set dummy gpg-error-config; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_GPG_ERROR_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $GPG_ERROR_CONFIG in [\\/]* | ?:[\\/]*) @@ -23413,7 +24774,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GPG_ERROR_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -23426,17 +24787,17 @@ esac fi GPG_ERROR_CONFIG=$ac_cv_path_GPG_ERROR_CONFIG if test -n "$GPG_ERROR_CONFIG"; then - { echo "$as_me:$LINENO: result: $GPG_ERROR_CONFIG" >&5 -echo "${ECHO_T}$GPG_ERROR_CONFIG" >&6; } + { $as_echo "$as_me:$LINENO: result: $GPG_ERROR_CONFIG" >&5 +$as_echo "$GPG_ERROR_CONFIG" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi min_gpg_error_version=1.4 - { echo "$as_me:$LINENO: checking for GPG Error - version >= $min_gpg_error_version" >&5 -echo $ECHO_N "checking for GPG Error - version >= $min_gpg_error_version... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for GPG Error - version >= $min_gpg_error_version" >&5 +$as_echo_n "checking for GPG Error - version >= $min_gpg_error_version... " >&6; } ok=no if test "$GPG_ERROR_CONFIG" != "no" ; then req_major=`echo $min_gpg_error_version | \ @@ -23461,16 +24822,16 @@ echo $ECHO_N "checking for GPG Error - v if test $ok = yes; then GPG_ERROR_CFLAGS=`$GPG_ERROR_CONFIG $gpg_error_config_args --cflags` GPG_ERROR_LIBS=`$GPG_ERROR_CONFIG $gpg_error_config_args --libs` - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } : else GPG_ERROR_CFLAGS="" GPG_ERROR_LIBS="" - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - { { echo "$as_me:$LINENO: error: libgpg-error was not found" >&5 -echo "$as_me: error: libgpg-error was not found" >&2;} + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:$LINENO: error: libgpg-error was not found" >&5 +$as_echo "$as_me: error: libgpg-error was not found" >&2;} { (exit 1); exit 1; }; } fi @@ -23560,10 +24921,10 @@ if test "$NO_OVERRIDE" = "yes" || test " if test "$cross_compiling" != "yes"; then # Extract the first word of "gpg", so it can be a program name with args. set dummy gpg; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_GPG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $GPG in [\\/]* | ?:[\\/]*) @@ -23578,7 +24939,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GPG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -23590,11 +24951,11 @@ esac fi GPG=$ac_cv_path_GPG if test -n "$GPG"; then - { echo "$as_me:$LINENO: result: $GPG" >&5 -echo "${ECHO_T}$GPG" >&6; } + { $as_echo "$as_me:$LINENO: result: $GPG" >&5 +$as_echo "$GPG" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -23606,20 +24967,20 @@ fi if test "$GPG" = no; then if test "$NO_OVERRIDE" = "yes"; then if test "$cross_compiling" != "yes"; then - { echo "$as_me:$LINENO: WARNING: + { $as_echo "$as_me:$LINENO: WARNING: *** *** Could not find GnuPG, install GnuPG or use --with-gpg=PATH to enable it ***" >&5 -echo "$as_me: WARNING: +$as_echo "$as_me: WARNING: *** *** Could not find GnuPG, install GnuPG or use --with-gpg=PATH to enable it ***" >&2;} else - { { echo "$as_me:$LINENO: error: + { { $as_echo "$as_me:$LINENO: error: *** *** Can not determine path to GnuPG when cross-compiling, use --with-gpg=PATH ***" >&5 -echo "$as_me: error: +$as_echo "$as_me: error: *** *** Can not determine path to GnuPG when cross-compiling, use --with-gpg=PATH ***" >&2;} @@ -23640,20 +25001,20 @@ if test -z "$GPG" -o "x$GPG" = "xno"; th ok=no else if test "$cross_compiling" = "yes"; then - { echo "$as_me:$LINENO: WARNING: GnuPG version can not be checked when cross compiling" >&5 -echo "$as_me: WARNING: GnuPG version can not be checked when cross compiling" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: GnuPG version can not be checked when cross compiling" >&5 +$as_echo "$as_me: WARNING: GnuPG version can not be checked when cross compiling" >&2;} ok=no else if test ! -x "$GPG"; then - { echo "$as_me:$LINENO: WARNING: GnuPG not executable, version check disabled" >&5 -echo "$as_me: WARNING: GnuPG not executable, version check disabled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: GnuPG not executable, version check disabled" >&5 +$as_echo "$as_me: WARNING: GnuPG not executable, version check disabled" >&2;} ok=no fi fi fi if test "$ok" = "maybe"; then - { echo "$as_me:$LINENO: checking for GPG >= $NEED_GPG_VERSION" >&5 -echo $ECHO_N "checking for GPG >= $NEED_GPG_VERSION... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for GPG >= $NEED_GPG_VERSION" >&5 +$as_echo_n "checking for GPG >= $NEED_GPG_VERSION... " >&6; } req_major=`echo $NEED_GPG_VERSION | \ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\1/'` req_minor=`echo $NEED_GPG_VERSION | \ @@ -23684,13 +25045,13 @@ echo $ECHO_N "checking for GPG >= $NEED_ fi fi if test "$ok" = "yes"; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - { echo "$as_me:$LINENO: WARNING: GPG must be at least version $NEED_GPG_VERSION" >&5 -echo "$as_me: WARNING: GPG must be at least version $NEED_GPG_VERSION" >&2;} + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + { $as_echo "$as_me:$LINENO: WARNING: GPG must be at least version $NEED_GPG_VERSION" >&5 +$as_echo "$as_me: WARNING: GPG must be at least version $NEED_GPG_VERSION" >&2;} fi fi run_gpg_test="$ok" @@ -23724,10 +25085,10 @@ if test "$NO_OVERRIDE" = "yes" || test " if test "$cross_compiling" != "yes"; then # Extract the first word of "gpgsm", so it can be a program name with args. set dummy gpgsm; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_GPGSM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $GPGSM in [\\/]* | ?:[\\/]*) @@ -23742,7 +25103,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GPGSM="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -23754,11 +25115,11 @@ esac fi GPGSM=$ac_cv_path_GPGSM if test -n "$GPGSM"; then - { echo "$as_me:$LINENO: result: $GPGSM" >&5 -echo "${ECHO_T}$GPGSM" >&6; } + { $as_echo "$as_me:$LINENO: result: $GPGSM" >&5 +$as_echo "$GPGSM" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -23770,20 +25131,20 @@ fi if test "$GPGSM" = no; then if test "$NO_OVERRIDE" = "yes"; then if test "$cross_compiling" != "yes"; then - { echo "$as_me:$LINENO: WARNING: + { $as_echo "$as_me:$LINENO: WARNING: *** *** Could not find GpgSM, install GpgSM or use --with-gpgsm=PATH to enable it ***" >&5 -echo "$as_me: WARNING: +$as_echo "$as_me: WARNING: *** *** Could not find GpgSM, install GpgSM or use --with-gpgsm=PATH to enable it ***" >&2;} else - { { echo "$as_me:$LINENO: error: + { { $as_echo "$as_me:$LINENO: error: *** *** Can not determine path to GpgSM when cross-compiling, use --with-gpgsm=PATH ***" >&5 -echo "$as_me: error: +$as_echo "$as_me: error: *** *** Can not determine path to GpgSM when cross-compiling, use --with-gpgsm=PATH ***" >&2;} @@ -23818,20 +25179,20 @@ if test -z "$GPGSM" -o "x$GPGSM" = "xno" ok=no else if test "$cross_compiling" = "yes"; then - { echo "$as_me:$LINENO: WARNING: GPGSM version can not be checked when cross compiling" >&5 -echo "$as_me: WARNING: GPGSM version can not be checked when cross compiling" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: GPGSM version can not be checked when cross compiling" >&5 +$as_echo "$as_me: WARNING: GPGSM version can not be checked when cross compiling" >&2;} ok=no else if test ! -x "$GPGSM"; then - { echo "$as_me:$LINENO: WARNING: GPGSM not executable, version check disabled" >&5 -echo "$as_me: WARNING: GPGSM not executable, version check disabled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: GPGSM not executable, version check disabled" >&5 +$as_echo "$as_me: WARNING: GPGSM not executable, version check disabled" >&2;} ok=no fi fi fi if test "$ok" = "maybe"; then - { echo "$as_me:$LINENO: checking for GPGSM >= $NEED_GPGSM_VERSION" >&5 -echo $ECHO_N "checking for GPGSM >= $NEED_GPGSM_VERSION... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for GPGSM >= $NEED_GPGSM_VERSION" >&5 +$as_echo_n "checking for GPGSM >= $NEED_GPGSM_VERSION... " >&6; } req_major=`echo $NEED_GPGSM_VERSION | \ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\1/'` req_minor=`echo $NEED_GPGSM_VERSION | \ @@ -23862,13 +25223,13 @@ echo $ECHO_N "checking for GPGSM >= $NEE fi fi if test "$ok" = "yes"; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - { echo "$as_me:$LINENO: WARNING: GPGSM must be at least version $NEED_GPGSM_VERSION" >&5 -echo "$as_me: WARNING: GPGSM must be at least version $NEED_GPGSM_VERSION" >&2;} + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + { $as_echo "$as_me:$LINENO: WARNING: GPGSM must be at least version $NEED_GPGSM_VERSION" >&5 +$as_echo "$as_me: WARNING: GPGSM must be at least version $NEED_GPGSM_VERSION" >&2;} fi fi run_gpgsm_test="$ok" @@ -23902,10 +25263,10 @@ if test "$NO_OVERRIDE" = "yes" || test " if test "$cross_compiling" != "yes"; then # Extract the first word of "gpgconf", so it can be a program name with args. set dummy gpgconf; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_GPGCONF+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $GPGCONF in [\\/]* | ?:[\\/]*) @@ -23920,7 +25281,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GPGCONF="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -23932,11 +25293,11 @@ esac fi GPGCONF=$ac_cv_path_GPGCONF if test -n "$GPGCONF"; then - { echo "$as_me:$LINENO: result: $GPGCONF" >&5 -echo "${ECHO_T}$GPGCONF" >&6; } + { $as_echo "$as_me:$LINENO: result: $GPGCONF" >&5 +$as_echo "$GPGCONF" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -23948,20 +25309,20 @@ fi if test "$GPGCONF" = no; then if test "$NO_OVERRIDE" = "yes"; then if test "$cross_compiling" != "yes"; then - { echo "$as_me:$LINENO: WARNING: + { $as_echo "$as_me:$LINENO: WARNING: *** *** Could not find gpgconf, install gpgconf or use --with-gpgconf=PATH to enable it ***" >&5 -echo "$as_me: WARNING: +$as_echo "$as_me: WARNING: *** *** Could not find gpgconf, install gpgconf or use --with-gpgconf=PATH to enable it ***" >&2;} else - { { echo "$as_me:$LINENO: error: + { { $as_echo "$as_me:$LINENO: error: *** *** Can not determine path to gpgconf when cross-compiling, use --with-gpgconf=PATH ***" >&5 -echo "$as_me: error: +$as_echo "$as_me: error: *** *** Can not determine path to gpgconf when cross-compiling, use --with-gpgconf=PATH ***" >&2;} @@ -23995,20 +25356,20 @@ if test -z "$GPGCONF" -o "x$GPGCONF" = " ok=no else if test "$cross_compiling" = "yes"; then - { echo "$as_me:$LINENO: WARNING: GPGCONF version can not be checked when cross compiling" >&5 -echo "$as_me: WARNING: GPGCONF version can not be checked when cross compiling" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: GPGCONF version can not be checked when cross compiling" >&5 +$as_echo "$as_me: WARNING: GPGCONF version can not be checked when cross compiling" >&2;} ok=no else if test ! -x "$GPGCONF"; then - { echo "$as_me:$LINENO: WARNING: GPGCONF not executable, version check disabled" >&5 -echo "$as_me: WARNING: GPGCONF not executable, version check disabled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: GPGCONF not executable, version check disabled" >&5 +$as_echo "$as_me: WARNING: GPGCONF not executable, version check disabled" >&2;} ok=no fi fi fi if test "$ok" = "maybe"; then - { echo "$as_me:$LINENO: checking for GPGCONF >= $NEED_GPGCONF_VERSION" >&5 -echo $ECHO_N "checking for GPGCONF >= $NEED_GPGCONF_VERSION... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for GPGCONF >= $NEED_GPGCONF_VERSION" >&5 +$as_echo_n "checking for GPGCONF >= $NEED_GPGCONF_VERSION... " >&6; } req_major=`echo $NEED_GPGCONF_VERSION | \ sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\1/'` req_minor=`echo $NEED_GPGCONF_VERSION | \ @@ -24039,13 +25400,13 @@ echo $ECHO_N "checking for GPGCONF >= $N fi fi if test "$ok" = "yes"; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - { echo "$as_me:$LINENO: WARNING: GPGCONF must be at least version $NEED_GPGCONF_VERSION" >&5 -echo "$as_me: WARNING: GPGCONF must be at least version $NEED_GPGCONF_VERSION" >&2;} + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + { $as_echo "$as_me:$LINENO: WARNING: GPGCONF must be at least version $NEED_GPGCONF_VERSION" >&5 +$as_echo "$as_me: WARNING: GPGCONF must be at least version $NEED_GPGCONF_VERSION" >&2;} fi fi run_gpgconf_test="$ok" @@ -24102,11 +25463,11 @@ fi for ac_func in funopen do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -24159,35 +25520,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -24198,11 +25566,11 @@ if test $ac_cv_func_funopen != yes; then for ac_func in fopencookie do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -24255,35 +25623,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -24293,11 +25668,11 @@ done for ac_func in funopen do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -24350,35 +25725,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else @@ -24393,11 +25775,11 @@ done else - { echo "$as_me:$LINENO: WARNING: + { $as_echo "$as_me:$LINENO: WARNING: *** *** No implementation of fopencookie or funopen available ***" >&5 -echo "$as_me: WARNING: +$as_echo "$as_me: WARNING: *** *** No implementation of fopencookie or funopen available ***" >&2;} @@ -24408,11 +25790,11 @@ fi for ac_func in isascii do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -24465,35 +25847,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else @@ -24510,11 +25899,11 @@ done for ac_func in putc_unlocked do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -24567,35 +25956,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else @@ -24612,11 +26008,11 @@ done for ac_func in memrchr do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -24669,35 +26065,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else @@ -24714,11 +26117,11 @@ done for ac_func in stpcpy do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -24771,35 +26174,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else @@ -24817,20 +26227,21 @@ done for ac_header in unistd.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -24846,32 +26257,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -24885,51 +26297,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------- ## ## Report this to bug-gpgme@gnupg.org ## @@ -24938,21 +26351,24 @@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -24962,11 +26378,11 @@ done for ac_func in setenv do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -25019,35 +26435,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else @@ -25066,20 +26489,21 @@ done for ac_header in sys/uio.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -25095,32 +26519,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -25134,51 +26559,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------- ## ## Report this to bug-gpgme@gnupg.org ## @@ -25187,21 +26613,24 @@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -25210,10 +26639,10 @@ done # Assuan check for descriptor passing. -{ echo "$as_me:$LINENO: checking for struct cmsghdr.cmsg_len" >&5 -echo $ECHO_N "checking for struct cmsghdr.cmsg_len... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct cmsghdr.cmsg_len" >&5 +$as_echo_n "checking for struct cmsghdr.cmsg_len... " >&6; } if test "${ac_cv_member_struct_cmsghdr_cmsg_len+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -25250,20 +26679,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_cmsghdr_cmsg_len=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -25301,20 +26731,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_cmsghdr_cmsg_len=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_cmsghdr_cmsg_len=no @@ -25325,18 +26756,18 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_cmsghdr_cmsg_len" >&5 -echo "${ECHO_T}$ac_cv_member_struct_cmsghdr_cmsg_len" >&6; } -if test $ac_cv_member_struct_cmsghdr_cmsg_len = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_cmsghdr_cmsg_len" >&5 +$as_echo "$ac_cv_member_struct_cmsghdr_cmsg_len" >&6; } +if test "x$ac_cv_member_struct_cmsghdr_cmsg_len" = x""yes; then supports_descriptor_passing=yes else supports_descriptor_passing=no - { echo "$as_me:$LINENO: WARNING: + { $as_echo "$as_me:$LINENO: WARNING: *** *** Data structure for sending ancillary data missing. *** Descriptor passing won't work. ***" >&5 -echo "$as_me: WARNING: +$as_echo "$as_me: WARNING: *** *** Data structure for sending ancillary data missing. *** Descriptor passing won't work. @@ -25372,10 +26803,10 @@ fi # Assuan check for the getsockopt SO_PEERCRED -{ echo "$as_me:$LINENO: checking for SO_PEERCRED" >&5 -echo $ECHO_N "checking for SO_PEERCRED... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for SO_PEERCRED" >&5 +$as_echo_n "checking for SO_PEERCRED... " >&6; } if test "${assuan_cv_sys_so_peercred+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -25400,20 +26831,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then assuan_cv_sys_so_peercred=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 assuan_cv_sys_so_peercred=no @@ -25423,8 +26855,8 @@ rm -f core conftest.err conftest.$ac_obj fi -{ echo "$as_me:$LINENO: result: $assuan_cv_sys_so_peercred" >&5 -echo "${ECHO_T}$assuan_cv_sys_so_peercred" >&6; } +{ $as_echo "$as_me:$LINENO: result: $assuan_cv_sys_so_peercred" >&5 +$as_echo "$assuan_cv_sys_so_peercred" >&6; } if test $assuan_cv_sys_so_peercred = yes; then cat >>confdefs.h <<\_ACEOF @@ -25481,7 +26913,7 @@ LTLIBOBJS=`echo "$LIBOBJS" | # # Create config files -ac_config_files="$ac_config_files Makefile assuan/Makefile src/Makefile tests/Makefile tests/gpg/Makefile tests/gpgsm/Makefile doc/Makefile complus/Makefile src/versioninfo.rc src/gpgme.h" +ac_config_files="$ac_config_files Makefile assuan/Makefile src/Makefile tests/Makefile tests/gpg/Makefile tests/gpgsm/Makefile tests/opassuan/Makefile doc/Makefile complus/Makefile src/versioninfo.rc src/gpgme.h" ac_config_files="$ac_config_files src/gpgme-config" @@ -25514,11 +26946,12 @@ _ACEOF case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac @@ -25551,12 +26984,12 @@ echo "$as_me: WARNING: Cache variable $a if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && - { echo "$as_me:$LINENO: updating cache $cache_file" >&5 -echo "$as_me: updating cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 -echo "$as_me: not updating unwritable cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -25572,7 +27005,7 @@ ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`echo "$ac_i" | sed "$ac_script"` + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" @@ -25584,152 +27017,160 @@ LTLIBOBJS=$ac_ltlibobjs if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. +$as_echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +$as_echo "$as_me: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"AMDEP\" was never defined. +$as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +$as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. +$as_echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_LD_VERSION_SCRIPT_TRUE}" && test -z "${HAVE_LD_VERSION_SCRIPT_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"HAVE_LD_VERSION_SCRIPT\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_LD_VERSION_SCRIPT\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"HAVE_LD_VERSION_SCRIPT\" was never defined. +$as_echo "$as_me: error: conditional \"HAVE_LD_VERSION_SCRIPT\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_DOSISH_SYSTEM_TRUE}" && test -z "${HAVE_DOSISH_SYSTEM_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"HAVE_DOSISH_SYSTEM\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_DOSISH_SYSTEM\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"HAVE_DOSISH_SYSTEM\" was never defined. +$as_echo "$as_me: error: conditional \"HAVE_DOSISH_SYSTEM\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_W32_SYSTEM_TRUE}" && test -z "${HAVE_W32_SYSTEM_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"HAVE_W32_SYSTEM\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_W32_SYSTEM\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"HAVE_W32_SYSTEM\" was never defined. +$as_echo "$as_me: error: conditional \"HAVE_W32_SYSTEM\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${BUILD_W32_GLIB_TRUE}" && test -z "${BUILD_W32_GLIB_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"BUILD_W32_GLIB\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"BUILD_W32_GLIB\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"BUILD_W32_GLIB\" was never defined. +$as_echo "$as_me: error: conditional \"BUILD_W32_GLIB\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${BUILD_W32_QT_TRUE}" && test -z "${BUILD_W32_QT_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"BUILD_W32_QT\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"BUILD_W32_QT\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"BUILD_W32_QT\" was never defined. +$as_echo "$as_me: error: conditional \"BUILD_W32_QT\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_PTH_TRUE}" && test -z "${HAVE_PTH_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"HAVE_PTH\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_PTH\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"HAVE_PTH\" was never defined. +$as_echo "$as_me: error: conditional \"HAVE_PTH\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_PTHREAD_TRUE}" && test -z "${HAVE_PTHREAD_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"HAVE_PTHREAD\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_PTHREAD\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"HAVE_PTHREAD\" was never defined. +$as_echo "$as_me: error: conditional \"HAVE_PTHREAD\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${RUN_GPG_TESTS_TRUE}" && test -z "${RUN_GPG_TESTS_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"RUN_GPG_TESTS\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"RUN_GPG_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"RUN_GPG_TESTS\" was never defined. +$as_echo "$as_me: error: conditional \"RUN_GPG_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_GPGSM_TRUE}" && test -z "${HAVE_GPGSM_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"HAVE_GPGSM\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_GPGSM\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"HAVE_GPGSM\" was never defined. +$as_echo "$as_me: error: conditional \"HAVE_GPGSM\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${RUN_GPGSM_TESTS_TRUE}" && test -z "${RUN_GPGSM_TESTS_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"RUN_GPGSM_TESTS\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"RUN_GPGSM_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"RUN_GPGSM_TESTS\" was never defined. +$as_echo "$as_me: error: conditional \"RUN_GPGSM_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_GPGCONF_TRUE}" && test -z "${HAVE_GPGCONF_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"HAVE_GPGCONF\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_GPGCONF\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"HAVE_GPGCONF\" was never defined. +$as_echo "$as_me: error: conditional \"HAVE_GPGCONF\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${RUN_GPGCONF_TESTS_TRUE}" && test -z "${RUN_GPGCONF_TESTS_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"RUN_GPGCONF_TESTS\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"RUN_GPGCONF_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"RUN_GPGCONF_TESTS\" was never defined. +$as_echo "$as_me: error: conditional \"RUN_GPGCONF_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${BUILD_GPGCONF_TRUE}" && test -z "${BUILD_GPGCONF_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"BUILD_GPGCONF\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"BUILD_GPGCONF\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"BUILD_GPGCONF\" was never defined. +$as_echo "$as_me: error: conditional \"BUILD_GPGCONF\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${BUILD_ASSUAN_TRUE}" && test -z "${BUILD_ASSUAN_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"BUILD_ASSUAN\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"BUILD_ASSUAN\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"BUILD_ASSUAN\" was never defined. +$as_echo "$as_me: error: conditional \"BUILD_ASSUAN\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_DESCRIPTOR_PASSING_TRUE}" && test -z "${USE_DESCRIPTOR_PASSING_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"USE_DESCRIPTOR_PASSING\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"USE_DESCRIPTOR_PASSING\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"USE_DESCRIPTOR_PASSING\" was never defined. +$as_echo "$as_me: error: conditional \"USE_DESCRIPTOR_PASSING\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${BUILD_COMPLUS_TRUE}" && test -z "${BUILD_COMPLUS_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"BUILD_COMPLUS\" was never defined. + { { $as_echo "$as_me:$LINENO: error: conditional \"BUILD_COMPLUS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"BUILD_COMPLUS\" was never defined. +$as_echo "$as_me: error: conditional \"BUILD_COMPLUS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} +ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF +{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. @@ -25742,7 +27183,7 @@ ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## @@ -25752,7 +27193,7 @@ DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # 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 @@ -25774,17 +27215,45 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTE as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh + 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 # Support unset when possible. @@ -25800,8 +27269,6 @@ fi # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) -as_nl=' -' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. @@ -25824,7 +27291,7 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi @@ -25837,17 +27304,10 @@ PS2='> ' PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && @@ -25869,7 +27329,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | +$as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -25920,7 +27380,7 @@ $as_unset CDPATH s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems @@ -25948,7 +27408,6 @@ case `echo -n x` in *) ECHO_N='-n';; esac - if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -25961,19 +27420,22 @@ if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir - mkdir conf$$.dir + mkdir conf$$.dir 2>/dev/null fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln + fi else as_ln_s='cp -p' fi @@ -25998,10 +27460,10 @@ else as_test_x=' eval sh -c '\'' if test -d "$1"; then - test -d "$1/."; + test -d "$1/."; else case $1 in - -*)set "./$1";; + -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi @@ -26023,8 +27485,8 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by gpgme $as_me 1.1.8, which was -generated by GNU Autoconf 2.61. Invocation command line was +This file was extended by gpgme $as_me 1.2.0, which was +generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -26037,7 +27499,16 @@ on `(hostname || uname -n) 2>/dev/null | _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" @@ -26045,22 +27516,23 @@ config_commands="$ac_config_commands" _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. -Usage: $0 [OPTIONS] [FILE]... +Usage: $0 [OPTION]... [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit - -q, --quiet do not print progress messages + -q, --quiet, --silent + do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE Configuration files: $config_files @@ -26074,13 +27546,13 @@ $config_commands Report bugs to ." _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ -gpgme config.status 1.1.8 -configured by $0, generated by GNU Autoconf 2.61, - with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" +gpgme config.status 1.2.0 +configured by $0, generated by GNU Autoconf 2.63, + with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2006 Free Software Foundation, Inc. +Copyright (C) 2008 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -26088,11 +27560,12 @@ ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. +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 @@ -26114,30 +27587,36 @@ do -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - echo "$ac_cs_version"; exit ;; + $as_echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - { echo "$as_me: error: ambiguous option: $1 + { $as_echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) - echo "$ac_cs_usage"; exit ;; + $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { echo "$as_me: error: unrecognized option: $1 + -*) { $as_echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; @@ -26156,27 +27635,29 @@ if $ac_cs_silent; then fi _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - CONFIG_SHELL=$SHELL + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' export CONFIG_SHELL - exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + exec "\$@" fi _ACEOF -cat >>$CONFIG_STATUS <<\_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 - echo "$ac_log" + $as_echo "$ac_log" } >&5 _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # @@ -26184,7 +27665,7 @@ AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets @@ -26198,6 +27679,7 @@ do "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "tests/gpg/Makefile") CONFIG_FILES="$CONFIG_FILES tests/gpg/Makefile" ;; "tests/gpgsm/Makefile") CONFIG_FILES="$CONFIG_FILES tests/gpgsm/Makefile" ;; + "tests/opassuan/Makefile") CONFIG_FILES="$CONFIG_FILES tests/opassuan/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "complus/Makefile") CONFIG_FILES="$CONFIG_FILES complus/Makefile" ;; "src/versioninfo.rc") CONFIG_FILES="$CONFIG_FILES src/versioninfo.rc" ;; @@ -26207,8 +27689,8 @@ do "lang/cl/Makefile") CONFIG_FILES="$CONFIG_FILES lang/cl/Makefile" ;; "lang/cl/gpgme.asd") CONFIG_FILES="$CONFIG_FILES lang/cl/gpgme.asd" ;; - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done @@ -26249,277 +27731,143 @@ $debug || (umask 077 && mkdir "$tmp") } || { - echo "$me: cannot create a temporary directory in ." >&2 + $as_echo "$as_me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } -# -# Set up the sed scripts for CONFIG_FILES section. -# - -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h +# 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 -_ACEOF - - -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -SHELL!$SHELL$ac_delim -PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim -PACKAGE_NAME!$PACKAGE_NAME$ac_delim -PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim -PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim -PACKAGE_STRING!$PACKAGE_STRING$ac_delim -PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim -exec_prefix!$exec_prefix$ac_delim -prefix!$prefix$ac_delim -program_transform_name!$program_transform_name$ac_delim -bindir!$bindir$ac_delim -sbindir!$sbindir$ac_delim -libexecdir!$libexecdir$ac_delim -datarootdir!$datarootdir$ac_delim -datadir!$datadir$ac_delim -sysconfdir!$sysconfdir$ac_delim -sharedstatedir!$sharedstatedir$ac_delim -localstatedir!$localstatedir$ac_delim -includedir!$includedir$ac_delim -oldincludedir!$oldincludedir$ac_delim -docdir!$docdir$ac_delim -infodir!$infodir$ac_delim -htmldir!$htmldir$ac_delim -dvidir!$dvidir$ac_delim -pdfdir!$pdfdir$ac_delim -psdir!$psdir$ac_delim -libdir!$libdir$ac_delim -localedir!$localedir$ac_delim -mandir!$mandir$ac_delim -DEFS!$DEFS$ac_delim -ECHO_C!$ECHO_C$ac_delim -ECHO_N!$ECHO_N$ac_delim -ECHO_T!$ECHO_T$ac_delim -LIBS!$LIBS$ac_delim -build_alias!$build_alias$ac_delim -host_alias!$host_alias$ac_delim -target_alias!$target_alias$ac_delim -INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim -INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim -INSTALL_DATA!$INSTALL_DATA$ac_delim -am__isrc!$am__isrc$ac_delim -CYGPATH_W!$CYGPATH_W$ac_delim -PACKAGE!$PACKAGE$ac_delim -VERSION!$VERSION$ac_delim -ACLOCAL!$ACLOCAL$ac_delim -AUTOCONF!$AUTOCONF$ac_delim -AUTOMAKE!$AUTOMAKE$ac_delim -AUTOHEADER!$AUTOHEADER$ac_delim -MAKEINFO!$MAKEINFO$ac_delim -install_sh!$install_sh$ac_delim -STRIP!$STRIP$ac_delim -INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim -mkdir_p!$mkdir_p$ac_delim -AWK!$AWK$ac_delim -SET_MAKE!$SET_MAKE$ac_delim -am__leading_dot!$am__leading_dot$ac_delim -AMTAR!$AMTAR$ac_delim -am__tar!$am__tar$ac_delim -am__untar!$am__untar$ac_delim -MAINTAINER_MODE_TRUE!$MAINTAINER_MODE_TRUE$ac_delim -MAINTAINER_MODE_FALSE!$MAINTAINER_MODE_FALSE$ac_delim -MAINT!$MAINT$ac_delim -build!$build$ac_delim -build_cpu!$build_cpu$ac_delim -build_vendor!$build_vendor$ac_delim -build_os!$build_os$ac_delim -host!$host$ac_delim -host_cpu!$host_cpu$ac_delim -host_vendor!$host_vendor$ac_delim -host_os!$host_os$ac_delim -CC!$CC$ac_delim -CFLAGS!$CFLAGS$ac_delim -LDFLAGS!$LDFLAGS$ac_delim -CPPFLAGS!$CPPFLAGS$ac_delim -ac_ct_CC!$ac_ct_CC$ac_delim -EXEEXT!$EXEEXT$ac_delim -OBJEXT!$OBJEXT$ac_delim -DEPDIR!$DEPDIR$ac_delim -am__include!$am__include$ac_delim -am__quote!$am__quote$ac_delim -AMDEP_TRUE!$AMDEP_TRUE$ac_delim -AMDEP_FALSE!$AMDEP_FALSE$ac_delim -AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim -CCDEPMODE!$CCDEPMODE$ac_delim -am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim -am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim -CXX!$CXX$ac_delim -CXXFLAGS!$CXXFLAGS$ac_delim -ac_ct_CXX!$ac_ct_CXX$ac_delim -CXXDEPMODE!$CXXDEPMODE$ac_delim -am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim -am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim -LIBGPGME_LT_CURRENT!$LIBGPGME_LT_CURRENT$ac_delim -LIBGPGME_LT_AGE!$LIBGPGME_LT_AGE$ac_delim -LIBGPGME_LT_REVISION!$LIBGPGME_LT_REVISION$ac_delim -RC!$RC$ac_delim -GREP!$GREP$ac_delim -_ACEOF - - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then - break - elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` +ac_cr=' ' +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 -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -CEOF$ac_eof +echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } +ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -EGREP!$EGREP$ac_delim -LN_S!$LN_S$ac_delim -ECHO!$ECHO$ac_delim -AR!$AR$ac_delim -RANLIB!$RANLIB$ac_delim -DLLTOOL!$DLLTOOL$ac_delim -AS!$AS$ac_delim -OBJDUMP!$OBJDUMP$ac_delim -CPP!$CPP$ac_delim -CXXCPP!$CXXCPP$ac_delim -F77!$F77$ac_delim -FFLAGS!$FFLAGS$ac_delim -ac_ct_F77!$ac_ct_F77$ac_delim -LIBTOOL!$LIBTOOL$ac_delim -HAVE_LD_VERSION_SCRIPT_TRUE!$HAVE_LD_VERSION_SCRIPT_TRUE$ac_delim -HAVE_LD_VERSION_SCRIPT_FALSE!$HAVE_LD_VERSION_SCRIPT_FALSE$ac_delim -PKG_CONFIG!$PKG_CONFIG$ac_delim -GLIB_CFLAGS!$GLIB_CFLAGS$ac_delim -GLIB_LIBS!$GLIB_LIBS$ac_delim -GLIB_GENMARSHAL!$GLIB_GENMARSHAL$ac_delim -GOBJECT_QUERY!$GOBJECT_QUERY$ac_delim -GLIB_MKENUMS!$GLIB_MKENUMS$ac_delim -QT4_CORE_CFLAGS!$QT4_CORE_CFLAGS$ac_delim -QT4_CORE_LIBS!$QT4_CORE_LIBS$ac_delim -PTH_CPPFLAGS!$PTH_CPPFLAGS$ac_delim -PTH_CFLAGS!$PTH_CFLAGS$ac_delim -PTH_LDFLAGS!$PTH_LDFLAGS$ac_delim -PTH_LIBS!$PTH_LIBS$ac_delim -HAVE_DOSISH_SYSTEM_TRUE!$HAVE_DOSISH_SYSTEM_TRUE$ac_delim -HAVE_DOSISH_SYSTEM_FALSE!$HAVE_DOSISH_SYSTEM_FALSE$ac_delim -HAVE_W32_SYSTEM_TRUE!$HAVE_W32_SYSTEM_TRUE$ac_delim -HAVE_W32_SYSTEM_FALSE!$HAVE_W32_SYSTEM_FALSE$ac_delim -BUILD_W32_GLIB_TRUE!$BUILD_W32_GLIB_TRUE$ac_delim -BUILD_W32_GLIB_FALSE!$BUILD_W32_GLIB_FALSE$ac_delim -BUILD_W32_QT_TRUE!$BUILD_W32_QT_TRUE$ac_delim -BUILD_W32_QT_FALSE!$BUILD_W32_QT_FALSE$ac_delim -HAVE_PTH_TRUE!$HAVE_PTH_TRUE$ac_delim -HAVE_PTH_FALSE!$HAVE_PTH_FALSE$ac_delim -HAVE_PTHREAD_TRUE!$HAVE_PTHREAD_TRUE$ac_delim -HAVE_PTHREAD_FALSE!$HAVE_PTHREAD_FALSE$ac_delim -NETLIBS!$NETLIBS$ac_delim -LIBOBJS!$LIBOBJS$ac_delim -GLIBC21!$GLIBC21$ac_delim -GPG_ERROR_CONFIG!$GPG_ERROR_CONFIG$ac_delim -GPG_ERROR_CFLAGS!$GPG_ERROR_CFLAGS$ac_delim -GPG_ERROR_LIBS!$GPG_ERROR_LIBS$ac_delim -GPG!$GPG$ac_delim -RUN_GPG_TESTS_TRUE!$RUN_GPG_TESTS_TRUE$ac_delim -RUN_GPG_TESTS_FALSE!$RUN_GPG_TESTS_FALSE$ac_delim -GPG_PATH!$GPG_PATH$ac_delim -GPGSM!$GPGSM$ac_delim -HAVE_GPGSM_TRUE!$HAVE_GPGSM_TRUE$ac_delim -HAVE_GPGSM_FALSE!$HAVE_GPGSM_FALSE$ac_delim -RUN_GPGSM_TESTS_TRUE!$RUN_GPGSM_TESTS_TRUE$ac_delim -RUN_GPGSM_TESTS_FALSE!$RUN_GPGSM_TESTS_FALSE$ac_delim -GPGCONF!$GPGCONF$ac_delim -HAVE_GPGCONF_TRUE!$HAVE_GPGCONF_TRUE$ac_delim -HAVE_GPGCONF_FALSE!$HAVE_GPGCONF_FALSE$ac_delim -RUN_GPGCONF_TESTS_TRUE!$RUN_GPGCONF_TESTS_TRUE$ac_delim -RUN_GPGCONF_TESTS_FALSE!$RUN_GPGCONF_TESTS_FALSE$ac_delim -BUILD_GPGCONF_TRUE!$BUILD_GPGCONF_TRUE$ac_delim -BUILD_GPGCONF_FALSE!$BUILD_GPGCONF_FALSE$ac_delim -BUILD_ASSUAN_TRUE!$BUILD_ASSUAN_TRUE$ac_delim -BUILD_ASSUAN_FALSE!$BUILD_ASSUAN_FALSE$ac_delim -USE_DESCRIPTOR_PASSING_TRUE!$USE_DESCRIPTOR_PASSING_TRUE$ac_delim -USE_DESCRIPTOR_PASSING_FALSE!$USE_DESCRIPTOR_PASSING_FALSE$ac_delim -BUILD_COMPLUS_TRUE!$BUILD_COMPLUS_TRUE$ac_delim -BUILD_COMPLUS_FALSE!$BUILD_COMPLUS_FALSE$ac_delim -BUILD_REVISION!$BUILD_REVISION$ac_delim -BUILD_TIMESTAMP!$BUILD_TIMESTAMP$ac_delim -BUILD_FILEVERSION!$BUILD_FILEVERSION$ac_delim -GPGME_CONFIG_API_VERSION!$GPGME_CONFIG_API_VERSION$ac_delim -GPGME_CONFIG_LIBS!$GPGME_CONFIG_LIBS$ac_delim -GPGME_CONFIG_CFLAGS!$GPGME_CONFIG_CFLAGS$ac_delim -LTLIBOBJS!$LTLIBOBJS$ac_delim -_ACEOF + . ./conf$$subs.sh || + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 75; then + 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 - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done +rm -f conf$$subs.sh -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` -fi - -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -:end -s/|#_!!_#|//g -CEOF$ac_eof +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\).*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\).*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 +$as_echo "$as_me: error: could not setup config files machinery" >&2;} + { (exit 1); exit 1; }; } +_ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and @@ -26536,19 +27884,133 @@ s/^[^=]*=[ ]*$// }' fi -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_t=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_t"; then + break + elif $ac_last_try; then + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 +$as_echo "$as_me: error: could not setup config headers machinery" >&2;} + { (exit 1); exit 1; }; } +fi # test -n "$CONFIG_HEADERS" + -for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 -echo "$as_me: error: Invalid tag $ac_tag." >&2;} + :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 +$as_echo "$as_me: error: invalid tag $ac_tag" >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; @@ -26577,26 +28039,38 @@ echo "$as_me: error: Invalid tag $ac_tag [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac - ac_file_inputs="$ac_file_inputs $ac_f" + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + ac_file_inputs="$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 "`IFS=: - echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} + { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin";; + *:-:* | *:-) cat >"$tmp/stdin" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } ;; esac ;; esac @@ -26606,7 +28080,7 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -echo X"$ac_file" | +$as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -26632,7 +28106,7 @@ echo X"$ac_file" | as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -26641,7 +28115,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -echo X"$as_dir" | +$as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -26662,17 +28136,17 @@ echo X"$as_dir" | test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -echo "$as_me: error: cannot create directory $as_dir" >&2;} + } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -26717,12 +28191,13 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_ esac _ACEOF -cat >>$CONFIG_STATUS <<\_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= -case `sed -n '/datarootdir/ { +ac_sed_dataroot=' +/datarootdir/ { p q } @@ -26731,13 +28206,14 @@ case `sed -n '/datarootdir/ { /@infodir@/p /@localedir@/p /@mandir@/p -' $ac_file_inputs` in +' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g @@ -26751,15 +28227,16 @@ _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 - sed "$ac_vpsub +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub $extrasub _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s&@configure_input@&$configure_input&;t t +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 @@ -26770,121 +28247,60 @@ s&@abs_top_builddir@&$ac_abs_top_builddi s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack -" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 -echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in - -) cat "$tmp/out"; rm -f "$tmp/out";; - *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; - esac + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } ;; :H) # # CONFIG_HEADER # -_ACEOF - -# Transform confdefs.h into a sed script `conftest.defines', that -# substitutes the proper values into config.h.in to produce config.h. -rm -f conftest.defines conftest.tail -# First, append a space to every undef/define line, to ease matching. -echo 's/$/ /' >conftest.defines -# Then, protect against being on the right side of a sed subst, or in -# an unquoted here document, in config.status. If some macros were -# called several times there might be several #defines for the same -# symbol, which is useless. But do not sort them, since the last -# AC_DEFINE must be honored. -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where -# NAME is the cpp macro being defined, VALUE is the value it is being given. -# PARAMS is the parameter list in the macro definition--in most cases, it's -# just an empty string. -ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' -ac_dB='\\)[ (].*,\\1define\\2' -ac_dC=' ' -ac_dD=' ,' - -uniq confdefs.h | - sed -n ' - t rset - :rset - s/^[ ]*#[ ]*define[ ][ ]*// - t ok - d - :ok - s/[\\&,]/\\&/g - s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p - s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p - ' >>conftest.defines - -# Remove the space that was appended to ease matching. -# Then replace #undef with comments. This is necessary, for -# example, in the case of _POSIX_SOURCE, which is predefined and required -# on some systems where configure will not decide to define it. -# (The regexp can be short, since the line contains either #define or #undef.) -echo 's/ $// -s,^[ #]*u.*,/* & */,' >>conftest.defines - -# Break up conftest.defines: -ac_max_sed_lines=50 - -# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" -# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" -# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" -# et cetera. -ac_in='$ac_file_inputs' -ac_out='"$tmp/out1"' -ac_nxt='"$tmp/out2"' - -while : -do - # Write a here document: - cat >>$CONFIG_STATUS <<_ACEOF - # First, check the format of the line: - cat >"\$tmp/defines.sed" <<\\CEOF -/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def -/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def -b -:def -_ACEOF - sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS - echo 'CEOF - sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS - ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in - sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail - grep . conftest.tail >/dev/null || break - rm -f conftest.defines - mv conftest.tail conftest.defines -done -rm -f conftest.defines conftest.tail - -echo "ac_result=$ac_in" >>$CONFIG_STATUS -cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then - echo "/* $configure_input */" >"$tmp/config.h" - cat "$ac_result" >>"$tmp/config.h" - if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then - { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 -echo "$as_me: $ac_file is unchanged" >&6;} + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" + } >"$tmp/config.h" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } + if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} else - rm -f $ac_file - mv "$tmp/config.h" $ac_file + rm -f "$ac_file" + mv "$tmp/config.h" "$ac_file" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } fi else - echo "/* $configure_input */" - cat "$ac_result" + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ + || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 +$as_echo "$as_me: error: could not create -" >&2;} + { (exit 1); exit 1; }; } fi - rm -f "$tmp/out12" -# Compute $ac_file's index in $config_headers. -_am_arg=$ac_file +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in @@ -26899,7 +28315,7 @@ $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || -echo X"$_am_arg" | +$as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -26919,30 +28335,40 @@ echo X"$_am_arg" | s/.*/./; q'`/stamp-h$_am_stamp_count ;; - :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 -echo "$as_me: executing $ac_file commands" >&6;} + :C) { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in - "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`$as_dirname -- "$mf" || + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || -echo X"$mf" | +$as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -26960,33 +28386,33 @@ echo X"$mf" | q } s/.*/./; q'` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`$as_dirname -- "$file" || + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || -echo X"$file" | +$as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -27004,7 +28430,7 @@ echo X"$file" | q } s/.*/./; q'` - { as_dir=$dirpart/$fdir + { as_dir=$dirpart/$fdir case $as_dir in #( -*) as_dir=./$as_dir;; esac @@ -27012,7 +28438,7 @@ echo X"$file" | as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -27021,7 +28447,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -echo X"$as_dir" | +$as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -27042,13 +28468,14 @@ echo X"$as_dir" | test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -echo "$as_me: error: cannot create directory $as_dir" >&2;} + } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done done -done +} ;; "src/gpgme-config":F) chmod +x src/gpgme-config ;; @@ -27061,6 +28488,11 @@ _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save +test $ac_write_fail = 0 || + { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. @@ -27082,6 +28514,10 @@ if test "$no_create" != yes; then # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi echo " diff -urpNP gpgme-1.1.8/configure.ac gpgme-1.2.0/configure.ac --- gpgme-1.1.8/configure.ac 2008-12-08 18:40:52.000000000 +0000 +++ gpgme-1.2.0/configure.ac 2009-06-18 16:13:23.000000000 +0000 @@ -31,7 +31,7 @@ min_automake_version="1.10" # specific feature can already be done under the assumption that the # SVN version is the most recent one in a branch. To disable the SVN # version for the real release, set the my_issvn macro to no. -m4_define(my_version, [1.1.8]) +m4_define(my_version, [1.2.0]) m4_define(my_issvn, [no]) m4_define([svn_revision], m4_esyscmd([echo -n $( (svn info 2>/dev/null \ @@ -47,11 +47,11 @@ AC_INIT([gpgme], # (Interfaces added: AGE++) # (Interfaces removed/changed: AGE=0) # -LIBGPGME_LT_CURRENT=17 +LIBGPGME_LT_CURRENT=18 # Subtract 2 from this value if you want to make the LFS transition an # ABI break. [Note to self: Remove this comment with the next regular break.] -LIBGPGME_LT_AGE=6 -LIBGPGME_LT_REVISION=6 +LIBGPGME_LT_AGE=7 +LIBGPGME_LT_REVISION=0 # If the API is changed in an incompatible way: increment the next counter. GPGME_CONFIG_API_VERSION=1 @@ -198,6 +198,18 @@ AC_CHECK_SIZEOF(unsigned int) AC_SYS_LARGEFILE AC_TYPE_OFF_T +# A simple compile time check in gpgme.h for GNU/Linux systems that +# prevents a file offset bits mismatch between gpgme and the application. +NEED__FILE_OFFSET_BITS=0 +case $ac_cv_sys_file_offset_bits in + no | unknown) ;; + *) + NEED__FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits + ;; +esac +AC_SUBST(NEED__FILE_OFFSET_BITS) + + # Checks for compiler features. if test "$GCC" = yes; then CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes" @@ -744,7 +756,10 @@ AC_SUBST(LTLIBOBJS) # Create config files AC_CONFIG_FILES(Makefile assuan/Makefile src/Makefile - tests/Makefile tests/gpg/Makefile tests/gpgsm/Makefile + tests/Makefile + tests/gpg/Makefile + tests/gpgsm/Makefile + tests/opassuan/Makefile doc/Makefile complus/Makefile src/versioninfo.rc src/gpgme.h) diff -urpNP gpgme-1.1.8/doc/ChangeLog gpgme-1.2.0/doc/ChangeLog --- gpgme-1.1.8/doc/ChangeLog 2008-12-08 17:47:37.000000000 +0000 +++ gpgme-1.2.0/doc/ChangeLog 2009-06-17 12:36:08.000000000 +0000 @@ -1,3 +1,27 @@ +2009-06-16 Marcus Brinkmann + + * gpgme.texi (Result Management): New section. + +2009-06-16 Werner Koch + + * gpgme.texi (Exporting Keys): Document gpgme_op_export_keys. + (Importing Keys): Document gpgme_op_import_keys. + (Data Buffer Meta-Data): Document URL encodings. + +2009-05-28 Marcus Brinkmann + + * gpgme.texi (Library Version Check): Document selftest error. + (Creating Contexts): Likewise. + +2009-05-18 Marcus Brinkmann + + * gpgme.texi (Encrypting a Plaintext): Document + GPGME_ENCRYPT_NO_ENCRYPT_TO. + +2009-05-05 Marcus Brinkmann + + * gpgme.texi (Engine Information): Replace path by file_name. + 2008-11-28 Werner Koch * gpgme.texi (Listing Keys): Change description of the return diff -urpNP gpgme-1.1.8/doc/Makefile.in gpgme-1.2.0/doc/Makefile.in --- gpgme-1.1.8/doc/Makefile.in 2008-12-08 18:41:52.000000000 +0000 +++ gpgme-1.2.0/doc/Makefile.in 2009-06-18 16:13:40.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -152,6 +152,7 @@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ +NEED__FILE_OFFSET_BITS = @NEED__FILE_OFFSET_BITS@ NETLIBS = @NETLIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -224,6 +225,7 @@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ DISTCLEANFILES = gpgme.tmp @@ -238,8 +240,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_ @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ diff -urpNP gpgme-1.1.8/doc/gpgme.texi gpgme-1.2.0/doc/gpgme.texi --- gpgme-1.1.8/doc/gpgme.texi 2008-12-08 17:47:37.000000000 +0000 +++ gpgme-1.2.0/doc/gpgme.texi 2009-06-17 12:36:08.000000000 +0000 @@ -173,6 +173,7 @@ Contexts * Creating Contexts:: Creating new @acronym{GPGME} contexts. * Destroying Contexts:: Releasing @acronym{GPGME} contexts. +* Result Management:: Managing the result of crypto operations. * Context Attributes:: Setting properties of a context. * Key Management:: Managing keys with @acronym{GPGME}. * Trust Item Management:: Managing trust items with @acronym{GPGME}. @@ -577,13 +578,13 @@ automatically by Libtool. @cindex version check, of the library @deftypefun {const char *} gpgme_check_version (@w{const char *@var{required_version}}) -The function @code{gpgme_check_version} has three purposes. It can be +The function @code{gpgme_check_version} has four purposes. It can be used to retrieve the version number of the library. In addition it can verify that the version number is higher than a certain required version number. In either case, the function initializes some sub-systems, and for this reason alone it must be invoked early in your program, before you make use of the other functions in -@acronym{GPGME}. +@acronym{GPGME}. The last purpose is to run selftests. As a side effect for W32 based systems, the socket layer will get initialized. @@ -606,6 +607,11 @@ If you use a version of a library that i older releases, but contains additional interfaces which your program uses, this function provides a run-time check if the necessary features are provided by the installed version of the library. + +If a selftest fails, the function may still succeed. Selftest errors +are returned later when invoking @code{gpgme_new}, so that a detailed +error code can be returned (historically, @code{gpgme_check_version} +does not return a detailed error code). @end deftypefun @@ -874,12 +880,12 @@ if (gpgme_err_code (err) == GPG_ERR_INV_ if (!info) fprintf (stderr, "GPGME compiled without support for protocol %s", gpgme_get_protocol_name (info->protocol)); - else if (info->path && !info->version) + else if (info->file_name && !info->version) fprintf (stderr, "Engine %s not installed properly", - info->path); - else if (info->path && info->version && info->req_version) + info->file_name); + else if (info->file_name && info->version && info->req_version) fprintf (stderr, "Engine %s version %s installed, " - "but at least version %s required", info->path, + "but at least version %s required", info->file_name, info->version, info->req_version); else fprintf (stderr, "Unknown problem with engine for protocol %s", @@ -1928,6 +1934,19 @@ scheme as used by @acronym{MIME} and oth @item GPGME_DATA_ENCODING_ARMOR This specifies that the data is encoded in an armored form as used by OpenPGP and PEM. + +@item GPGME_DATA_ENCODING_URL +The data is a list of linefeed delimited URLs. This is only useful with +@code{gpgme_op_import}. + +@item GPGME_DATA_ENCODING_URL0 +The data is a list of binary zero delimited URLs. This is only useful +with @code{gpgme_op_import}. + +@item GPGME_DATA_ENCODING_URLESC +The data is a list of linefeed delimited URLs with all control and space +characters percent escaped. This mode is is not yet implemented. + @end table @end deftp @@ -1966,6 +1985,7 @@ cryptographic operations. @menu * Creating Contexts:: Creating new @acronym{GPGME} contexts. * Destroying Contexts:: Releasing @acronym{GPGME} contexts. +* Result Management:: Managing the result of crypto operations. * Context Attributes:: Setting properties of a context. * Key Management:: Managing keys with @acronym{GPGME}. * Trust Item Management:: Managing trust items with @acronym{GPGME}. @@ -1985,7 +2005,11 @@ and returns a handle for it in @var{ctx} The function returns the error code @code{GPG_ERR_NO_ERROR} if the context was successfully created, @code{GPG_ERR_INV_VALUE} if @var{ctx} is not a valid pointer, and @code{GPG_ERR_ENOMEM} if not -enough memory is available. +enough memory is available. Also, it returns +@code{GPG_ERR_NOT_OPERATIONAL} if @code{gpgme_check_version} was not +called to initialize GPGME, and @code{GPG_ERR_SELFTEST_FAILED} if a +selftest failed. Currently, the only selftest is for Windows MingW32 +targets to see if @code{-mms-bitfields} was used (as required). @end deftypefun @@ -1999,6 +2023,38 @@ The function @code{gpgme_release} destro @end deftypefun +@node Result Management +@section Result Management +@cindex context, result of operation + +The detailed result of an operation is returned in operation-specific +structures such as @code{gpgme_decrypt_result_t}. The corresponding +retrieval functions such as @code{gpgme_op_decrypt_result} provide +static access to the results after an operation completes. The +following interfaces make it possible to detach a result structure +from its associated context and give it a lifetime beyond that of the +current operation or context. + +@deftypefun void gpgme_result_ref (@w{void *@var{result}}) +The function @code{gpgme_result_ref} acquires an additional reference +for the result @var{result}, which may be of any type +@code{gpgme_*_result_t}. As long as the user holds a reference, the +result structure is guaranteed to be valid and unmodified. +@end deftypefun + +@deftypefun void gpgme_result_unref (@w{void *@var{result}}) +The function @code{gpgme_result_unref} releases a reference for the +result @var{result}. If this was the last reference, the result +structure will be destroyed and all resources associated to it will be +released. +@end deftypefun + +Note that a context may hold its own references to result structures, +typically until the context is destroyed or the next operation is +started. In fact, these references are accessed through the +@code{gpgme_op_*_result} functions. + + @node Context Attributes @section Context Attributes @cindex context, attributes @@ -2208,6 +2264,10 @@ signature notations on key signatures sh keys. This only works if @code{GPGME_KEYLIST_MODE_SIGS} is also enabled. +@item GPGME_KEYLIST_MODE_EPHEMERAL +The @code{GPGME_KEYLIST_MODE_EPHEMERAL} symbol specifies that keys +flagged as ephemeral are included in the listing. + @item GPGME_KEYLIST_MODE_VALIDATE The @code{GPGME_KEYLIST_MODE_VALIDATE} symbol specifies that the backend should do key or certificate validation and not just get the @@ -3305,7 +3365,25 @@ operation is started on the context. @cindex key, export @cindex key ring, export from -@deftypefun gpgme_error_t gpgme_op_export (@w{gpgme_ctx_t @var{ctx}}, @w{const char *@var{pattern}}, @w{unsigned int @var{reserved}}, @w{gpgme_data_t @var{keydata}}) +Exporting keys means the same as running @command{gpg} with the command +@option{--export}. However, a mode flag can be used to change the way +the export works. The available mode flags are described below, they +may be or-ed together. + +@table @code + +@item GPGME_EXPORT_MODE_EXTERN +If this bit is set, the output is send directly to the default +keyserver. This is currently only allowed for OpenPGP keys. It is good +practise to not send more than a few dozens key to a keyserver at one +time. Using this flag requires that the @var{keydata} argument of the +export function is set to @code{NULL}. + +@end table + + + +@deftypefun gpgme_error_t gpgme_op_export (@w{gpgme_ctx_t @var{ctx}}, @w{const char *@var{pattern}}, @w{gpgme_export_mode_t @var{mode}}, @w{gpgme_data_t @var{keydata}}) The function @code{gpgme_op_export} extracts public keys and returns them in the data buffer @var{keydata}. The output format of the key data returned is determined by the @acronym{ASCII} armor attribute set @@ -3316,7 +3394,7 @@ If @var{pattern} is @code{NULL}, all ava Otherwise, @var{pattern} contains an engine specific expression that is used to limit the list to all keys matching the pattern. -@var{reserved} is reserved for future use and must be @code{0}. +@var{mode} is usually 0; other values are described above. The function returns the error code @code{GPG_ERR_NO_ERROR} if the operation completed successfully, @code{GPG_ERR_INV_VALUE} if @@ -3324,7 +3402,7 @@ operation completed successfully, @code{ errors that are reported by the crypto engine support routines. @end deftypefun -@deftypefun gpgme_error_t gpgme_op_export_start (@w{gpgme_ctx_t @var{ctx}}, @w{const char *@var{pattern}}, @w{unsigned int @var{reserved}}, @w{gpgme_data_t @var{keydata}}) +@deftypefun gpgme_error_t gpgme_op_export_start (@w{gpgme_ctx_t @var{ctx}}, @w{const char *@var{pattern}}, @w{gpgme_export_mode_t @var{mode}}, @w{gpgme_data_t @var{keydata}}) The function @code{gpgme_op_export_start} initiates a @code{gpgme_op_export} operation. It can be completed by calling @code{gpgme_wait} on the context. @xref{Waiting For Completion}. @@ -3334,7 +3412,7 @@ operation could be started successfully, if @var{keydata} is not a valid empty data buffer. @end deftypefun -@deftypefun gpgme_error_t gpgme_op_export_ext (@w{gpgme_ctx_t @var{ctx}}, @w{const char *@var{pattern}[]}, @w{unsigned int @var{reserved}}, @w{gpgme_data_t @var{keydata}}) +@deftypefun gpgme_error_t gpgme_op_export_ext (@w{gpgme_ctx_t @var{ctx}}, @w{const char *@var{pattern}[]}, @w{gpgme_export_mode_t @var{mode}}, @w{gpgme_data_t @var{keydata}}) The function @code{gpgme_op_export} extracts public keys and returns them in the data buffer @var{keydata}. The output format of the key data returned is determined by the @acronym{ASCII} armor attribute set @@ -3346,7 +3424,7 @@ are returned. Otherwise, @var{pattern} array of strings that are used to limit the list to all keys matching at least one of the patterns verbatim. -@var{reserved} is reserved for future use and must be @code{0}. +@var{mode} is usually 0; other values are described above. The function returns the error code @code{GPG_ERR_NO_ERROR} if the operation completed successfully, @code{GPG_ERR_INV_VALUE} if @@ -3354,7 +3432,7 @@ operation completed successfully, @code{ errors that are reported by the crypto engine support routines. @end deftypefun -@deftypefun gpgme_error_t gpgme_op_export_ext_start (@w{gpgme_ctx_t @var{ctx}}, @w{const char *@var{pattern}[]}, @w{unsigned int @var{reserved}}, @w{gpgme_data_t @var{keydata}}) +@deftypefun gpgme_error_t gpgme_op_export_ext_start (@w{gpgme_ctx_t @var{ctx}}, @w{const char *@var{pattern}[]}, @w{gpgme_export_mode_t @var{mode}}, @w{gpgme_data_t @var{keydata}}) The function @code{gpgme_op_export_ext_start} initiates a @code{gpgme_op_export_ext} operation. It can be completed by calling @code{gpgme_wait} on the context. @xref{Waiting For Completion}. @@ -3365,11 +3443,50 @@ if @var{keydata} is not a valid empty da @end deftypefun +@deftypefun gpgme_error_t gpgme_op_export_keys (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_key_t keys[]}, @w{gpgme_export_mode_t @var{mode}}, @w{gpgme_data_t @var{keydata}}) +The function @code{gpgme_op_export_keys} extracts public keys and returns +them in the data buffer @var{keydata}. The output format of the key +data returned is determined by the @acronym{ASCII} armor attribute set +for the context @var{ctx}, or, if that is not set, by the encoding +specified for @var{keydata}. + +The keys to export are taken form the @code{NULL} terminated array +@var{keys}. Only keys of the the currently selected protocol of +@var{ctx} which do have a fingerprint set are considered for export. +Other keys specified by the @var{keys} are ignored. In particular +OpenPGP keys retrieved via an external key listing are not included. + +@var{mode} is usually 0; other values are described above. + +The function returns the error code @code{GPG_ERR_NO_ERROR} if the +operation completed successfully, @code{GPG_ERR_INV_VALUE} if +@var{keydata} is not a valid empty data buffer, @code{GPG_ERR_NO_DATA} +if no useful keys are in @var{keys} and passes through any errors that +are reported by the crypto engine support routines. +@end deftypefun + +@deftypefun gpgme_error_t gpgme_op_export_keys_start (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_key_t @var{keys}[]}, @w{gpgme_export_mode_t @var{mode}}, @w{gpgme_data_t @var{keydata}}) +The function @code{gpgme_op_export_keys_start} initiates a +@code{gpgme_op_export_ext} operation. It can be completed by calling +@code{gpgme_wait} on the context. @xref{Waiting For Completion}. + +The function returns the error code @code{GPG_ERR_NO_ERROR} if the +operation could be started successfully, and @code{GPG_ERR_INV_VALUE} +if @var{keydata} is not a valid empty data buffer, @code{GPG_ERR_NO_DATA} +if no useful keys are in @var{keys} and passes through any errors that +are reported by the crypto engine support routines. +@end deftypefun + + @node Importing Keys @subsection Importing Keys @cindex key, import @cindex key ring, import to +Importing keys means the same as running @command{gpg} with the command +@option{--import}. + + @deftypefun gpgme_error_t gpgme_op_import (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_data_t @var{keydata}}) The function @code{gpgme_op_import} adds the keys in the data buffer @var{keydata} to the key ring of the crypto engine used by @var{ctx}. @@ -3396,6 +3513,44 @@ import could be started successfully, @c and @code{GPG_ERR_NO_DATA} if @var{keydata} is an empty data buffer. @end deftypefun +@deftypefun gpgme_error_t gpgme_op_import_keys (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_key_t *@var{keys}}) +The function @code{gpgme_op_import_keys} adds the keys described by the +@code{NULL} terminated array @var{keys} to the key ring of the crypto +engine used by @var{ctx}. This function is the general interface to +move a key from one crypto engine to another as long as they are +compatible. In particular it is used to actually import and make keys +permanent which have been retrieved from an external source (i.e. using +@code{GPGME_KEYLIST_MODE_EXTERN}). @footnote{Thus it is a replacement +for the usual workaround of exporting and then importing a key to make +an X.509 key permanent.} + +Only keys of the the currently selected protocol of @var{ctx} are +considered for import. Other keys specified by the @var{keys} are +ignored. As of now all considered keys must have been retrieved using +the same method, that is the used key listing mode must be identical. + +After the operation completed successfully, the result can be +retrieved with @code{gpgme_op_import_result}. + +The function returns the error code @code{GPG_ERR_NO_ERROR} if the +import was completed successfully, @code{GPG_ERR_INV_VALUE} if +@var{keydata} if @var{ctx} or @var{keydata} is not a valid pointer, +@code{GPG_ERR_CONFLICT} if the key listing mode does not match, and +@code{GPG_ERR_NO_DATA} if no keys are considered for export. +@end deftypefun + +@deftypefun gpgme_error_t gpgme_op_import_keys_start (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_key_t *@var{keys}}) +The function @code{gpgme_op_import_keys_start} initiates a +@code{gpgme_op_import_keys} operation. It can be completed by calling +@code{gpgme_wait} on the context. @xref{Waiting For Completion}. + +The function returns the error code @code{GPG_ERR_NO_ERROR} if the +import was completed successfully, @code{GPG_ERR_INV_VALUE} if +@var{keydata} if @var{ctx} or @var{keydata} is not a valid pointer, +@code{GPG_ERR_CONFLICT} if the key listing mode does not match, and +@code{GPG_ERR_NO_DATA} if no keys are considered for export. +@end deftypefun + @deftp {Data type} {gpgme_import_status_t} This is a pointer to a structure used to store a part of the result of a @code{gpgme_op_import} operation. For each considered key one @@ -4719,6 +4874,12 @@ The @code{GPGME_ENCRYPT_ALWAYS_TRUST} sy recipients in @var{recp} should be trusted, even if the keys do not have a high enough validity in the keyring. This flag should be used with care; in general it is not a good idea to use any untrusted keys. + +@item GPGME_ENCRYPT_NO_ENCRYPT_TO +The @code{GPGME_ENCRYPT_NO_ENCRYPT_TO} symbol specifies that no +default or hidden default recipients as configured in the crypto +backend should be included. This can be useful for managing different +user profiles. @end table If @code{GPG_ERR_UNUSABLE_PUBKEY} is returned, some recipients in diff -urpNP gpgme-1.1.8/doc/stamp-vti gpgme-1.2.0/doc/stamp-vti --- gpgme-1.1.8/doc/stamp-vti 2008-12-08 18:42:07.000000000 +0000 +++ gpgme-1.2.0/doc/stamp-vti 2009-06-18 16:15:22.000000000 +0000 @@ -1,4 +1,4 @@ -@set UPDATED 8 December 2008 -@set UPDATED-MONTH December 2008 -@set EDITION 1.1.8 -@set VERSION 1.1.8 +@set UPDATED 17 June 2009 +@set UPDATED-MONTH June 2009 +@set EDITION 1.2.0 +@set VERSION 1.2.0 diff -urpNP gpgme-1.1.8/doc/version.texi gpgme-1.2.0/doc/version.texi --- gpgme-1.1.8/doc/version.texi 2008-12-08 18:42:07.000000000 +0000 +++ gpgme-1.2.0/doc/version.texi 2009-06-18 16:15:22.000000000 +0000 @@ -1,4 +1,4 @@ -@set UPDATED 8 December 2008 -@set UPDATED-MONTH December 2008 -@set EDITION 1.1.8 -@set VERSION 1.1.8 +@set UPDATED 17 June 2009 +@set UPDATED-MONTH June 2009 +@set EDITION 1.2.0 +@set VERSION 1.2.0 diff -urpNP gpgme-1.1.8/gpgme.spec gpgme-1.2.0/gpgme.spec --- gpgme-1.1.8/gpgme.spec 2008-12-08 18:42:07.000000000 +0000 +++ gpgme-1.2.0/gpgme.spec 2009-06-18 16:15:35.000000000 +0000 @@ -1,7 +1,7 @@ # This is a template. The dist target uses it to create the real file. Summary: GPGME - GnuPG Made Easy Name: gpgme -Version: 1.1.8 +Version: 1.2.0 Release: 1 URL: http://www.gnupg.org/gpgme.html Source: ftp://ftp.gnupg.org/gcrypt/alpha/gpgme/%{name}-%{version}.tar.gz diff -urpNP gpgme-1.1.8/lang/Makefile.in gpgme-1.2.0/lang/Makefile.in --- gpgme-1.1.8/lang/Makefile.in 2008-12-08 18:41:52.000000000 +0000 +++ gpgme-1.2.0/lang/Makefile.in 2009-06-18 16:13:40.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -143,6 +143,7 @@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ +NEED__FILE_OFFSET_BITS = @NEED__FILE_OFFSET_BITS@ NETLIBS = @NETLIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -215,6 +216,7 @@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = cl @@ -226,8 +228,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_ @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -333,7 +335,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS diff -urpNP gpgme-1.1.8/lang/cl/Makefile.in gpgme-1.2.0/lang/cl/Makefile.in --- gpgme-1.1.8/lang/cl/Makefile.in 2008-12-08 18:41:52.000000000 +0000 +++ gpgme-1.2.0/lang/cl/Makefile.in 2009-06-18 16:13:40.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -143,6 +143,7 @@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ +NEED__FILE_OFFSET_BITS = @NEED__FILE_OFFSET_BITS@ NETLIBS = @NETLIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -215,6 +216,7 @@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ clfiles = gpgme.asd gpgme-package.lisp gpgme.lisp @@ -230,8 +232,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_ @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ diff -urpNP gpgme-1.1.8/lang/cl/gpgme.asd gpgme-1.2.0/lang/cl/gpgme.asd --- gpgme-1.1.8/lang/cl/gpgme.asd 2008-12-08 18:42:02.000000000 +0000 +++ gpgme-1.2.0/lang/cl/gpgme.asd 2009-06-18 16:14:50.000000000 +0000 @@ -27,7 +27,7 @@ (defsystem gpgme :description "GnuPG Made Easy." :author "g10 Code GmbH" - :version "1.1.8" + :version "1.2.0" :licence "GPL" :depends-on ("cffi" "gpg-error") :components ((:file "gpgme-package") diff -urpNP gpgme-1.1.8/src/ChangeLog gpgme-1.2.0/src/ChangeLog --- gpgme-1.1.8/src/ChangeLog 2008-12-03 13:37:09.000000000 +0000 +++ gpgme-1.2.0/src/ChangeLog 2009-06-18 16:09:23.000000000 +0000 @@ -1,3 +1,253 @@ +2009-06-18 Marcus Brinkmann + + * gpgme.h.in (GPGME_CONF_PATHNAME): Revert last change, it's + back! (GPA still uses it...). + + * gpgme.def: Fix stupid typo. + * w32-io.c (_gpgme_io_pipe): Add missing declaration. + + * gpgme.h.in (GPGME_CONF_PATHNAME): Remove obsolete macro. + + * w32-io.c (_gpgme_io_pipe): Allocate reader/writer thread right + away. + (_gpgme_io_read, _gpgme_io_write, _gpgme_io_select) + (_gpgme_io_dup): Never allocate threads here. + (find_writer, find_reader): Check return value of thread creation + function. + + * context.h (CTX_OP_DATA_MAGIC): New macro. + (struct ctx_op_data): New member MAGIC. + * op-support.c (_gpgme_op_data_lookup): Initialize magic. + * gpgme.c (gpgme_result_unref, gpgme_result_ref): Check magic. + +2009-06-16 Marcus Brinkmann + + * gpgme.c (gpgme_result_unref): Hot fix to release a lock. + + * gpgme.c (result_ref_lock): New global variable. + (gpgme_result_ref, gpgme_result_unref): use it. + +2009-06-16 Werner Koch + + * version.c: Include stdlib.h. + + * gpgme.h.in (gpgme_data_encoding_t): Add GPGME_DATA_ENCODING_URL, + GPGME_DATA_ENCODING_URLESC, GPGME_DATA_ENCODING_URL0. + * data.c (gpgme_data_set_encoding): Adjust for new values. + * engine-gpg.c (string_from_data): New. + (gpg_import): Implement --fetch-key feature. + + * gpgme.h.in (gpgme_op_export_keys_start, gpgme_op_export_keys): New. + * gpgme.def, libgpgme.vers: Add them. + * export.c (gpgme_op_export_keys_start, gpgme_op_export_keys): New. + (export_keys_start): New. + + * gpgme.h.in (gpgme_export_mode_t, GPGME_EXPORT_MODE_EXTERN): New. + (gpgme_op_export_start, gpgme_op_export, gpgme_op_export_ext_start) + (gpgme_op_export_ext): Change arg RESERVED to MODE of new + compatible type. + * export.c (gpgme_export_ext_start, gpgme_op_export) + (gpgme_op_export_ext_start, gpgme_op_export_ext): Ditto. + (export_start): Ditto. + * engine.c (_gpgme_engine_op_export): Ditto. + * engine-backend.h (struct engine_ops): Ditto. + * engine-gpgsm.c (gpgsm_export, gpgsm_export_ext): Ditto. + * engine-gpg.c (gpg_export, gpg_export_ext): Ditto. Implement + mode EXTERN. + (gpg_export, gpg_export_ext): Factor common code out to .. + (export_common): .. this. + + * gpgme.h.in (gpgme_op_import_keys_start, gpgme_op_import_keys): New. + * gpgme.def, libgpgme.vers: Add them. + * import.c (gpgme_op_import_keys_start, gpgme_op_import_keys): New. + (_gpgme_op_import_keys_start): New. + * engine.c (_gpgme_engine_op_import): Add arg KEYARRAY. + * engine-backend.h (struct engine_ops): Ditto. + * engine-gpgsm.c (gpgsm_import): Ditto. Not functional. + * engine-gpg.c (gpg_import): Ditto. Implement it. + +2009-06-15 Marcus Brinkmann + + * gpgme.h.in (gpgme_result_ref, gpgme_result_unref): Add + prototypes. + * gpgme.def, libgpgme.vers (gpgme_result_ref, gpgme_result_unref): + Add these. + * context.h (struct ctx_op_data): Add member "references". + * gpgme.c (gpgme_result_ref, gpgme_result_unref): New functions. + (_gpgme_release_result): Use gpgme_result_unref. + * op-support.c (_gpgme_op_data_lookup): Initialize references. + +2009-06-12 Werner Koch + + * gpgme-w32spawn.c (translate_get_from_file): Parse optional spawn + flags. Add new arg R_FLAGS. Fix segv on file w/o LF. + (translate_handles): Add new arg R_FLAGS. Avoid possible segv. + (main): Pass flags for my_spawn. + (my_spawn): Add arg FLAGS and implement AllowSetForegroundWindow. + + * priv-io.h (IOSPAWN_FLAG_ALLOW_SET_FG): New. + * w32-io.c (_gpgme_io_spawn): Add arg FLAGS and implement it. + * w32-glib-io.c (_gpgme_io_spawn): Ditto. + * w32-qt-io.cpp (_gpgme_io_spawn): Ditto. + * posix-io.c (_gpgme_io_spawn): Add dummy arg FLAGS. + * engine-gpg.c (start): Call spawn with new flag. + + * w32-util.c (_gpgme_allow_set_foregound_window): Rename to + _gpgme_allow_set_foreground_window. Change all callers. + * posix-util.c (_gpgme_allow_set_foreground_window): Ditto. + +2009-06-10 Werner Koch + + * w32-util.c (_gpgme_allow_set_foregound_window): Add trace support. + +2009-06-09 Werner Koch + + * engine-gpg.c (gpg_io_event): Test for cmd.fd. + + * version.c (gpgme_check_version_internal): Make result const. + + * gpgme.c: Include priv-io.h. + (gpgme_io_read, gpgme_io_write): New. + * libgpgme.vers (GPGME_1.1): Add them. + * gpgme.def: Ditto. + + * Makefile.am (main_sources): Remove gpgme.h. + (include_HEADERS): Rename to nodist_include_HEADERS so that a + VPATH build won't use the distributed one. + + * util.h (GPG_ERR_NOT_OPERATIONAL): Define. + +2009-05-28 Marcus Brinkmann + + * gpgme.h.in (gpgme_check_version_internal): New prototype. + (gpgme_check_version): New macro, overriding function of the same + name. + * libgpgme.vers, gpgme.def: Add gpgme_check_version_internal.o + * context.h (_gpgme_selftest): New variable declaration. + * version.c: Include "context.h". + (gpgme_check_version): Set _gpgme_selftest on success. + (gpgme_check_version_internal): New function. + * gpgme.c (_gpgme_selftest): Define it. + (gpgme_new): Check the selftest result. + +2009-05-18 Marcus Brinkmann + + * gpgme.h.in (gpgme_encrypt_flags_t): Add + GPGME_ENCRYPT_NO_ENCRYPT_TO. + * engine-gpg.c (gpg_encrypt): Pass --no-encrypt-to to gpg if + GPGME_ENCRYPT_NO_ENCRYPT_TO flag is set. + +2009-05-14 Werner Koch + + * gpgme.h.in (gpgme_status_code_t): Explicitly initialize for + better maintainability and to help debugging. + +2009-05-05 Marcus Brinkmann + + * gpgme.h.in: Add compile time check for _FILE_OFFSET_BITS. + +2009-04-15 Marcus Brinkmann + + * posix-io.c (_gpgme_io_socket, _gpgme_io_connect): New functions. + * w32-io.c (_gpgme_io_connect): Fix stupid error. + +2009-04-08 Marcus Brinkmann + + * w32-glib-io.c (giochannel_table): New members used, fd, socket. + (find_channel): Drop CREATE argument. + (new_dummy_channel_from_fd, new_channel_from_fd) + (new_channel_from_socket): New functions. + (_gpgm_io_fd2str): Implement for sockets. + (_gpgme_io_write, _gpgme_io_read): Translate EAGAIN errors + correctly. + (_gpgme_io_pipe): Fix for new channel bookkeeping. + (_gpgme_io_close, _gpgme_io_dup): Likewise. + (wsa2errno, _gpgme_io_socket, _gpgme_io_connect): New. + * w32-io.c (MAX_READERS, MAX_WRITERS): Bump up to 40. + (wsa2errno, _gpgme_io_socket, _gpgme_io_connect): New. + * w32-qt-io.cpp (_gpgme_io_socket, _gpgme_io_connect): New stubs. + * version.c [HAVE_W32_SYSTEM]: Include "windows.h. + (do_subsystem_inits) [HAVE_W32_SYSTEM]: Call WSAStartup. + * engine-assuan.c (llass_status_handler): Ignore EAGAIN errors. + +2009-03-18 Werner Koch + + * gpgme.h.in (GPGME_KEYLIST_MODE_EPHEMERAL): New. + * engine-gpgsm.c (gpgsm_keylist): Send new option. + +2009-03-13 Werner Koch + + * gpgme-config.in: Make sure locale is set to C. + +2009-02-24 Werner Koch + + * gpgme.h.in (struct _gpgme_op_assuan_result): New. + (gpgme_assuan_result_t): New. + (gpgme_op_assuan_result): Change return type. + (struct _gpgme_assuan_sendfnc_ctx) + (gpgme_assuan_sendfnc_ctx_t, gpgme_assuan_sendfnc_t):Remove. + (gpgme_assuan_inquire_cb_t): Changed. + * opassuan.c (op_data_t): Make use of a result structure. + (gpgme_op_assuan_result): Change return type. + (opassuan_start): Use result structure. + (result_cb): Ditto. + * engine-assuan.c (struct _gpgme_assuan_sendfnc_ctx): Remove. + (inquire_cb_sendfnc): Remove. + (inquire_cb): Change for new callback scheme. Not yet finished. + (llass_status_handler): Allow sending a CANCEL from the inquire CB. + +2009-02-04 Werner Koch + + * w32-glib-io.c (_gpgme_io_spawn): Make ARGV argument const to + match prototype. + * w32-qt-io.cpp (_gpgme_io_spawn): Ditto. + +2009-02-03 Werner Koch + + * gpgme.h.in (struct _gpgme_subkey): Add fields IS_CARDKEY and + CARD_NUMBER.. + * key.c (gpgme_key_unref): Release field CARD_NUMBER. + * keylist.c (keylist_colon_handler): Factor common code out to ... + (parse_sec_field15): New. Set card number. + +2009-01-26 Werner Koch + + * opassuan.c, dirinfo.c, engine-assuan.c: New. + * Makefile.am: Add them. + * engine-backend.h: Add _gpgme_engine_ops_assuan. + (struct engine_ops): Add field OPASSUAN_TRANSACT. Update all + engine intializers. + * Makefile.am (gpgsm_components): Add engine-assuan.c. + * gpgme.h.in (gpgme_protocol_t): Add GPGME_PROTOCOL_ASSUAN. + (gpgme_assuan_data_cb_t, gpgme_assuan_sendfnc_ctx_t) + (gpgme_assuan_inquire_cb_t, gpgme_assuan_status_cb_t): New. + (gpgme_op_assuan_transact_start, gpgme_op_assuan_transact): New. + * gpgme.c (gpgme_get_protocol_name): Ditto. + (gpgme_set_protocol): Support it. + * engine.c (gpgme_get_engine_info): Ditto. + (engine_ops): Register it. + (_gpgme_engine_op_assuan_transact): New. + * libgpgme.vers (gpgme_op_assuan_transact_start) + (gpgme_op_assuan_transact): New. + * gpgme.def (gpgme_op_assuan_transact_start) + (gpgme_op_assuan_transact): New. + * engine-backend.h (struct engine_ops): Add GET_HOME_DIR and + initialize to NULL for all engines. + * engine.c (engine_get_home_dir): New. + (gpgme_get_engine_info): Use it. + (_gpgme_set_engine_info): Use it. + * engine.h (engine_assuan_result_cb_t): New. + * context.h (ctx_op_data_id_t): Add OPDATA_ASSUAN. + + * util.h (GPG_ERR_UNFINISHED): Define if not yet defined. + + * version.c (gpgme_check_version): Protect trace arg against NULL. + +2009-01-19 Werner Koch + + * rungpg.c: Rename to engine-gpg.c + * Makefile.am (main_sources): Ditto. + 2008-12-03 Marcus Brinkmann * Makefile.am (status-table.h): Use $(builddir) to find gpgme.h. @@ -798,7 +1048,7 @@ * engine.c (gpgme_engine_check_version): Reimplemented to allow checking the version correctly even after changing the engine - information. Bug reported by Stéphane Corthésy. + information. Bug reported by Stéphane Corthésy. * rungpg.c (read_colon_line): Invoke colon preprocess handler if it is set. @@ -863,7 +1113,7 @@ 2005-11-27 Marcus Brinkmann * engine.c (_gpgme_set_engine_info): Use new_file_name in - engine_get_version invocation. Reported by Stéphane Corthésy. + engine_get_version invocation. Reported by Stéphane Corthésy. 2005-11-24 Marcus Brinkmann @@ -1813,7 +2063,7 @@ * gpgme-config.in (gpg_error_libs): Quote GPG_ERROR_CFLAGS and GPG_ERROR_LIBS when setting the corresponding variables. - Reported by Stéphane Corthésy. + Reported by Stéphane Corthésy. 2003-07-22 Marcus Brinkmann @@ -3702,7 +3952,7 @@ 2002-09-28 Marcus Brinkmann * conversion.c (_gpgme_hextobyte): Prevent superfluous - multiplication with base. Reported by Stéphane Corthésy. + multiplication with base. Reported by Stéphane Corthésy. * keylist.c (gpgme_op_keylist_ext_start): Use private asynchronous operation type in invocation of _gpgme_op_reset. @@ -3815,7 +4065,7 @@ variables encrypt_info and encrypt_info_len. * trustlist.c (gpgme_op_trustlist_start): Set colon line handler. * posix-sema.c (sema_fatal): Remove function. - All these reported by Stéphane Corthésy. + All these reported by Stéphane Corthésy. 2002-08-23 Werner Koch @@ -3988,7 +4238,7 @@ * vasprintf.c: Update to more recent libiberty version. * debug.h: Replace #elsif with #elif. - Submitted by Stéphane Corthésy: + Submitted by Stéphane Corthésy: * util.h (vasprintf): Correct prototype. * encrypt-sign.c: Include . (encrypt_sign_status_handler): Change type of ENCRYPT_INFO_LEN to @@ -3998,14 +4248,14 @@ 2002-07-25 Marcus Brinkmann - * wait.c (fdt_global): Make static. Reported by Stéphane - Corthésy. + * wait.c (fdt_global): Make static. Reported by Stéphane + Corthésy. * rungpg.c (_gpgme_gpg_op_keylist_ext): Skip empty string - patterns. Reported by Stéphane Corthésy. + patterns. Reported by Stéphane Corthésy. * key.c (gpgme_key_get_as_xml): Add OTRUST attribute. Requested - by Stéphane Corthésy. + by Stéphane Corthésy. (gpgme_key_get_string_attr): Add GPGME_ATTR_SIG_SUMMARY case to silence gcc warning. @@ -5055,7 +5305,7 @@ 2001-12-19 Marcus Brinkmann - * engine.c: Include `string.h'. Reported by Stéphane Corthésy. + * engine.c: Include `string.h'. Reported by Stéphane Corthésy. * version.c (get_engine_info): Remove prototype. @@ -5592,7 +5842,7 @@ callers to use this function without a check for tmp_key. * keylist.c (gpgme_op_keylist_next): Reset the key_cond after - emptying the queue. Bug reported by Stéphane Corthésy. + emptying the queue. Bug reported by Stéphane Corthésy. 2001-09-12 Werner Koch @@ -5674,7 +5924,7 @@ * version.c (gpgme_check_engine): Stop version number parsing at the opening angle and not the closing one. By Tommy Reynolds. -2001-05-01 José Carlos García Sogo +2001-05-01 José Carlos García Sogo * encrypt.c (gpgme_op_encrypt_start): Deleted the assert ( !c->gpg ) line, because it gave an error if another operation had been made @@ -5860,8 +6110,8 @@ * rungpg.c (_gpgme_gpg_spawn): Use new function to get GPG's path. * signers.c (gpgme_signers_add): Ooops, one should test code and - not just write it; the newarr was not assigned. Thanks to José - for pointing this out. Hmmm, still not tested, why shoudl a coder + not just write it; the newarr was not assigned. Thanks to José + for pointing this out. Hmmm, still not tested, why should a coder test his fix :-) * w32-io.c: Does now use reader threads, so that we can use @@ -5893,7 +6143,7 @@ * data.c (gpgme_data_rewind): Allow to rewind data_type_none. - Copyright 2001,2002,2003,2004,2005,2006,2007 g10 Code GmbH + Copyright 2001,2002,2003,2004,2005,2006,2007,2008,2009 g10 Code GmbH This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff -urpNP gpgme-1.1.8/src/Makefile.am gpgme-1.2.0/src/Makefile.am --- gpgme-1.1.8/src/Makefile.am 2008-12-03 13:36:07.000000000 +0000 +++ gpgme-1.2.0/src/Makefile.am 2009-06-15 11:59:37.000000000 +0000 @@ -14,8 +14,7 @@ # Public License for more details. # # You should have received a copy of the GNU Lesser General Public -# License along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA +# License along with this program; if not, see . ## Process this file with automake to produce Makefile.in @@ -27,7 +26,7 @@ MOSTLYCLEANFILES = status-table.h bin_SCRIPTS = gpgme-config m4datadir = $(datadir)/aclocal m4data_DATA = gpgme.m4 -include_HEADERS = gpgme.h +nodist_include_HEADERS = gpgme.h if HAVE_PTHREAD ltlib_gpgme_pthread = libgpgme-pthread.la @@ -78,7 +77,7 @@ system_components_not_extra = endif if HAVE_GPGSM -gpgsm_components = engine-gpgsm.c +gpgsm_components = engine-gpgsm.c engine-assuan.c else gpgsm_components = endif @@ -95,7 +94,7 @@ endif # right linking order with libtool, as the non-installed version has # unresolved symbols to the thread module. main_sources = \ - gpgme.h util.h conversion.c get-env.c context.h ops.h \ + util.h conversion.c get-env.c context.h ops.h \ data.h data.c data-fd.c data-stream.c data-mem.c data-user.c \ data-compat.c \ signers.c sig-notation.c \ @@ -105,9 +104,10 @@ main_sources = \ sign.c passphrase.c progress.c \ key.c keylist.c trust-item.c trustlist.c \ import.c export.c genkey.c delete.c edit.c getauditlog.c \ - engine.h engine-backend.h engine.c rungpg.c status-table.h \ + opassuan.c \ + engine.h engine-backend.h engine.c engine-gpg.c status-table.h \ $(gpgsm_components) $(gpgconf_components) gpgconf.c \ - sema.h priv-io.h $(system_components) \ + sema.h priv-io.h $(system_components) dirinfo.c \ debug.c debug.h gpgme.c version.c error.c libgpgme_la_SOURCES = $(main_sources) \ diff -urpNP gpgme-1.1.8/src/Makefile.in gpgme-1.2.0/src/Makefile.in --- gpgme-1.1.8/src/Makefile.in 2008-12-08 18:41:52.000000000 +0000 +++ gpgme-1.2.0/src/Makefile.in 2009-06-18 16:13:40.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -30,8 +30,7 @@ # Public License for more details. # # You should have received a copy of the GNU Lesser General Public -# License along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA +# License along with this program; if not, see . @@ -57,11 +56,11 @@ build_triplet = @build@ host_triplet = @host@ @HAVE_W32_SYSTEM_TRUE@libexec_PROGRAMS = gpgme-w32spawn$(EXEEXT) subdir = src -DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(srcdir)/gpgme-config.in \ - $(srcdir)/gpgme.h.in $(srcdir)/versioninfo.rc.in ChangeLog \ - funopen.c isascii.c memrchr.c putc_unlocked.c setenv.c \ - stpcpy.c ttyname_r.c vasprintf.c +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/gpgme-config.in $(srcdir)/gpgme.h.in \ + $(srcdir)/versioninfo.rc.in ChangeLog funopen.c isascii.c \ + memrchr.c putc_unlocked.c setenv.c stpcpy.c ttyname_r.c \ + vasprintf.c ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/glib-2.0.m4 \ $(top_srcdir)/m4/glibc21.m4 $(top_srcdir)/m4/gpg-error.m4 \ @@ -84,19 +83,20 @@ am__installdirs = "$(DESTDIR)$(libdir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) @BUILD_ASSUAN_TRUE@am__DEPENDENCIES_1 = ../assuan/libassuan.la -am__libgpgme_glib_la_SOURCES_DIST = gpgme.h util.h conversion.c \ - get-env.c context.h ops.h data.h data.c data-fd.c \ - data-stream.c data-mem.c data-user.c data-compat.c signers.c \ - sig-notation.c wait.c wait-global.c wait-private.c wait-user.c \ - wait.h op-support.c encrypt.c encrypt-sign.c decrypt.c \ +am__libgpgme_glib_la_SOURCES_DIST = util.h conversion.c get-env.c \ + context.h ops.h data.h data.c data-fd.c data-stream.c \ + data-mem.c data-user.c data-compat.c signers.c sig-notation.c \ + wait.c wait-global.c wait-private.c wait-user.c wait.h \ + op-support.c encrypt.c encrypt-sign.c decrypt.c \ decrypt-verify.c verify.c sign.c passphrase.c progress.c key.c \ keylist.c trust-item.c trustlist.c import.c export.c genkey.c \ - delete.c edit.c getauditlog.c engine.h engine-backend.h \ - engine.c rungpg.c status-table.h engine-gpgsm.c \ - engine-gpgconf.c gpgconf.c sema.h priv-io.h ath.h posix-util.c \ - posix-sema.c posix-io.c w32-util.c w32-sema.c debug.c debug.h \ - gpgme.c version.c error.c ath.c w32-glib-io.c -@HAVE_GPGSM_TRUE@am__objects_1 = engine-gpgsm.lo + delete.c edit.c getauditlog.c opassuan.c engine.h \ + engine-backend.h engine.c engine-gpg.c status-table.h \ + engine-gpgsm.c engine-assuan.c engine-gpgconf.c gpgconf.c \ + sema.h priv-io.h ath.h posix-util.c posix-sema.c posix-io.c \ + w32-util.c w32-sema.c dirinfo.c debug.c debug.h gpgme.c \ + version.c error.c ath.c w32-glib-io.c +@HAVE_GPGSM_TRUE@am__objects_1 = engine-gpgsm.lo engine-assuan.lo @HAVE_GPGCONF_TRUE@am__objects_2 = engine-gpgconf.lo @HAVE_DOSISH_SYSTEM_FALSE@am__objects_3 = posix-util.lo posix-sema.lo \ @HAVE_DOSISH_SYSTEM_FALSE@ posix-io.lo @@ -108,9 +108,9 @@ am__objects_4 = conversion.lo get-env.lo encrypt-sign.lo decrypt.lo decrypt-verify.lo verify.lo sign.lo \ passphrase.lo progress.lo key.lo keylist.lo trust-item.lo \ trustlist.lo import.lo export.lo genkey.lo delete.lo edit.lo \ - getauditlog.lo engine.lo rungpg.lo $(am__objects_1) \ - $(am__objects_2) gpgconf.lo $(am__objects_3) debug.lo gpgme.lo \ - version.lo error.lo + getauditlog.lo opassuan.lo engine.lo engine-gpg.lo \ + $(am__objects_1) $(am__objects_2) gpgconf.lo $(am__objects_3) \ + dirinfo.lo debug.lo gpgme.lo version.lo error.lo @BUILD_W32_GLIB_TRUE@am_libgpgme_glib_la_OBJECTS = $(am__objects_4) \ @BUILD_W32_GLIB_TRUE@ ath.lo w32-glib-io.lo libgpgme_glib_la_OBJECTS = $(am_libgpgme_glib_la_OBJECTS) @@ -118,18 +118,19 @@ libgpgme_glib_la_LINK = $(LIBTOOL) --tag $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libgpgme_glib_la_LDFLAGS) $(LDFLAGS) -o $@ @BUILD_W32_GLIB_TRUE@am_libgpgme_glib_la_rpath = -rpath $(libdir) -am__libgpgme_pth_la_SOURCES_DIST = gpgme.h util.h conversion.c \ - get-env.c context.h ops.h data.h data.c data-fd.c \ - data-stream.c data-mem.c data-user.c data-compat.c signers.c \ - sig-notation.c wait.c wait-global.c wait-private.c wait-user.c \ - wait.h op-support.c encrypt.c encrypt-sign.c decrypt.c \ +am__libgpgme_pth_la_SOURCES_DIST = util.h conversion.c get-env.c \ + context.h ops.h data.h data.c data-fd.c data-stream.c \ + data-mem.c data-user.c data-compat.c signers.c sig-notation.c \ + wait.c wait-global.c wait-private.c wait-user.c wait.h \ + op-support.c encrypt.c encrypt-sign.c decrypt.c \ decrypt-verify.c verify.c sign.c passphrase.c progress.c key.c \ keylist.c trust-item.c trustlist.c import.c export.c genkey.c \ - delete.c edit.c getauditlog.c engine.h engine-backend.h \ - engine.c rungpg.c status-table.h engine-gpgsm.c \ - engine-gpgconf.c gpgconf.c sema.h priv-io.h ath.h posix-util.c \ - posix-sema.c posix-io.c w32-util.c w32-sema.c debug.c debug.h \ - gpgme.c version.c error.c ath-pth.c w32-io.c + delete.c edit.c getauditlog.c opassuan.c engine.h \ + engine-backend.h engine.c engine-gpg.c status-table.h \ + engine-gpgsm.c engine-assuan.c engine-gpgconf.c gpgconf.c \ + sema.h priv-io.h ath.h posix-util.c posix-sema.c posix-io.c \ + w32-util.c w32-sema.c dirinfo.c debug.c debug.h gpgme.c \ + version.c error.c ath-pth.c w32-io.c @HAVE_DOSISH_SYSTEM_TRUE@am__objects_5 = w32-io.lo am_libgpgme_pth_la_OBJECTS = $(am__objects_4) ath-pth.lo \ $(am__objects_5) @@ -138,18 +139,19 @@ libgpgme_pth_la_LINK = $(LIBTOOL) --tag= $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libgpgme_pth_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_PTH_TRUE@am_libgpgme_pth_la_rpath = -rpath $(libdir) -am__libgpgme_pthread_la_SOURCES_DIST = gpgme.h util.h conversion.c \ - get-env.c context.h ops.h data.h data.c data-fd.c \ - data-stream.c data-mem.c data-user.c data-compat.c signers.c \ - sig-notation.c wait.c wait-global.c wait-private.c wait-user.c \ - wait.h op-support.c encrypt.c encrypt-sign.c decrypt.c \ +am__libgpgme_pthread_la_SOURCES_DIST = util.h conversion.c get-env.c \ + context.h ops.h data.h data.c data-fd.c data-stream.c \ + data-mem.c data-user.c data-compat.c signers.c sig-notation.c \ + wait.c wait-global.c wait-private.c wait-user.c wait.h \ + op-support.c encrypt.c encrypt-sign.c decrypt.c \ decrypt-verify.c verify.c sign.c passphrase.c progress.c key.c \ keylist.c trust-item.c trustlist.c import.c export.c genkey.c \ - delete.c edit.c getauditlog.c engine.h engine-backend.h \ - engine.c rungpg.c status-table.h engine-gpgsm.c \ - engine-gpgconf.c gpgconf.c sema.h priv-io.h ath.h posix-util.c \ - posix-sema.c posix-io.c w32-util.c w32-sema.c debug.c debug.h \ - gpgme.c version.c error.c ath-pthread.c w32-io.c + delete.c edit.c getauditlog.c opassuan.c engine.h \ + engine-backend.h engine.c engine-gpg.c status-table.h \ + engine-gpgsm.c engine-assuan.c engine-gpgconf.c gpgconf.c \ + sema.h priv-io.h ath.h posix-util.c posix-sema.c posix-io.c \ + w32-util.c w32-sema.c dirinfo.c debug.c debug.h gpgme.c \ + version.c error.c ath-pthread.c w32-io.c am_libgpgme_pthread_la_OBJECTS = $(am__objects_4) ath-pthread.lo \ $(am__objects_5) libgpgme_pthread_la_OBJECTS = $(am_libgpgme_pthread_la_OBJECTS) @@ -157,18 +159,19 @@ libgpgme_pthread_la_LINK = $(LIBTOOL) -- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libgpgme_pthread_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_PTHREAD_TRUE@am_libgpgme_pthread_la_rpath = -rpath $(libdir) -am__libgpgme_qt_la_SOURCES_DIST = gpgme.h util.h conversion.c \ - get-env.c context.h ops.h data.h data.c data-fd.c \ - data-stream.c data-mem.c data-user.c data-compat.c signers.c \ - sig-notation.c wait.c wait-global.c wait-private.c wait-user.c \ - wait.h op-support.c encrypt.c encrypt-sign.c decrypt.c \ +am__libgpgme_qt_la_SOURCES_DIST = util.h conversion.c get-env.c \ + context.h ops.h data.h data.c data-fd.c data-stream.c \ + data-mem.c data-user.c data-compat.c signers.c sig-notation.c \ + wait.c wait-global.c wait-private.c wait-user.c wait.h \ + op-support.c encrypt.c encrypt-sign.c decrypt.c \ decrypt-verify.c verify.c sign.c passphrase.c progress.c key.c \ keylist.c trust-item.c trustlist.c import.c export.c genkey.c \ - delete.c edit.c getauditlog.c engine.h engine-backend.h \ - engine.c rungpg.c status-table.h engine-gpgsm.c \ - engine-gpgconf.c gpgconf.c sema.h priv-io.h ath.h posix-util.c \ - posix-sema.c posix-io.c w32-util.c w32-sema.c debug.c debug.h \ - gpgme.c version.c error.c ath.c w32-qt-io.cpp kdpipeiodevice.h \ + delete.c edit.c getauditlog.c opassuan.c engine.h \ + engine-backend.h engine.c engine-gpg.c status-table.h \ + engine-gpgsm.c engine-assuan.c engine-gpgconf.c gpgconf.c \ + sema.h priv-io.h ath.h posix-util.c posix-sema.c posix-io.c \ + w32-util.c w32-sema.c dirinfo.c debug.c debug.h gpgme.c \ + version.c error.c ath.c w32-qt-io.cpp kdpipeiodevice.h \ kdpipeiodevice.cpp kdpipeiodevice.moc @BUILD_W32_QT_TRUE@am_libgpgme_qt_la_OBJECTS = $(am__objects_4) ath.lo \ @BUILD_W32_QT_TRUE@ w32-qt-io.lo kdpipeiodevice.lo @@ -177,18 +180,18 @@ libgpgme_qt_la_LINK = $(LIBTOOL) --tag=C $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(libgpgme_qt_la_LDFLAGS) $(LDFLAGS) -o $@ @BUILD_W32_QT_TRUE@am_libgpgme_qt_la_rpath = -rpath $(libdir) -am__libgpgme_la_SOURCES_DIST = gpgme.h util.h conversion.c get-env.c \ - context.h ops.h data.h data.c data-fd.c data-stream.c \ - data-mem.c data-user.c data-compat.c signers.c sig-notation.c \ - wait.c wait-global.c wait-private.c wait-user.c wait.h \ - op-support.c encrypt.c encrypt-sign.c decrypt.c \ - decrypt-verify.c verify.c sign.c passphrase.c progress.c key.c \ - keylist.c trust-item.c trustlist.c import.c export.c genkey.c \ - delete.c edit.c getauditlog.c engine.h engine-backend.h \ - engine.c rungpg.c status-table.h engine-gpgsm.c \ +am__libgpgme_la_SOURCES_DIST = util.h conversion.c get-env.c context.h \ + ops.h data.h data.c data-fd.c data-stream.c data-mem.c \ + data-user.c data-compat.c signers.c sig-notation.c wait.c \ + wait-global.c wait-private.c wait-user.c wait.h op-support.c \ + encrypt.c encrypt-sign.c decrypt.c decrypt-verify.c verify.c \ + sign.c passphrase.c progress.c key.c keylist.c trust-item.c \ + trustlist.c import.c export.c genkey.c delete.c edit.c \ + getauditlog.c opassuan.c engine.h engine-backend.h engine.c \ + engine-gpg.c status-table.h engine-gpgsm.c engine-assuan.c \ engine-gpgconf.c gpgconf.c sema.h priv-io.h ath.h posix-util.c \ - posix-sema.c posix-io.c w32-util.c w32-sema.c debug.c debug.h \ - gpgme.c version.c error.c ath.c w32-io.c + posix-sema.c posix-io.c w32-util.c w32-sema.c dirinfo.c \ + debug.c debug.h gpgme.c version.c error.c ath.c w32-io.c am_libgpgme_la_OBJECTS = $(am__objects_4) ath.lo $(am__objects_5) libgpgme_la_OBJECTS = $(am_libgpgme_la_OBJECTS) libgpgme_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -232,8 +235,8 @@ DIST_SOURCES = $(am__libgpgme_glib_la_SO $(am__libgpgme_la_SOURCES_DIST) gpgme-w32spawn.c m4dataDATA_INSTALL = $(INSTALL_DATA) DATA = $(m4data_DATA) -includeHEADERS_INSTALL = $(INSTALL_HEADER) -HEADERS = $(include_HEADERS) +nodist_includeHEADERS_INSTALL = $(INSTALL_HEADER) +HEADERS = $(nodist_include_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -303,6 +306,7 @@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ +NEED__FILE_OFFSET_BITS = @NEED__FILE_OFFSET_BITS@ NETLIBS = @NETLIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -375,6 +379,7 @@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @@ -387,7 +392,7 @@ MOSTLYCLEANFILES = status-table.h bin_SCRIPTS = gpgme-config m4datadir = $(datadir)/aclocal m4data_DATA = gpgme.m4 -include_HEADERS = gpgme.h +nodist_include_HEADERS = gpgme.h @HAVE_PTHREAD_FALSE@ltlib_gpgme_pthread = @HAVE_PTHREAD_TRUE@ltlib_gpgme_pthread = libgpgme-pthread.la @HAVE_PTH_FALSE@ltlib_gpgme_pth = @@ -410,7 +415,7 @@ lib_LTLIBRARIES = libgpgme.la $(ltlib_gp @HAVE_DOSISH_SYSTEM_FALSE@system_components_not_extra = @HAVE_DOSISH_SYSTEM_TRUE@system_components_not_extra = w32-io.c @HAVE_GPGSM_FALSE@gpgsm_components = -@HAVE_GPGSM_TRUE@gpgsm_components = engine-gpgsm.c +@HAVE_GPGSM_TRUE@gpgsm_components = engine-gpgsm.c engine-assuan.c @HAVE_GPGCONF_FALSE@gpgconf_components = @HAVE_GPGCONF_TRUE@gpgconf_components = engine-gpgconf.c @@ -420,7 +425,7 @@ lib_LTLIBRARIES = libgpgme.la $(ltlib_gp # right linking order with libtool, as the non-installed version has # unresolved symbols to the thread module. main_sources = \ - gpgme.h util.h conversion.c get-env.c context.h ops.h \ + util.h conversion.c get-env.c context.h ops.h \ data.h data.c data-fd.c data-stream.c data-mem.c data-user.c \ data-compat.c \ signers.c sig-notation.c \ @@ -430,9 +435,10 @@ main_sources = \ sign.c passphrase.c progress.c \ key.c keylist.c trust-item.c trustlist.c \ import.c export.c genkey.c delete.c edit.c getauditlog.c \ - engine.h engine-backend.h engine.c rungpg.c status-table.h \ + opassuan.c \ + engine.h engine-backend.h engine.c engine-gpg.c status-table.h \ $(gpgsm_components) $(gpgconf_components) gpgconf.c \ - sema.h priv-io.h $(system_components) \ + sema.h priv-io.h $(system_components) dirinfo.c \ debug.c debug.h gpgme.c version.c error.c libgpgme_la_SOURCES = $(main_sources) \ @@ -535,8 +541,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_ @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -682,9 +688,12 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/decrypt-verify.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/decrypt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/delete.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dirinfo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edit.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/encrypt-sign.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/encrypt.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/engine-assuan.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/engine-gpg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/engine-gpgconf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/engine-gpgsm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/engine.Plo@am__quote@ @@ -701,12 +710,12 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/key.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keylist.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/op-support.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opassuan.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/passphrase.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/posix-io.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/posix-sema.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/posix-util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/progress.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rungpg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sig-notation.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sign.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signers.Plo@am__quote@ @@ -788,19 +797,19 @@ uninstall-m4dataDATA: echo " rm -f '$(DESTDIR)$(m4datadir)/$$f'"; \ rm -f "$(DESTDIR)$(m4datadir)/$$f"; \ done -install-includeHEADERS: $(include_HEADERS) +install-nodist_includeHEADERS: $(nodist_include_HEADERS) @$(NORMAL_INSTALL) test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" - @list='$(include_HEADERS)'; for p in $$list; do \ + @list='$(nodist_include_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ - echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \ - $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \ + echo " $(nodist_includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \ + $(nodist_includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \ done -uninstall-includeHEADERS: +uninstall-nodist_includeHEADERS: @$(NORMAL_UNINSTALL) - @list='$(include_HEADERS)'; for p in $$list; do \ + @list='$(nodist_include_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \ rm -f "$(DESTDIR)$(includedir)/$$f"; \ @@ -811,7 +820,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS @@ -936,8 +945,8 @@ info: info-am info-am: -install-data-am: install-data-local install-includeHEADERS \ - install-m4dataDATA +install-data-am: install-data-local install-m4dataDATA \ + install-nodist_includeHEADERS install-dvi: install-dvi-am @@ -974,9 +983,9 @@ ps: ps-am ps-am: -uninstall-am: uninstall-binSCRIPTS uninstall-includeHEADERS \ - uninstall-libLTLIBRARIES uninstall-libexecPROGRAMS \ - uninstall-local uninstall-m4dataDATA +uninstall-am: uninstall-binSCRIPTS uninstall-libLTLIBRARIES \ + uninstall-libexecPROGRAMS uninstall-local uninstall-m4dataDATA \ + uninstall-nodist_includeHEADERS .MAKE: install-am install-strip @@ -987,16 +996,17 @@ uninstall-am: uninstall-binSCRIPTS unins html-am info info-am install install-am install-binSCRIPTS \ install-data install-data-am install-data-local install-dvi \ install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-includeHEADERS install-info \ - install-info-am install-libLTLIBRARIES install-libexecPROGRAMS \ - install-m4dataDATA install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-binSCRIPTS \ - uninstall-includeHEADERS uninstall-libLTLIBRARIES \ - uninstall-libexecPROGRAMS uninstall-local uninstall-m4dataDATA + install-html-am install-info install-info-am \ + install-libLTLIBRARIES install-libexecPROGRAMS \ + install-m4dataDATA install-man install-nodist_includeHEADERS \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am \ + uninstall-binSCRIPTS uninstall-libLTLIBRARIES \ + uninstall-libexecPROGRAMS uninstall-local uninstall-m4dataDATA \ + uninstall-nodist_includeHEADERS @HAVE_W32_SYSTEM_TRUE@SUFFIXES: .rc .lo diff -urpNP gpgme-1.1.8/src/context.h gpgme-1.2.0/src/context.h --- gpgme-1.1.8/src/context.h 2008-11-03 16:50:12.000000000 +0000 +++ gpgme-1.2.0/src/context.h 2009-06-18 16:09:23.000000000 +0000 @@ -28,6 +28,8 @@ #include "sema.h" +extern gpgme_error_t _gpgme_selftest; + /* Operations might require to remember arbitrary information and data objects during invocations of the status handler. The ctx_op_data structure provides a generic framework to hook in @@ -36,14 +38,20 @@ typedef enum { OPDATA_DECRYPT, OPDATA_SIGN, OPDATA_ENCRYPT, OPDATA_PASSPHRASE, OPDATA_IMPORT, OPDATA_GENKEY, OPDATA_KEYLIST, OPDATA_EDIT, - OPDATA_VERIFY, OPDATA_TRUSTLIST + OPDATA_VERIFY, OPDATA_TRUSTLIST, OPDATA_ASSUAN } ctx_op_data_id_t; +/* "gpgmeres" in ASCII. */ +#define CTX_OP_DATA_MAGIC 0x736572656d677067ULL struct ctx_op_data { + /* A magic word just to make sure people don't deallocate something + that ain't a result structure. */ + unsigned long long magic; + /* The next element in the linked list, or NULL if this is the last - element. */ + element. Used by op data structures linked into a context. */ struct ctx_op_data *next; /* The type of the hook data, which can be used by a routine to @@ -51,11 +59,14 @@ struct ctx_op_data ctx_op_data_id_t type; /* The function to release HOOK and all its associated resources. - Can be NULL if no special dealllocation routine is necessary. */ + Can be NULL if no special deallocation routine is necessary. */ void (*cleanup) (void *hook); /* The hook that points to the operation data. */ void *hook; + + /* The number of outstanding references. */ + int references; }; typedef struct ctx_op_data *ctx_op_data_t; diff -urpNP gpgme-1.1.8/src/data.c gpgme-1.2.0/src/data.c --- gpgme-1.1.8/src/data.c 2008-11-03 16:50:12.000000000 +0000 +++ gpgme-1.2.0/src/data.c 2009-06-17 12:36:07.000000000 +0000 @@ -191,7 +191,7 @@ gpgme_data_set_encoding (gpgme_data_t dh "encoding=%i", enc); if (!dh) return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE)); - if (enc < 0 || enc > GPGME_DATA_ENCODING_ARMOR) + if (enc < 0 || enc > GPGME_DATA_ENCODING_URL0) return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE)); dh->encoding = enc; return TRACE_ERR (0); diff -urpNP gpgme-1.1.8/src/debug.c gpgme-1.2.0/src/debug.c --- gpgme-1.1.8/src/debug.c 2008-11-03 16:50:12.000000000 +0000 +++ gpgme-1.2.0/src/debug.c 2009-03-09 14:10:30.000000000 +0000 @@ -145,8 +145,7 @@ debug_init (void) fprintf (errfp, "gpgme_debug: level=%d\n", debug_level); #ifdef HAVE_ASSUAN_H assuan_set_assuan_log_prefix ("gpgme-assuan"); - assuan_set_assuan_log_stream (errfp); - assuan_set_assuan_log_level (debug_level >= 0? debug_level:0); + assuan_set_assuan_log_stream (debug_level > 0 ? errfp : NULL); #endif /* HAVE_ASSUAN_H*/ } UNLOCK (debug_lock); diff -urpNP gpgme-1.1.8/src/dirinfo.c gpgme-1.2.0/src/dirinfo.c --- gpgme-1.1.8/src/dirinfo.c 1970-01-01 00:00:00.000000000 +0000 +++ gpgme-1.2.0/src/dirinfo.c 2009-06-15 11:59:37.000000000 +0000 @@ -0,0 +1,189 @@ +/* dirinfo.c - Get directory information + * Copyright (C) 2009 g10 Code GmbH + * + * This file is part of GPGME. + * + * GPGME is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * GPGME is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, see . + */ + +#if HAVE_CONFIG_H +#include +#endif + +#include +#include + +#include "gpgme.h" +#include "util.h" +#include "priv-io.h" +#include "debug.h" +#include "sema.h" + +DEFINE_STATIC_LOCK (dirinfo_lock); + +/* Constants used internally to select the data. */ +enum + { + WANT_HOMEDIR, + WANT_AGENT_SOCKET + }; + +/* Values retrieved via gpgconf and cached here. */ +static struct { + int valid; /* Cached information is valid. */ + char *homedir; + char *agent_socket; +} dirinfo; + + +/* Parse the output of "gpgconf --list-dirs". This function expects + that DIRINFO_LOCK is held by the caller. */ +static void +parse_output (char *line) +{ + char *value, *p; + + value = strchr (line, ':'); + if (!value) + return; + *value++ = 0; + p = strchr (value, ':'); + if (p) + *p = 0; + if (_gpgme_decode_percent_string (value, &value, strlen (value)+1, 0)) + return; + if (!*value) + return; + + if (!strcmp (line, "homedir") && !dirinfo.homedir) + dirinfo.homedir = strdup (value); + else if (!strcmp (line, "agent-socket") && !dirinfo.agent_socket) + dirinfo.agent_socket = strdup (value); +} + + +/* Read the directory information from gpgconf. This function expects + that DIRINFO_LOCK is held by the caller. */ +static void +read_gpgconf_dirs (void) +{ + const char *pgmname; + char linebuf[1024] = {0}; + int linelen = 0; + char * argv[3]; + int rp[2]; + struct spawn_fd_item_s cfd[] = { {-1, 1 /* STDOUT_FILENO */, -1, 0}, + {-1, -1} }; + int status; + int nread; + char *mark = NULL; + + pgmname = _gpgme_get_gpgconf_path (); + if (!pgmname) + return; /* No way. */ + + argv[0] = (char *)pgmname; + argv[1] = "--list-dirs"; + argv[2] = NULL; + + if (_gpgme_io_pipe (rp, 1) < 0) + return; + + cfd[0].fd = rp[1]; + + status = _gpgme_io_spawn (pgmname, argv, 0, cfd, NULL); + if (status < 0) + { + _gpgme_io_close (rp[0]); + _gpgme_io_close (rp[1]); + return; + } + + do + { + nread = _gpgme_io_read (rp[0], + linebuf + linelen, + sizeof linebuf - linelen - 1); + if (nread > 0) + { + char *line; + const char *lastmark = NULL; + size_t nused; + + linelen += nread; + linebuf[linelen] = '\0'; + + for (line=linebuf; (mark = strchr (line, '\n')); line = mark+1 ) + { + lastmark = mark; + if (mark > line && mark[-1] == '\r') + mark[-1] = '\0'; + else + mark[0] = '\0'; + + parse_output (line); + } + + nused = lastmark? (lastmark + 1 - linebuf) : 0; + memmove (linebuf, linebuf + nused, linelen - nused); + linelen -= nused; + } + } + while (nread > 0 && linelen < sizeof linebuf - 1); + + _gpgme_io_close (rp[0]); +} + + +static const char * +get_gpgconf_dir (int what) +{ + const char *result = NULL; + + LOCK (dirinfo_lock); + if (!dirinfo.valid) + { + read_gpgconf_dirs (); + /* Even if the reading of the directories failed (e.g. due to an + too old version gpgconf or no gpgconf at all), we need to + mark the entries as valid so that we won't try over and over + to read them. Note further that we are not able to change + the read values later because they are practically statically + allocated. */ + dirinfo.valid = 1; + } + switch (what) + { + case WANT_HOMEDIR: result = dirinfo.homedir; break; + case WANT_AGENT_SOCKET: result = dirinfo.agent_socket; break; + } + UNLOCK (dirinfo_lock); + return result; +} + + +/* Return the default home directory. Returns NULL if not known. */ +const char * +_gpgme_get_default_homedir (void) +{ + return get_gpgconf_dir (WANT_HOMEDIR); +} + +/* Return the default gpg-agent socket name. Returns NULL if not known. */ +const char * +_gpgme_get_default_agent_socket (void) +{ + return get_gpgconf_dir (WANT_AGENT_SOCKET); +} + diff -urpNP gpgme-1.1.8/src/engine-assuan.c gpgme-1.2.0/src/engine-assuan.c --- gpgme-1.1.8/src/engine-assuan.c 1970-01-01 00:00:00.000000000 +0000 +++ gpgme-1.2.0/src/engine-assuan.c 2009-06-15 11:59:37.000000000 +0000 @@ -0,0 +1,753 @@ +/* engine-assuan.c - Low-level Assuan protocol engine + * Copyright (C) 2009 g10 Code GmbH + * + * This file is part of GPGME. + * + * GPGME is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * GPGME is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, see . + */ + +/* + Note: This engine requires a modern Assuan server which uses + gpg-error codes. In particular there is no backward compatible + mapping of old Assuan error codes implemented. +*/ + + +#if HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include + +#include "gpgme.h" +#include "util.h" +#include "ops.h" +#include "wait.h" +#include "priv-io.h" +#include "sema.h" + +#include "assuan.h" +#include "debug.h" + +#include "engine-backend.h" + + +typedef struct +{ + int fd; /* FD we talk about. */ + int server_fd;/* Server FD for this connection. */ + int dir; /* Inbound/Outbound, maybe given implicit? */ + void *data; /* Handler-specific data. */ + void *tag; /* ID from the user for gpgme_remove_io_callback. */ +} iocb_data_t; + +/* Engine instance data. */ +struct engine_llass +{ + assuan_context_t assuan_ctx; + + int lc_ctype_set; + int lc_messages_set; + + iocb_data_t status_cb; + + struct gpgme_io_cbs io_cbs; + + /* Internal callbacks. */ + engine_assuan_result_cb_t result_cb; + void *result_cb_value; + + /* User provided callbacks. */ + struct { + gpgme_assuan_data_cb_t data_cb; + void *data_cb_value; + + gpgme_assuan_inquire_cb_t inq_cb; + void *inq_cb_value; + + gpgme_assuan_status_cb_t status_cb; + void *status_cb_value; + } user; + + /* Option flags. */ + struct { + int gpg_agent:1; /* Assume this is a gpg-agent connection. */ + } opt; + +}; +typedef struct engine_llass *engine_llass_t; + + + +/* Prototypes. */ +static void llass_io_event (void *engine, + gpgme_event_io_t type, void *type_data); + + + + + +/* return the default home directory. */ +static const char * +llass_get_home_dir (void) +{ + /* For this engine the home directory is not a filename but a string + used to convey options. The exclamation mark is a marker to show + that this is not a directory name. Options are strings delimited + by a space. The only option defined for now is GPG_AGENT to + enable GPG_AGENT specific commands to send to the server at + connection startup. */ + return "!GPG_AGENT"; +} + +static char * +llass_get_version (const char *file_name) +{ + return strdup ("1.0"); +} + + +static const char * +llass_get_req_version (void) +{ + return "1.0"; +} + + +static void +close_notify_handler (int fd, void *opaque) +{ + engine_llass_t llass = opaque; + + assert (fd != -1); + if (llass->status_cb.fd == fd) + { + if (llass->status_cb.tag) + llass->io_cbs.remove (llass->status_cb.tag); + llass->status_cb.fd = -1; + llass->status_cb.tag = NULL; + } +} + + + +static gpgme_error_t +llass_cancel (void *engine) +{ + engine_llass_t llass = engine; + + if (!llass) + return gpg_error (GPG_ERR_INV_VALUE); + + if (llass->status_cb.fd != -1) + _gpgme_io_close (llass->status_cb.fd); + + if (llass->assuan_ctx) + { + assuan_disconnect (llass->assuan_ctx); + llass->assuan_ctx = NULL; + } + + return 0; +} + + +static void +llass_release (void *engine) +{ + engine_llass_t llass = engine; + + if (!llass) + return; + + llass_cancel (engine); + + free (llass); +} + + +/* Create a new instance. If HOME_DIR is NULL standard options for use + with gpg-agent are issued. */ +static gpgme_error_t +llass_new (void **engine, const char *file_name, const char *home_dir) +{ + gpgme_error_t err = 0; + engine_llass_t llass; + char *optstr; + + llass = calloc (1, sizeof *llass); + if (!llass) + return gpg_error_from_syserror (); + + llass->status_cb.fd = -1; + llass->status_cb.dir = 1; + llass->status_cb.tag = 0; + llass->status_cb.data = llass; + + /* Parse_options. */ + if (home_dir && *home_dir == '!') + { + home_dir++; + /* Very simple parser only working for the one option we support. */ + /* Note that wk promised to write a regression test if this + parser will be extended. */ + if (!strncmp (home_dir, "GPG_AGENT", 9) + && (!home_dir[9] || home_dir[9] == ' ')) + llass->opt.gpg_agent = 1; + } + + err = assuan_socket_connect (&llass->assuan_ctx, file_name, 0); + if (err) + goto leave; + + if (llass->opt.gpg_agent) + { + char *dft_display = NULL; + + err = _gpgme_getenv ("DISPLAY", &dft_display); + if (err) + goto leave; + if (dft_display) + { + if (asprintf (&optstr, "OPTION display=%s", dft_display) < 0) + { + err = gpg_error_from_syserror (); + free (dft_display); + goto leave; + } + free (dft_display); + + err = assuan_transact (llass->assuan_ctx, optstr, NULL, NULL, NULL, + NULL, NULL, NULL); + free (optstr); + if (err) + goto leave; + } + } + + if (llass->opt.gpg_agent && isatty (1)) + { + int rc; + char dft_ttyname[64]; + char *dft_ttytype = NULL; + + rc = ttyname_r (1, dft_ttyname, sizeof (dft_ttyname)); + if (rc) + { + err = gpg_error_from_errno (rc); + goto leave; + } + else + { + if (asprintf (&optstr, "OPTION ttyname=%s", dft_ttyname) < 0) + { + err = gpg_error_from_syserror (); + goto leave; + } + err = assuan_transact (llass->assuan_ctx, optstr, NULL, NULL, NULL, + NULL, NULL, NULL); + free (optstr); + if (err) + goto leave; + + err = _gpgme_getenv ("TERM", &dft_ttytype); + if (err) + goto leave; + if (dft_ttytype) + { + if (asprintf (&optstr, "OPTION ttytype=%s", dft_ttytype) < 0) + { + err = gpg_error_from_syserror (); + free (dft_ttytype); + goto leave; + } + free (dft_ttytype); + + err = assuan_transact (llass->assuan_ctx, optstr, NULL, NULL, + NULL, NULL, NULL, NULL); + free (optstr); + if (err) + goto leave; + } + } + } + + +#ifdef HAVE_W32_SYSTEM + /* Under Windows we need to use AllowSetForegroundWindow. Tell + llass to tell us when it needs it. */ + if (!err && llass->opt.gpg_agent) + { + err = assuan_transact (llass->assuan_ctx, "OPTION allow-pinentry-notify", + NULL, NULL, NULL, NULL, NULL, NULL); + if (gpg_err_code (err) == GPG_ERR_UNKNOWN_OPTION) + err = 0; /* This work only with recent gpg-agents. */ + } +#endif /*HAVE_W32_SYSTEM*/ + + + leave: + /* Close the server ends of the pipes (because of this, we must use + the stored server_fd_str in the function start). Our ends are + closed in llass_release(). */ + + if (err) + llass_release (llass); + else + *engine = llass; + + return err; +} + + +static gpgme_error_t +llass_set_locale (void *engine, int category, const char *value) +{ + gpgme_error_t err; + engine_llass_t llass = engine; + char *optstr; + char *catstr; + + if (!llass->opt.gpg_agent) + return 0; + + /* FIXME: If value is NULL, we need to reset the option to default. + But we can't do this. So we error out here. gpg-agent needs + support for this. */ + if (category == LC_CTYPE) + { + catstr = "lc-ctype"; + if (!value && llass->lc_ctype_set) + return gpg_error (GPG_ERR_INV_VALUE); + if (value) + llass->lc_ctype_set = 1; + } +#ifdef LC_MESSAGES + else if (category == LC_MESSAGES) + { + catstr = "lc-messages"; + if (!value && llass->lc_messages_set) + return gpg_error (GPG_ERR_INV_VALUE); + if (value) + llass->lc_messages_set = 1; + } +#endif /* LC_MESSAGES */ + else + return gpg_error (GPG_ERR_INV_VALUE); + + /* FIXME: Reset value to default. */ + if (!value) + return 0; + + if (asprintf (&optstr, "OPTION %s=%s", catstr, value) < 0) + err = gpg_error_from_errno (errno); + else + { + err = assuan_transact (llass->assuan_ctx, optstr, NULL, NULL, + NULL, NULL, NULL, NULL); + free (optstr); + } + return err; +} + + +/* This is the inquiry callback. It handles stuff which ee need to + handle here and passes everything on to the user callback. */ +static gpgme_error_t +inquire_cb (engine_llass_t llass, const char *keyword, const char *args) +{ + gpg_error_t err; + + if (llass->opt.gpg_agent && !strcmp (keyword, "PINENTRY_LAUNCHED")) + { + _gpgme_allow_set_foreground_window ((pid_t)strtoul (args, NULL, 10)); + } + + if (llass->user.inq_cb) + { + gpgme_data_t data = NULL; + + err = llass->user.inq_cb (llass->user.inq_cb_value, + keyword, args, &data); + if (!err && data) + { + /* FIXME: Returning data is not yet implemented. However we + need to allow the caller to cleanup his data object. + Thus we run the callback in finish mode immediately. */ + err = llass->user.inq_cb (llass->user.inq_cb_value, + NULL, NULL, &data); + } + } + else + err = 0; + + return err; +} + + +static gpgme_error_t +llass_status_handler (void *opaque, int fd) +{ + gpgme_error_t err = 0; + engine_llass_t llass = opaque; + char *line; + size_t linelen; + + do + { + err = assuan_read_line (llass->assuan_ctx, &line, &linelen); + if (err) + { + /* Reading a full line may not be possible when + communicating over a socket in nonblocking mode. In this + case, we are done for now. */ + if (gpg_err_code (err) == GPG_ERR_EAGAIN) + { + TRACE1 (DEBUG_CTX, "gpgme:llass_status_handler", llass, + "fd 0x%x: EAGAIN reading assuan line (ignored)", fd); + err = 0; + continue; + } + + TRACE2 (DEBUG_CTX, "gpgme:llass_status_handler", llass, + "fd 0x%x: error reading assuan line: %s", + fd, gpg_strerror (err)); + } + else if (linelen >= 2 && line[0] == 'D' && line[1] == ' ') + { + char *src = line + 2; + char *end = line + linelen; + char *dst = src; + + linelen = 0; + while (src < end) + { + if (*src == '%' && src + 2 < end) + { + /* Handle escaped characters. */ + ++src; + *dst++ = _gpgme_hextobyte (src); + src += 2; + } + else + *dst++ = *src++; + + linelen++; + } + + src = line + 2; + if (linelen && llass->user.data_cb) + err = llass->user.data_cb (llass->user.data_cb_value, + src, linelen); + else + err = 0; + + TRACE2 (DEBUG_CTX, "gpgme:llass_status_handler", llass, + "fd 0x%x: D inlinedata; status from cb: %s", + fd, (llass->user.data_cb ? + (err? gpg_strerror (err):"ok"):"no callback")); + } + else if (linelen >= 3 + && line[0] == 'E' && line[1] == 'N' && line[2] == 'D' + && (line[3] == '\0' || line[3] == ' ')) + { + /* END received. Tell the data callback. */ + if (llass->user.data_cb) + err = llass->user.data_cb (llass->user.data_cb_value, NULL, 0); + else + err = 0; + + TRACE2 (DEBUG_CTX, "gpgme:llass_status_handler", llass, + "fd 0x%x: END line; status from cb: %s", + fd, (llass->user.data_cb ? + (err? gpg_strerror (err):"ok"):"no callback")); + } + else if (linelen > 2 && line[0] == 'S' && line[1] == ' ') + { + char *args; + char *src; + + for (src=line+2; *src == ' '; src++) + ; + + args = strchr (src, ' '); + if (!args) + args = line + linelen; /* Let it point to an empty string. */ + else + *(args++) = 0; + + while (*args == ' ') + args++; + + if (llass->user.status_cb) + err = llass->user.status_cb (llass->user.status_cb_value, + src, args); + else + err = 0; + + TRACE3 (DEBUG_CTX, "gpgme:llass_status_handler", llass, + "fd 0x%x: S line (%s) - status from cb: %s", + fd, line+2, (llass->user.status_cb ? + (err? gpg_strerror (err):"ok"):"no callback")); + } + else if (linelen >= 7 + && line[0] == 'I' && line[1] == 'N' && line[2] == 'Q' + && line[3] == 'U' && line[4] == 'I' && line[5] == 'R' + && line[6] == 'E' + && (line[7] == '\0' || line[7] == ' ')) + { + char *src; + char *args; + + for (src=line+7; *src == ' '; src++) + ; + + args = strchr (src, ' '); + if (!args) + args = line + linelen; /* Let it point to an empty string. */ + else + *(args++) = 0; + + while (*args == ' ') + args++; + + err = inquire_cb (llass, src, args); + if (!err) + { + /* Flush and send END. */ + err = assuan_send_data (llass->assuan_ctx, NULL, 0); + } + else if (gpg_err_code (err) == GPG_ERR_ASS_CANCELED) + { + /* Flush and send CANcel. */ + err = assuan_send_data (llass->assuan_ctx, NULL, 1); + } + } + else if (linelen >= 3 + && line[0] == 'E' && line[1] == 'R' && line[2] == 'R' + && (line[3] == '\0' || line[3] == ' ')) + { + if (line[3] == ' ') + err = atoi (line+4); + else + err = gpg_error (GPG_ERR_GENERAL); + TRACE2 (DEBUG_CTX, "gpgme:llass_status_handler", llass, + "fd 0x%x: ERR line: %s", + fd, err ? gpg_strerror (err) : "ok"); + if (llass->result_cb) + err = llass->result_cb (llass->result_cb_value, err); + else + err = 0; + if (!err) + { + _gpgme_io_close (llass->status_cb.fd); + return 0; + } + } + else if (linelen >= 2 + && line[0] == 'O' && line[1] == 'K' + && (line[2] == '\0' || line[2] == ' ')) + { + TRACE1 (DEBUG_CTX, "gpgme:llass_status_handler", llass, + "fd 0x%x: OK line", fd); + if (llass->result_cb) + err = llass->result_cb (llass->result_cb_value, 0); + else + err = 0; + if (!err) + { + _gpgme_io_close (llass->status_cb.fd); + return 0; + } + } + else + { + /* Comment line or invalid line. */ + } + + } + while (!err && assuan_pending_line (llass->assuan_ctx)); + + return err; +} + + +static gpgme_error_t +add_io_cb (engine_llass_t llass, iocb_data_t *iocbd, gpgme_io_cb_t handler) +{ + gpgme_error_t err; + + TRACE_BEG2 (DEBUG_ENGINE, "engine-assuan:add_io_cb", llass, + "fd %d, dir %d", iocbd->fd, iocbd->dir); + err = (*llass->io_cbs.add) (llass->io_cbs.add_priv, + iocbd->fd, iocbd->dir, + handler, iocbd->data, &iocbd->tag); + if (err) + return TRACE_ERR (err); + if (!iocbd->dir) + /* FIXME Kludge around poll() problem. */ + err = _gpgme_io_set_nonblocking (iocbd->fd); + return TRACE_ERR (err); +} + + +static gpgme_error_t +start (engine_llass_t llass, const char *command) +{ + gpgme_error_t err; + int fdlist[5]; + int nfds; + + /* We need to know the fd used by assuan for reads. We do this by + using the assumption that the first returned fd from + assuan_get_active_fds() is always this one. */ + nfds = assuan_get_active_fds (llass->assuan_ctx, 0 /* read fds */, + fdlist, DIM (fdlist)); + if (nfds < 1) + return gpg_error (GPG_ERR_GENERAL); /* FIXME */ + + /* We "duplicate" the file descriptor, so we can close it here (we + can't close fdlist[0], as that is closed by libassuan, and + closing it here might cause libassuan to close some unrelated FD + later). Alternatively, we could special case status_fd and + register/unregister it manually as needed, but this increases + code duplication and is more complicated as we can not use the + close notifications etc. A third alternative would be to let + Assuan know that we closed the FD, but that complicates the + Assuan interface. */ + + llass->status_cb.fd = _gpgme_io_dup (fdlist[0]); + if (llass->status_cb.fd < 0) + return gpg_error_from_syserror (); + + if (_gpgme_io_set_close_notify (llass->status_cb.fd, + close_notify_handler, llass)) + { + _gpgme_io_close (llass->status_cb.fd); + llass->status_cb.fd = -1; + return gpg_error (GPG_ERR_GENERAL); + } + + err = add_io_cb (llass, &llass->status_cb, llass_status_handler); + if (!err) + err = assuan_write_line (llass->assuan_ctx, command); + + /* FIXME: If *command == '#' no answer is expected. */ + + if (!err) + llass_io_event (llass, GPGME_EVENT_START, NULL); + + return err; +} + + + +static gpgme_error_t +llass_transact (void *engine, + const char *command, + engine_assuan_result_cb_t result_cb, + void *result_cb_value, + gpgme_assuan_data_cb_t data_cb, + void *data_cb_value, + gpgme_assuan_inquire_cb_t inq_cb, + void *inq_cb_value, + gpgme_assuan_status_cb_t status_cb, + void *status_cb_value) +{ + engine_llass_t llass = engine; + gpgme_error_t err; + + if (!llass || !command || !*command) + return gpg_error (GPG_ERR_INV_VALUE); + + llass->result_cb = result_cb; + llass->result_cb_value = result_cb_value; + llass->user.data_cb = data_cb; + llass->user.data_cb_value = data_cb_value; + llass->user.inq_cb = inq_cb; + llass->user.inq_cb_value = inq_cb_value; + llass->user.status_cb = status_cb; + llass->user.status_cb_value = status_cb_value; + + err = start (llass, command); + return err; +} + + + +static void +llass_set_io_cbs (void *engine, gpgme_io_cbs_t io_cbs) +{ + engine_llass_t llass = engine; + llass->io_cbs = *io_cbs; +} + + +static void +llass_io_event (void *engine, gpgme_event_io_t type, void *type_data) +{ + engine_llass_t llass = engine; + + TRACE3 (DEBUG_ENGINE, "gpgme:llass_io_event", llass, + "event %p, type %d, type_data %p", + llass->io_cbs.event, type, type_data); + if (llass->io_cbs.event) + (*llass->io_cbs.event) (llass->io_cbs.event_priv, type, type_data); +} + + +struct engine_ops _gpgme_engine_ops_assuan = + { + /* Static functions. */ + _gpgme_get_default_agent_socket, + llass_get_home_dir, + llass_get_version, + llass_get_req_version, + llass_new, + + /* Member functions. */ + llass_release, + NULL, /* reset */ + NULL, /* set_status_handler */ + NULL, /* set_command_handler */ + NULL, /* set_colon_line_handler */ + llass_set_locale, + NULL, /* decrypt */ + NULL, /* delete */ + NULL, /* edit */ + NULL, /* encrypt */ + NULL, /* encrypt_sign */ + NULL, /* export */ + NULL, /* export_ext */ + NULL, /* genkey */ + NULL, /* import */ + NULL, /* keylist */ + NULL, /* keylist_ext */ + NULL, /* sign */ + NULL, /* trustlist */ + NULL, /* verify */ + NULL, /* getauditlog */ + llass_transact, /* opassuan_transact */ + NULL, /* conf_load */ + NULL, /* conf_save */ + llass_set_io_cbs, + llass_io_event, + llass_cancel + }; diff -urpNP gpgme-1.1.8/src/engine-backend.h gpgme-1.2.0/src/engine-backend.h --- gpgme-1.1.8/src/engine-backend.h 2008-11-03 16:50:12.000000000 +0000 +++ gpgme-1.2.0/src/engine-backend.h 2009-06-17 12:36:07.000000000 +0000 @@ -1,5 +1,5 @@ /* engine-backend.h - A crypto backend for the engine interface. - Copyright (C) 2002, 2003, 2004 g10 Code GmbH + Copyright (C) 2002, 2003, 2004, 2009 g10 Code GmbH This file is part of GPGME. @@ -14,9 +14,8 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + License along with this program; if not, see . + */ #ifndef ENGINE_BACKEND_H #define ENGINE_BACKEND_H @@ -35,6 +34,11 @@ struct engine_ops /* Return the default file name for the binary of this engine. */ const char *(*get_file_name) (void); + /* Return the default home dir for the binary of this engine. If + this function pointer is not set, the standard default home dir + of the engine is used. */ + const char *(*get_home_dir) (void); + /* Returns a malloced string containing the version of the engine with the given binary file name (or the default if FILE_NAME is NULL. */ @@ -73,14 +77,15 @@ struct engine_ops gpgme_data_t plain, gpgme_data_t ciph, int use_armor, gpgme_ctx_t ctx /* FIXME */); gpgme_error_t (*export) (void *engine, const char *pattern, - unsigned int reserved, gpgme_data_t keydata, + gpgme_export_mode_t mode, gpgme_data_t keydata, int use_armor); gpgme_error_t (*export_ext) (void *engine, const char *pattern[], - unsigned int reserved, gpgme_data_t keydata, + gpgme_export_mode_t mode, gpgme_data_t keydata, int use_armor); gpgme_error_t (*genkey) (void *engine, gpgme_data_t help_data, int use_armor, gpgme_data_t pubkey, gpgme_data_t seckey); - gpgme_error_t (*import) (void *engine, gpgme_data_t keydata); + gpgme_error_t (*import) (void *engine, gpgme_data_t keydata, + gpgme_key_t *keyarray); gpgme_error_t (*keylist) (void *engine, const char *pattern, int secret_only, gpgme_keylist_mode_t mode); gpgme_error_t (*keylist_ext) (void *engine, const char *pattern[], @@ -96,6 +101,16 @@ struct engine_ops gpgme_data_t plaintext); gpgme_error_t (*getauditlog) (void *engine, gpgme_data_t output, unsigned int flags); + gpgme_error_t (*opassuan_transact) (void *engine, + const char *command, + engine_assuan_result_cb_t result_cb, + void *result_cb_value, + gpgme_assuan_data_cb_t data_cb, + void *data_cb_value, + gpgme_assuan_inquire_cb_t inq_cb, + void *inq_cb_value, + gpgme_assuan_status_cb_t status_cb, + void *status_cb_value); gpgme_error_t (*conf_load) (void *engine, gpgme_conf_comp_t *conf_p); gpgme_error_t (*conf_save) (void *engine, gpgme_conf_comp_t conf); @@ -114,5 +129,8 @@ extern struct engine_ops _gpgme_engine_o #ifdef ENABLE_GPGCONF extern struct engine_ops _gpgme_engine_ops_gpgconf; /* gpg-conf. */ #endif +#ifdef ENABLE_GPGSM /* If this is enabled we also have assuan support. */ +extern struct engine_ops _gpgme_engine_ops_assuan; /* Low-level Assuan. */ +#endif #endif /* ENGINE_BACKEND_H */ diff -urpNP gpgme-1.1.8/src/engine-gpg.c gpgme-1.2.0/src/engine-gpg.c --- gpgme-1.1.8/src/engine-gpg.c 1970-01-01 00:00:00.000000000 +0000 +++ gpgme-1.2.0/src/engine-gpg.c 2009-06-17 12:36:07.000000000 +0000 @@ -0,0 +1,2369 @@ +/* engine-gpg.c - Gpg Engine. + Copyright (C) 2000 Werner Koch (dd9jn) + Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, + 2009 g10 Code GmbH + + This file is part of GPGME. + + GPGME is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2.1 of + the License, or (at your option) any later version. + + GPGME is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this program; if not, see . +*/ + +#if HAVE_CONFIG_H +#include +#endif +#include +#include +#include +#include +#include +#include +#include + +#include "gpgme.h" +#include "util.h" +#include "ops.h" +#include "wait.h" +#include "context.h" /*temp hack until we have GpmeData methods to do I/O */ +#include "priv-io.h" +#include "sema.h" +#include "debug.h" + +#include "status-table.h" +#include "engine-backend.h" + + +/* This type is used to build a list of gpg arguments and data + sources/sinks. */ +struct arg_and_data_s +{ + struct arg_and_data_s *next; + gpgme_data_t data; /* If this is not NULL, use arg below. */ + int inbound; /* True if this is used for reading from gpg. */ + int dup_to; + int print_fd; /* Print the fd number and not the special form of it. */ + int *arg_locp; /* Write back the argv idx of this argument when + building command line to this location. */ + char arg[1]; /* Used if data above is not used. */ +}; + + +struct fd_data_map_s +{ + gpgme_data_t data; + int inbound; /* true if this is used for reading from gpg */ + int dup_to; + int fd; /* the fd to use */ + int peer_fd; /* the other side of the pipe */ + int arg_loc; /* The index into the argv for translation purposes. */ + void *tag; +}; + + +typedef gpgme_error_t (*colon_preprocessor_t) (char *line, char **rline); + +struct engine_gpg +{ + char *file_name; + + char *lc_messages; + char *lc_ctype; + + struct arg_and_data_s *arglist; + struct arg_and_data_s **argtail; + + struct + { + int fd[2]; + int arg_loc; + size_t bufsize; + char *buffer; + size_t readpos; + int eof; + engine_status_handler_t fnc; + void *fnc_value; + void *tag; + } status; + + /* This is a kludge - see the comment at colon_line_handler. */ + struct + { + int fd[2]; + int arg_loc; + size_t bufsize; + char *buffer; + size_t readpos; + int eof; + engine_colon_line_handler_t fnc; /* this indicate use of this structrue */ + void *fnc_value; + void *tag; + colon_preprocessor_t preprocess_fnc; + } colon; + + char **argv; + struct fd_data_map_s *fd_data_map; + + /* stuff needed for interactive (command) mode */ + struct + { + int used; + int fd; + void *cb_data; + int idx; /* Index in fd_data_map */ + gpgme_status_code_t code; /* last code */ + char *keyword; /* what has been requested (malloced) */ + engine_command_handler_t fnc; + void *fnc_value; + /* The kludges never end. This is used to couple command handlers + with output data in edit key mode. */ + gpgme_data_t linked_data; + int linked_idx; + } cmd; + + struct gpgme_io_cbs io_cbs; +}; + +typedef struct engine_gpg *engine_gpg_t; + + +static void +gpg_io_event (void *engine, gpgme_event_io_t type, void *type_data) +{ + engine_gpg_t gpg = engine; + + TRACE3 (DEBUG_ENGINE, "gpgme:gpg_io_event", gpg, + "event %p, type %d, type_data %p", + gpg->io_cbs.event, type, type_data); + if (gpg->io_cbs.event) + (*gpg->io_cbs.event) (gpg->io_cbs.event_priv, type, type_data); +} + + +static void +close_notify_handler (int fd, void *opaque) +{ + engine_gpg_t gpg = opaque; + assert (fd != -1); + + if (gpg->status.fd[0] == fd) + { + if (gpg->status.tag) + (*gpg->io_cbs.remove) (gpg->status.tag); + gpg->status.fd[0] = -1; + } + else if (gpg->status.fd[1] == fd) + gpg->status.fd[1] = -1; + else if (gpg->colon.fd[0] == fd) + { + if (gpg->colon.tag) + (*gpg->io_cbs.remove) (gpg->colon.tag); + gpg->colon.fd[0] = -1; + } + else if (gpg->colon.fd[1] == fd) + gpg->colon.fd[1] = -1; + else if (gpg->cmd.fd == fd) + gpg->cmd.fd = -1; + else if (gpg->fd_data_map) + { + int i; + + for (i = 0; gpg->fd_data_map[i].data; i++) + { + if (gpg->fd_data_map[i].fd == fd) + { + if (gpg->fd_data_map[i].tag) + (*gpg->io_cbs.remove) (gpg->fd_data_map[i].tag); + gpg->fd_data_map[i].fd = -1; + break; + } + if (gpg->fd_data_map[i].peer_fd == fd) + { + gpg->fd_data_map[i].peer_fd = -1; + break; + } + } + } +} + +/* If FRONT is true, push at the front of the list. Use this for + options added late in the process. */ +static gpgme_error_t +_add_arg (engine_gpg_t gpg, const char *arg, int front, int *arg_locp) +{ + struct arg_and_data_s *a; + + assert (gpg); + assert (arg); + + a = malloc (sizeof *a + strlen (arg)); + if (!a) + return gpg_error_from_errno (errno); + + a->data = NULL; + a->dup_to = -1; + a->arg_locp = arg_locp; + + strcpy (a->arg, arg); + if (front) + { + a->next = gpg->arglist; + if (!gpg->arglist) + { + /* If this is the first argument, we need to update the tail + pointer. */ + gpg->argtail = &a->next; + } + gpg->arglist = a; + } + else + { + a->next = NULL; + *gpg->argtail = a; + gpg->argtail = &a->next; + } + + return 0; +} + +static gpgme_error_t +add_arg_ext (engine_gpg_t gpg, const char *arg, int front) +{ + return _add_arg (gpg, arg, front, NULL); +} + + +static gpgme_error_t +add_arg_with_locp (engine_gpg_t gpg, const char *arg, int *locp) +{ + return _add_arg (gpg, arg, 0, locp); +} + + +static gpgme_error_t +add_arg (engine_gpg_t gpg, const char *arg) +{ + return add_arg_ext (gpg, arg, 0); +} + + +static gpgme_error_t +add_data (engine_gpg_t gpg, gpgme_data_t data, int dup_to, int inbound) +{ + struct arg_and_data_s *a; + + assert (gpg); + assert (data); + + a = malloc (sizeof *a - 1); + if (!a) + return gpg_error_from_errno (errno); + a->next = NULL; + a->data = data; + a->inbound = inbound; + a->arg_locp = NULL; + + if (dup_to == -2) + { + a->print_fd = 1; + a->dup_to = -1; + } + else + { + a->print_fd = 0; + a->dup_to = dup_to; + } + *gpg->argtail = a; + gpg->argtail = &a->next; + return 0; +} + + +static char * +gpg_get_version (const char *file_name) +{ + return _gpgme_get_program_version (file_name ? file_name + : _gpgme_get_gpg_path ()); +} + + +static const char * +gpg_get_req_version (void) +{ + return NEED_GPG_VERSION; +} + + +static void +free_argv (char **argv) +{ + int i; + + for (i = 0; argv[i]; i++) + free (argv[i]); + free (argv); +} + + +static void +free_fd_data_map (struct fd_data_map_s *fd_data_map) +{ + int i; + + if (!fd_data_map) + return; + + for (i = 0; fd_data_map[i].data; i++) + { + if (fd_data_map[i].fd != -1) + _gpgme_io_close (fd_data_map[i].fd); + if (fd_data_map[i].peer_fd != -1) + _gpgme_io_close (fd_data_map[i].peer_fd); + /* Don't release data because this is only a reference. */ + } + free (fd_data_map); +} + + +static gpgme_error_t +gpg_cancel (void *engine) +{ + engine_gpg_t gpg = engine; + + if (!gpg) + return gpg_error (GPG_ERR_INV_VALUE); + + /* If gpg may be waiting for a cmd, close the cmd fd first. On + Windows, close operations block on the reader/writer thread. */ + if (gpg->cmd.used) + { + if (gpg->cmd.fd != -1) + _gpgme_io_close (gpg->cmd.fd); + else if (gpg->fd_data_map + && gpg->fd_data_map[gpg->cmd.idx].fd != -1) + _gpgme_io_close (gpg->fd_data_map[gpg->cmd.idx].fd); + } + + if (gpg->status.fd[0] != -1) + _gpgme_io_close (gpg->status.fd[0]); + if (gpg->status.fd[1] != -1) + _gpgme_io_close (gpg->status.fd[1]); + if (gpg->colon.fd[0] != -1) + _gpgme_io_close (gpg->colon.fd[0]); + if (gpg->colon.fd[1] != -1) + _gpgme_io_close (gpg->colon.fd[1]); + if (gpg->fd_data_map) + { + free_fd_data_map (gpg->fd_data_map); + gpg->fd_data_map = NULL; + } + + return 0; +} + +static void +gpg_release (void *engine) +{ + engine_gpg_t gpg = engine; + + if (!gpg) + return; + + gpg_cancel (engine); + + if (gpg->file_name) + free (gpg->file_name); + + if (gpg->lc_messages) + free (gpg->lc_messages); + if (gpg->lc_ctype) + free (gpg->lc_ctype); + + while (gpg->arglist) + { + struct arg_and_data_s *next = gpg->arglist->next; + + if (gpg->arglist) + free (gpg->arglist); + gpg->arglist = next; + } + + if (gpg->status.buffer) + free (gpg->status.buffer); + if (gpg->colon.buffer) + free (gpg->colon.buffer); + if (gpg->argv) + free_argv (gpg->argv); + if (gpg->cmd.keyword) + free (gpg->cmd.keyword); + + free (gpg); +} + + +static gpgme_error_t +gpg_new (void **engine, const char *file_name, const char *home_dir) +{ + engine_gpg_t gpg; + gpgme_error_t rc = 0; + char *dft_display = NULL; + char dft_ttyname[64]; + char *dft_ttytype = NULL; + + gpg = calloc (1, sizeof *gpg); + if (!gpg) + return gpg_error_from_errno (errno); + + if (file_name) + { + gpg->file_name = strdup (file_name); + if (!gpg->file_name) + { + rc = gpg_error_from_errno (errno); + goto leave; + } + } + + gpg->argtail = &gpg->arglist; + gpg->status.fd[0] = -1; + gpg->status.fd[1] = -1; + gpg->colon.fd[0] = -1; + gpg->colon.fd[1] = -1; + gpg->cmd.fd = -1; + gpg->cmd.idx = -1; + gpg->cmd.linked_data = NULL; + gpg->cmd.linked_idx = -1; + + /* Allocate the read buffer for the status pipe. */ + gpg->status.bufsize = 1024; + gpg->status.readpos = 0; + gpg->status.buffer = malloc (gpg->status.bufsize); + if (!gpg->status.buffer) + { + rc = gpg_error_from_errno (errno); + goto leave; + } + /* In any case we need a status pipe - create it right here and + don't handle it with our generic gpgme_data_t mechanism. */ + if (_gpgme_io_pipe (gpg->status.fd, 1) == -1) + { + rc = gpg_error_from_errno (errno); + goto leave; + } + if (_gpgme_io_set_close_notify (gpg->status.fd[0], + close_notify_handler, gpg) + || _gpgme_io_set_close_notify (gpg->status.fd[1], + close_notify_handler, gpg)) + { + rc = gpg_error (GPG_ERR_GENERAL); + goto leave; + } + gpg->status.eof = 0; + + if (home_dir) + { + rc = add_arg (gpg, "--homedir"); + if (!rc) + rc = add_arg (gpg, home_dir); + if (rc) + goto leave; + } + + rc = add_arg (gpg, "--status-fd"); + if (rc) + goto leave; + + { + char buf[25]; + _gpgme_io_fd2str (buf, sizeof (buf), gpg->status.fd[1]); + rc = add_arg_with_locp (gpg, buf, &gpg->status.arg_loc); + if (rc) + goto leave; + } + + rc = add_arg (gpg, "--no-tty"); + if (!rc) + rc = add_arg (gpg, "--charset"); + if (!rc) + rc = add_arg (gpg, "utf8"); + if (!rc) + rc = add_arg (gpg, "--enable-progress-filter"); + if (rc) + goto leave; + + rc = _gpgme_getenv ("DISPLAY", &dft_display); + if (rc) + goto leave; + if (dft_display) + { + rc = add_arg (gpg, "--display"); + if (!rc) + rc = add_arg (gpg, dft_display); + + free (dft_display); + } + + if (isatty (1)) + { + int err; + + err = ttyname_r (1, dft_ttyname, sizeof (dft_ttyname)); + if (err) + rc = gpg_error_from_errno (err); + else + { + if (*dft_ttyname) + { + rc = add_arg (gpg, "--ttyname"); + if (!rc) + rc = add_arg (gpg, dft_ttyname); + } + else + rc = 0; + if (!rc) + { + rc = _gpgme_getenv ("TERM", &dft_ttytype); + if (rc) + goto leave; + + if (dft_ttytype) + { + rc = add_arg (gpg, "--ttytype"); + if (!rc) + rc = add_arg (gpg, dft_ttytype); + } + + free (dft_ttytype); + } + } + if (rc) + goto leave; + } + + leave: + if (rc) + gpg_release (gpg); + else + *engine = gpg; + return rc; +} + + +static gpgme_error_t +gpg_set_locale (void *engine, int category, const char *value) +{ + engine_gpg_t gpg = engine; + + if (category == LC_CTYPE) + { + if (gpg->lc_ctype) + { + free (gpg->lc_ctype); + gpg->lc_ctype = NULL; + } + if (value) + { + gpg->lc_ctype = strdup (value); + if (!gpg->lc_ctype) + return gpg_error_from_syserror (); + } + } +#ifdef LC_MESSAGES + else if (category == LC_MESSAGES) + { + if (gpg->lc_messages) + { + free (gpg->lc_messages); + gpg->lc_messages = NULL; + } + if (value) + { + gpg->lc_messages = strdup (value); + if (!gpg->lc_messages) + return gpg_error_from_syserror (); + } + } +#endif /* LC_MESSAGES */ + else + return gpg_error (GPG_ERR_INV_VALUE); + + return 0; +} + + +/* Note, that the status_handler is allowed to modifiy the args + value. */ +static void +gpg_set_status_handler (void *engine, engine_status_handler_t fnc, + void *fnc_value) +{ + engine_gpg_t gpg = engine; + + gpg->status.fnc = fnc; + gpg->status.fnc_value = fnc_value; +} + +/* Kludge to process --with-colon output. */ +static gpgme_error_t +gpg_set_colon_line_handler (void *engine, engine_colon_line_handler_t fnc, + void *fnc_value) +{ + engine_gpg_t gpg = engine; + + gpg->colon.bufsize = 1024; + gpg->colon.readpos = 0; + gpg->colon.buffer = malloc (gpg->colon.bufsize); + if (!gpg->colon.buffer) + return gpg_error_from_errno (errno); + + if (_gpgme_io_pipe (gpg->colon.fd, 1) == -1) + { + int saved_errno = errno; + free (gpg->colon.buffer); + gpg->colon.buffer = NULL; + return gpg_error_from_errno (saved_errno); + } + if (_gpgme_io_set_close_notify (gpg->colon.fd[0], close_notify_handler, gpg) + || _gpgme_io_set_close_notify (gpg->colon.fd[1], + close_notify_handler, gpg)) + return gpg_error (GPG_ERR_GENERAL); + gpg->colon.eof = 0; + gpg->colon.fnc = fnc; + gpg->colon.fnc_value = fnc_value; + return 0; +} + + +static gpgme_error_t +command_handler (void *opaque, int fd) +{ + gpgme_error_t err; + engine_gpg_t gpg = (engine_gpg_t) opaque; + int processed = 0; + + assert (gpg->cmd.used); + assert (gpg->cmd.code); + assert (gpg->cmd.fnc); + + err = gpg->cmd.fnc (gpg->cmd.fnc_value, gpg->cmd.code, gpg->cmd.keyword, fd, + &processed); + + gpg->cmd.code = 0; + /* And sleep again until read_status will wake us up again. */ + /* XXX We must check if there are any more fds active after removing + this one. */ + (*gpg->io_cbs.remove) (gpg->fd_data_map[gpg->cmd.idx].tag); + gpg->cmd.fd = gpg->fd_data_map[gpg->cmd.idx].fd; + gpg->fd_data_map[gpg->cmd.idx].fd = -1; + + if (err) + return err; + + /* We always need to send at least a newline character. */ + if (!processed) + _gpgme_io_write (fd, "\n", 1); + + return 0; +} + + + +/* The Fnc will be called to get a value for one of the commands with + a key KEY. If the Code passed to FNC is 0, the function may release + resources associated with the returned value from another call. To + match such a second call to a first call, the returned value from + the first call is passed as keyword. */ +static gpgme_error_t +gpg_set_command_handler (void *engine, engine_command_handler_t fnc, + void *fnc_value, gpgme_data_t linked_data) +{ + engine_gpg_t gpg = engine; + gpgme_error_t rc; + + rc = add_arg (gpg, "--command-fd"); + if (rc) + return rc; + + /* This is a hack. We don't have a real data object. The only + thing that matters is that we use something unique, so we use the + address of the cmd structure in the gpg object. */ + rc = add_data (gpg, (void *) &gpg->cmd, -2, 0); + if (rc) + return rc; + + gpg->cmd.fnc = fnc; + gpg->cmd.cb_data = (void *) &gpg->cmd; + gpg->cmd.fnc_value = fnc_value; + gpg->cmd.linked_data = linked_data; + gpg->cmd.used = 1; + return 0; +} + + +static gpgme_error_t +build_argv (engine_gpg_t gpg) +{ + gpgme_error_t err; + struct arg_and_data_s *a; + struct fd_data_map_s *fd_data_map; + size_t datac=0, argc=0; + char **argv; + int need_special = 0; + int use_agent = 0; + char *p; + + /* We don't want to use the agent with a malformed environment + variable. This is only a very basic test but sufficient to make + our life in the regression tests easier. */ + err = _gpgme_getenv ("GPG_AGENT_INFO", &p); + if (err) + return err; + use_agent = (p && strchr (p, ':')); + if (p) + free (p); + + if (gpg->argv) + { + free_argv (gpg->argv); + gpg->argv = NULL; + } + if (gpg->fd_data_map) + { + free_fd_data_map (gpg->fd_data_map); + gpg->fd_data_map = NULL; + } + + argc++; /* For argv[0]. */ + for (a = gpg->arglist; a; a = a->next) + { + argc++; + if (a->data) + { + /*fprintf (stderr, "build_argv: data\n" );*/ + datac++; + if (a->dup_to == -1 && !a->print_fd) + need_special = 1; + } + else + { + /* fprintf (stderr, "build_argv: arg=`%s'\n", a->arg );*/ + } + } + if (need_special) + argc++; + if (use_agent) + argc++; + if (!gpg->cmd.used) + argc++; /* --batch */ + argc += 1; /* --no-sk-comment */ + + argv = calloc (argc + 1, sizeof *argv); + if (!argv) + return gpg_error_from_errno (errno); + fd_data_map = calloc (datac + 1, sizeof *fd_data_map); + if (!fd_data_map) + { + int saved_errno = errno; + free_argv (argv); + return gpg_error_from_errno (saved_errno); + } + + argc = datac = 0; + argv[argc] = strdup ("gpg"); /* argv[0] */ + if (!argv[argc]) + { + int saved_errno = errno; + free (fd_data_map); + free_argv (argv); + return gpg_error_from_errno (saved_errno); + } + argc++; + if (need_special) + { + argv[argc] = strdup ("--enable-special-filenames"); + if (!argv[argc]) + { + int saved_errno = errno; + free (fd_data_map); + free_argv (argv); + return gpg_error_from_errno (saved_errno); + } + argc++; + } + if (use_agent) + { + argv[argc] = strdup ("--use-agent"); + if (!argv[argc]) + { + int saved_errno = errno; + free (fd_data_map); + free_argv (argv); + return gpg_error_from_errno (saved_errno); + } + argc++; + } + if (!gpg->cmd.used) + { + argv[argc] = strdup ("--batch"); + if (!argv[argc]) + { + int saved_errno = errno; + free (fd_data_map); + free_argv (argv); + return gpg_error_from_errno (saved_errno); + } + argc++; + } + argv[argc] = strdup ("--no-sk-comment"); + if (!argv[argc]) + { + int saved_errno = errno; + free (fd_data_map); + free_argv (argv); + return gpg_error_from_errno (saved_errno); + } + argc++; + for (a = gpg->arglist; a; a = a->next) + { + if (a->arg_locp) + *(a->arg_locp) = argc; + + if (a->data) + { + /* Create a pipe to pass it down to gpg. */ + fd_data_map[datac].inbound = a->inbound; + + /* Create a pipe. */ + { + int fds[2]; + + if (_gpgme_io_pipe (fds, fd_data_map[datac].inbound ? 1 : 0) + == -1) + { + int saved_errno = errno; + free (fd_data_map); + free_argv (argv); + return gpg_error (saved_errno); + } + if (_gpgme_io_set_close_notify (fds[0], + close_notify_handler, gpg) + || _gpgme_io_set_close_notify (fds[1], + close_notify_handler, + gpg)) + { + return gpg_error (GPG_ERR_GENERAL); + } + /* If the data_type is FD, we have to do a dup2 here. */ + if (fd_data_map[datac].inbound) + { + fd_data_map[datac].fd = fds[0]; + fd_data_map[datac].peer_fd = fds[1]; + } + else + { + fd_data_map[datac].fd = fds[1]; + fd_data_map[datac].peer_fd = fds[0]; + } + } + + /* Hack to get hands on the fd later. */ + if (gpg->cmd.used) + { + if (gpg->cmd.cb_data == a->data) + { + assert (gpg->cmd.idx == -1); + gpg->cmd.idx = datac; + } + else if (gpg->cmd.linked_data == a->data) + { + assert (gpg->cmd.linked_idx == -1); + gpg->cmd.linked_idx = datac; + } + } + + fd_data_map[datac].data = a->data; + fd_data_map[datac].dup_to = a->dup_to; + + if (a->dup_to == -1) + { + char *ptr; + int buflen = 25; + + argv[argc] = malloc (buflen); + if (!argv[argc]) + { + int saved_errno = errno; + free (fd_data_map); + free_argv (argv); + return gpg_error_from_errno (saved_errno); + } + + ptr = argv[argc]; + if (!a->print_fd) + { + *(ptr++) = '-'; + *(ptr++) = '&'; + buflen -= 2; + } + + _gpgme_io_fd2str (ptr, buflen, fd_data_map[datac].peer_fd); + fd_data_map[datac].arg_loc = argc; + argc++; + } + datac++; + } + else + { + argv[argc] = strdup (a->arg); + if (!argv[argc]) + { + int saved_errno = errno; + free (fd_data_map); + free_argv (argv); + return gpg_error_from_errno (saved_errno); + } + argc++; + } + } + + gpg->argv = argv; + gpg->fd_data_map = fd_data_map; + return 0; +} + + +static gpgme_error_t +add_io_cb (engine_gpg_t gpg, int fd, int dir, gpgme_io_cb_t handler, void *data, + void **tag) +{ + gpgme_error_t err; + + err = (*gpg->io_cbs.add) (gpg->io_cbs.add_priv, fd, dir, handler, data, tag); + if (err) + return err; + if (!dir) + /* FIXME Kludge around poll() problem. */ + err = _gpgme_io_set_nonblocking (fd); + return err; +} + + +static int +status_cmp (const void *ap, const void *bp) +{ + const struct status_table_s *a = ap; + const struct status_table_s *b = bp; + + return strcmp (a->name, b->name); +} + + +/* Handle the status output of GnuPG. This function does read entire + lines and passes them as C strings to the callback function (we can + use C Strings because the status output is always UTF-8 encoded). + Of course we have to buffer the lines to cope with long lines + e.g. with a large user ID. Note: We can optimize this to only cope + with status line code we know about and skip all other stuff + without buffering (i.e. without extending the buffer). */ +static gpgme_error_t +read_status (engine_gpg_t gpg) +{ + char *p; + int nread; + size_t bufsize = gpg->status.bufsize; + char *buffer = gpg->status.buffer; + size_t readpos = gpg->status.readpos; + + assert (buffer); + if (bufsize - readpos < 256) + { + /* Need more room for the read. */ + bufsize += 1024; + buffer = realloc (buffer, bufsize); + if (!buffer) + return gpg_error_from_errno (errno); + } + + nread = _gpgme_io_read (gpg->status.fd[0], + buffer + readpos, bufsize-readpos); + if (nread == -1) + return gpg_error_from_errno (errno); + + if (!nread) + { + gpg->status.eof = 1; + if (gpg->status.fnc) + { + gpgme_error_t err; + err = gpg->status.fnc (gpg->status.fnc_value, GPGME_STATUS_EOF, ""); + if (err) + return err; + } + return 0; + } + + while (nread > 0) + { + for (p = buffer + readpos; nread; nread--, p++) + { + if (*p == '\n') + { + /* (we require that the last line is terminated by a LF) */ + if (p > buffer && p[-1] == '\r') + p[-1] = 0; + *p = 0; + if (!strncmp (buffer, "[GNUPG:] ", 9) + && buffer[9] >= 'A' && buffer[9] <= 'Z') + { + struct status_table_s t, *r; + char *rest; + + rest = strchr (buffer + 9, ' '); + if (!rest) + rest = p; /* Set to an empty string. */ + else + *rest++ = 0; + + t.name = buffer+9; + /* (the status table has one extra element) */ + r = bsearch (&t, status_table, DIM(status_table) - 1, + sizeof t, status_cmp); + if (r) + { + if (gpg->cmd.used + && (r->code == GPGME_STATUS_GET_BOOL + || r->code == GPGME_STATUS_GET_LINE + || r->code == GPGME_STATUS_GET_HIDDEN)) + { + gpg->cmd.code = r->code; + if (gpg->cmd.keyword) + free (gpg->cmd.keyword); + gpg->cmd.keyword = strdup (rest); + if (!gpg->cmd.keyword) + return gpg_error_from_errno (errno); + /* This should be the last thing we have + received and the next thing will be that + the command handler does its action. */ + if (nread > 1) + TRACE0 (DEBUG_CTX, "gpgme:read_status", 0, + "error: unexpected data"); + + add_io_cb (gpg, gpg->cmd.fd, 0, + command_handler, gpg, + &gpg->fd_data_map[gpg->cmd.idx].tag); + gpg->fd_data_map[gpg->cmd.idx].fd = gpg->cmd.fd; + gpg->cmd.fd = -1; + } + else if (gpg->status.fnc) + { + gpgme_error_t err; + err = gpg->status.fnc (gpg->status.fnc_value, + r->code, rest); + if (err) + return err; + } + + if (r->code == GPGME_STATUS_END_STREAM) + { + if (gpg->cmd.used) + { + /* Before we can actually add the + command fd, we might have to flush + the linked output data pipe. */ + if (gpg->cmd.linked_idx != -1 + && gpg->fd_data_map[gpg->cmd.linked_idx].fd + != -1) + { + struct io_select_fd_s fds; + fds.fd = + gpg->fd_data_map[gpg->cmd.linked_idx].fd; + fds.for_read = 1; + fds.for_write = 0; + fds.opaque = NULL; + do + { + fds.signaled = 0; + _gpgme_io_select (&fds, 1, 1); + if (fds.signaled) + _gpgme_data_inbound_handler + (gpg->cmd.linked_data, fds.fd); + } + while (fds.signaled); + } + + /* XXX We must check if there are any + more fds active after removing this + one. */ + (*gpg->io_cbs.remove) + (gpg->fd_data_map[gpg->cmd.idx].tag); + gpg->cmd.fd = gpg->fd_data_map[gpg->cmd.idx].fd; + gpg->fd_data_map[gpg->cmd.idx].fd = -1; + } + } + } + } + /* To reuse the buffer for the next line we have to + shift the remaining data to the buffer start and + restart the loop Hmmm: We can optimize this function + by looking forward in the buffer to see whether a + second complete line is available and in this case + avoid the memmove for this line. */ + nread--; p++; + if (nread) + memmove (buffer, p, nread); + readpos = 0; + break; /* the for loop */ + } + else + readpos++; + } + } + + /* Update the gpg object. */ + gpg->status.bufsize = bufsize; + gpg->status.buffer = buffer; + gpg->status.readpos = readpos; + return 0; +} + + +static gpgme_error_t +status_handler (void *opaque, int fd) +{ + engine_gpg_t gpg = opaque; + int err; + + assert (fd == gpg->status.fd[0]); + err = read_status (gpg); + if (err) + return err; + if (gpg->status.eof) + _gpgme_io_close (fd); + return 0; +} + + +static gpgme_error_t +read_colon_line (engine_gpg_t gpg) +{ + char *p; + int nread; + size_t bufsize = gpg->colon.bufsize; + char *buffer = gpg->colon.buffer; + size_t readpos = gpg->colon.readpos; + + assert (buffer); + if (bufsize - readpos < 256) + { + /* Need more room for the read. */ + bufsize += 1024; + buffer = realloc (buffer, bufsize); + if (!buffer) + return gpg_error_from_errno (errno); + } + + nread = _gpgme_io_read (gpg->colon.fd[0], buffer+readpos, bufsize-readpos); + if (nread == -1) + return gpg_error_from_errno (errno); + + if (!nread) + { + gpg->colon.eof = 1; + assert (gpg->colon.fnc); + gpg->colon.fnc (gpg->colon.fnc_value, NULL); + return 0; + } + + while (nread > 0) + { + for (p = buffer + readpos; nread; nread--, p++) + { + if ( *p == '\n' ) + { + /* (we require that the last line is terminated by a LF) + and we skip empty lines. Note: we use UTF8 encoding + and escaping of special characters. We require at + least one colon to cope with some other printed + information. */ + *p = 0; + if (*buffer && strchr (buffer, ':')) + { + char *line = NULL; + + if (gpg->colon.preprocess_fnc) + { + gpgme_error_t err; + + err = gpg->colon.preprocess_fnc (buffer, &line); + if (err) + return err; + } + + assert (gpg->colon.fnc); + gpg->colon.fnc (gpg->colon.fnc_value, line ? line : buffer); + if (line) + free (line); + } + + /* To reuse the buffer for the next line we have to + shift the remaining data to the buffer start and + restart the loop Hmmm: We can optimize this function + by looking forward in the buffer to see whether a + second complete line is available and in this case + avoid the memmove for this line. */ + nread--; p++; + if (nread) + memmove (buffer, p, nread); + readpos = 0; + break; /* The for loop. */ + } + else + readpos++; + } + } + + /* Update the gpg object. */ + gpg->colon.bufsize = bufsize; + gpg->colon.buffer = buffer; + gpg->colon.readpos = readpos; + return 0; +} + + +/* This colonline handler thing is not the clean way to do it. It + might be better to enhance the gpgme_data_t object to act as a wrapper + for a callback. Same goes for the status thing. For now we use + this thing here because it is easier to implement. */ +static gpgme_error_t +colon_line_handler (void *opaque, int fd) +{ + engine_gpg_t gpg = opaque; + gpgme_error_t rc = 0; + + assert (fd == gpg->colon.fd[0]); + rc = read_colon_line (gpg); + if (rc) + return rc; + if (gpg->colon.eof) + _gpgme_io_close (fd); + return 0; +} + + +static gpgme_error_t +start (engine_gpg_t gpg) +{ + gpgme_error_t rc; + int saved_errno; + int i, n; + int status; + struct spawn_fd_item_s *fd_list; + pid_t pid; + + if (!gpg) + return gpg_error (GPG_ERR_INV_VALUE); + + if (!gpg->file_name && !_gpgme_get_gpg_path ()) + return gpg_error (GPG_ERR_INV_ENGINE); + + if (gpg->lc_ctype) + { + rc = add_arg_ext (gpg, gpg->lc_ctype, 1); + if (!rc) + rc = add_arg_ext (gpg, "--lc-ctype", 1); + if (rc) + return rc; + } + + if (gpg->lc_messages) + { + rc = add_arg_ext (gpg, gpg->lc_messages, 1); + if (!rc) + rc = add_arg_ext (gpg, "--lc-messages", 1); + if (rc) + return rc; + } + + rc = build_argv (gpg); + if (rc) + return rc; + + /* status_fd, colon_fd and end of list. */ + n = 3; + for (i = 0; gpg->fd_data_map[i].data; i++) + n++; + fd_list = calloc (n, sizeof *fd_list); + if (! fd_list) + return gpg_error_from_errno (errno); + + /* Build the fd list for the child. */ + n = 0; + fd_list[n].fd = gpg->status.fd[1]; + fd_list[n].dup_to = -1; + fd_list[n].arg_loc = gpg->status.arg_loc; + n++; + if (gpg->colon.fnc) + { + fd_list[n].fd = gpg->colon.fd[1]; + fd_list[n].dup_to = 1; + n++; + } + for (i = 0; gpg->fd_data_map[i].data; i++) + { + fd_list[n].fd = gpg->fd_data_map[i].peer_fd; + fd_list[n].dup_to = gpg->fd_data_map[i].dup_to; + fd_list[n].arg_loc = gpg->fd_data_map[i].arg_loc; + n++; + } + fd_list[n].fd = -1; + fd_list[n].dup_to = -1; + + status = _gpgme_io_spawn (gpg->file_name ? gpg->file_name : + _gpgme_get_gpg_path (), gpg->argv, + IOSPAWN_FLAG_ALLOW_SET_FG, + fd_list, &pid); + saved_errno = errno; + + free (fd_list); + if (status == -1) + return gpg_error_from_errno (saved_errno); + + /*_gpgme_register_term_handler ( closure, closure_value, pid );*/ + + rc = add_io_cb (gpg, gpg->status.fd[0], 1, status_handler, gpg, + &gpg->status.tag); + if (rc) + /* FIXME: kill the child */ + return rc; + + if (gpg->colon.fnc) + { + assert (gpg->colon.fd[0] != -1); + rc = add_io_cb (gpg, gpg->colon.fd[0], 1, colon_line_handler, gpg, + &gpg->colon.tag); + if (rc) + /* FIXME: kill the child */ + return rc; + } + + for (i = 0; gpg->fd_data_map[i].data; i++) + { + if (gpg->cmd.used && i == gpg->cmd.idx) + { + /* Park the cmd fd. */ + gpg->cmd.fd = gpg->fd_data_map[i].fd; + gpg->fd_data_map[i].fd = -1; + } + else + { + rc = add_io_cb (gpg, gpg->fd_data_map[i].fd, + gpg->fd_data_map[i].inbound, + gpg->fd_data_map[i].inbound + ? _gpgme_data_inbound_handler + : _gpgme_data_outbound_handler, + gpg->fd_data_map[i].data, &gpg->fd_data_map[i].tag); + + if (rc) + /* FIXME: kill the child */ + return rc; + } + } + + gpg_io_event (gpg, GPGME_EVENT_START, NULL); + + /* fixme: check what data we can release here */ + return 0; +} + + +static gpgme_error_t +gpg_decrypt (void *engine, gpgme_data_t ciph, gpgme_data_t plain) +{ + engine_gpg_t gpg = engine; + gpgme_error_t err; + + err = add_arg (gpg, "--decrypt"); + + /* Tell the gpg object about the data. */ + if (!err) + err = add_arg (gpg, "--output"); + if (!err) + err = add_arg (gpg, "-"); + if (!err) + err = add_data (gpg, plain, 1, 1); + if (!err) + err = add_arg (gpg, "--"); + if (!err) + err = add_data (gpg, ciph, -1, 0); + + if (!err) + start (gpg); + return err; +} + +static gpgme_error_t +gpg_delete (void *engine, gpgme_key_t key, int allow_secret) +{ + engine_gpg_t gpg = engine; + gpgme_error_t err; + + err = add_arg (gpg, allow_secret ? "--delete-secret-and-public-key" + : "--delete-key"); + if (!err) + err = add_arg (gpg, "--"); + if (!err) + { + if (!key->subkeys || !key->subkeys->fpr) + return gpg_error (GPG_ERR_INV_VALUE); + else + err = add_arg (gpg, key->subkeys->fpr); + } + + if (!err) + start (gpg); + return err; +} + + +static gpgme_error_t +append_args_from_signers (engine_gpg_t gpg, gpgme_ctx_t ctx /* FIXME */) +{ + gpgme_error_t err = 0; + int i; + gpgme_key_t key; + + for (i = 0; (key = gpgme_signers_enum (ctx, i)); i++) + { + const char *s = key->subkeys ? key->subkeys->keyid : NULL; + if (s) + { + if (!err) + err = add_arg (gpg, "-u"); + if (!err) + err = add_arg (gpg, s); + } + gpgme_key_unref (key); + if (err) break; + } + return err; +} + + +static gpgme_error_t +append_args_from_sig_notations (engine_gpg_t gpg, gpgme_ctx_t ctx /* FIXME */) +{ + gpgme_error_t err = 0; + gpgme_sig_notation_t notation; + + notation = gpgme_sig_notation_get (ctx); + + while (!err && notation) + { + if (notation->name + && !(notation->flags & GPGME_SIG_NOTATION_HUMAN_READABLE)) + err = gpg_error (GPG_ERR_INV_VALUE); + else if (notation->name) + { + char *arg; + + /* Maximum space needed is one byte for the "critical" flag, + the name, one byte for '=', the value, and a terminating + '\0'. */ + + arg = malloc (1 + notation->name_len + 1 + notation->value_len + 1); + if (!arg) + err = gpg_error_from_errno (errno); + + if (!err) + { + char *argp = arg; + + if (notation->critical) + *(argp++) = '!'; + + memcpy (argp, notation->name, notation->name_len); + argp += notation->name_len; + + *(argp++) = '='; + + /* We know that notation->name is '\0' terminated. */ + strcpy (argp, notation->value); + } + + if (!err) + err = add_arg (gpg, "--sig-notation"); + if (!err) + err = add_arg (gpg, arg); + + if (arg) + free (arg); + } + else + { + /* This is a policy URL. */ + + char *value; + + if (notation->critical) + { + value = malloc (1 + notation->value_len + 1); + if (!value) + err = gpg_error_from_errno (errno); + else + { + value[0] = '!'; + /* We know that notation->value is '\0' terminated. */ + strcpy (&value[1], notation->value); + } + } + else + value = notation->value; + + if (!err) + err = add_arg (gpg, "--sig-policy-url"); + if (!err) + err = add_arg (gpg, value); + + if (value != notation->value) + free (value); + } + + notation = notation->next; + } + return err; +} + + +static gpgme_error_t +gpg_edit (void *engine, int type, gpgme_key_t key, gpgme_data_t out, + gpgme_ctx_t ctx /* FIXME */) +{ + engine_gpg_t gpg = engine; + gpgme_error_t err; + + err = add_arg (gpg, "--with-colons"); + if (!err) + err = append_args_from_signers (gpg, ctx); + if (!err) + err = add_arg (gpg, type == 0 ? "--edit-key" : "--card-edit"); + if (!err) + err = add_data (gpg, out, 1, 1); + if (!err) + err = add_arg (gpg, "--"); + if (!err && type == 0) + { + const char *s = key->subkeys ? key->subkeys->fpr : NULL; + if (!s) + err = gpg_error (GPG_ERR_INV_VALUE); + else + err = add_arg (gpg, s); + } + if (!err) + err = start (gpg); + + return err; +} + + +static gpgme_error_t +append_args_from_recipients (engine_gpg_t gpg, gpgme_key_t recp[]) +{ + gpgme_error_t err = 0; + int i = 0; + + while (recp[i]) + { + if (!recp[i]->subkeys || !recp[i]->subkeys->fpr) + err = gpg_error (GPG_ERR_INV_VALUE); + if (!err) + err = add_arg (gpg, "-r"); + if (!err) + err = add_arg (gpg, recp[i]->subkeys->fpr); + if (err) + break; + i++; + } + return err; +} + + +static gpgme_error_t +gpg_encrypt (void *engine, gpgme_key_t recp[], gpgme_encrypt_flags_t flags, + gpgme_data_t plain, gpgme_data_t ciph, int use_armor) +{ + engine_gpg_t gpg = engine; + gpgme_error_t err; + int symmetric = !recp; + + err = add_arg (gpg, symmetric ? "--symmetric" : "--encrypt"); + + if (!err && use_armor) + err = add_arg (gpg, "--armor"); + + if (!symmetric) + { + /* If we know that all recipients are valid (full or ultimate trust) + we can suppress further checks. */ + if (!err && (flags & GPGME_ENCRYPT_ALWAYS_TRUST)) + err = add_arg (gpg, "--always-trust"); + + if (!err && (flags & GPGME_ENCRYPT_NO_ENCRYPT_TO)) + err = add_arg (gpg, "--no-encrypt-to"); + + if (!err) + err = append_args_from_recipients (gpg, recp); + } + + /* Tell the gpg object about the data. */ + if (!err) + err = add_arg (gpg, "--output"); + if (!err) + err = add_arg (gpg, "-"); + if (!err) + err = add_data (gpg, ciph, 1, 1); + if (gpgme_data_get_file_name (plain)) + { + if (!err) + err = add_arg (gpg, "--set-filename"); + if (!err) + err = add_arg (gpg, gpgme_data_get_file_name (plain)); + } + if (!err) + err = add_arg (gpg, "--"); + if (!err) + err = add_data (gpg, plain, -1, 0); + + if (!err) + err = start (gpg); + + return err; +} + + +static gpgme_error_t +gpg_encrypt_sign (void *engine, gpgme_key_t recp[], + gpgme_encrypt_flags_t flags, gpgme_data_t plain, + gpgme_data_t ciph, int use_armor, + gpgme_ctx_t ctx /* FIXME */) +{ + engine_gpg_t gpg = engine; + gpgme_error_t err; + + err = add_arg (gpg, "--encrypt"); + if (!err) + err = add_arg (gpg, "--sign"); + if (!err && use_armor) + err = add_arg (gpg, "--armor"); + + /* If we know that all recipients are valid (full or ultimate trust) + we can suppress further checks. */ + if (!err && (flags & GPGME_ENCRYPT_ALWAYS_TRUST)) + err = add_arg (gpg, "--always-trust"); + + if (!err) + err = append_args_from_recipients (gpg, recp); + + if (!err) + err = append_args_from_signers (gpg, ctx); + if (!err) + err = append_args_from_sig_notations (gpg, ctx); + + /* Tell the gpg object about the data. */ + if (!err) + err = add_arg (gpg, "--output"); + if (!err) + err = add_arg (gpg, "-"); + if (!err) + err = add_data (gpg, ciph, 1, 1); + if (gpgme_data_get_file_name (plain)) + { + if (!err) + err = add_arg (gpg, "--set-filename"); + if (!err) + err = add_arg (gpg, gpgme_data_get_file_name (plain)); + } + if (!err) + err = add_arg (gpg, "--"); + if (!err) + err = add_data (gpg, plain, -1, 0); + + if (!err) + err = start (gpg); + + return err; +} + + +static gpgme_error_t +export_common (engine_gpg_t gpg, gpgme_export_mode_t mode, + gpgme_data_t keydata, int use_armor) +{ + gpgme_error_t err; + + if ((mode & ~GPGME_EXPORT_MODE_EXTERN)) + return gpg_error (GPG_ERR_NOT_SUPPORTED); + + if ((mode & GPGME_EXPORT_MODE_EXTERN)) + { + err = add_arg (gpg, "--send-keys"); + } + else + { + err = add_arg (gpg, "--export"); + if (!err && use_armor) + err = add_arg (gpg, "--armor"); + if (!err) + err = add_data (gpg, keydata, 1, 1); + } + if (!err) + err = add_arg (gpg, "--"); + + return err; +} + + +static gpgme_error_t +gpg_export (void *engine, const char *pattern, gpgme_export_mode_t mode, + gpgme_data_t keydata, int use_armor) +{ + engine_gpg_t gpg = engine; + gpgme_error_t err; + + err = export_common (gpg, mode, keydata, use_armor); + + if (!err && pattern && *pattern) + err = add_arg (gpg, pattern); + + if (!err) + err = start (gpg); + + return err; +} + + +static gpgme_error_t +gpg_export_ext (void *engine, const char *pattern[], gpgme_export_mode_t mode, + gpgme_data_t keydata, int use_armor) +{ + engine_gpg_t gpg = engine; + gpgme_error_t err; + + err = export_common (gpg, mode, keydata, use_armor); + + if (pattern) + { + while (!err && *pattern && **pattern) + err = add_arg (gpg, *(pattern++)); + } + + if (!err) + err = start (gpg); + + return err; +} + + +static gpgme_error_t +gpg_genkey (void *engine, gpgme_data_t help_data, int use_armor, + gpgme_data_t pubkey, gpgme_data_t seckey) +{ + engine_gpg_t gpg = engine; + gpgme_error_t err; + + if (!gpg) + return gpg_error (GPG_ERR_INV_VALUE); + + /* We need a special mechanism to get the fd of a pipe here, so that + we can use this for the %pubring and %secring parameters. We + don't have this yet, so we implement only the adding to the + standard keyrings. */ + if (pubkey || seckey) + return gpg_error (GPG_ERR_NOT_IMPLEMENTED); + + err = add_arg (gpg, "--gen-key"); + if (!err && use_armor) + err = add_arg (gpg, "--armor"); + if (!err) + err = add_arg (gpg, "--"); + if (!err) + err = add_data (gpg, help_data, -1, 0); + + if (!err) + err = start (gpg); + + return err; +} + +/* Return the next DELIM delimited string from DATA as a C-string. + The caller needs to provide the address of a pointer variable which + he has to set to NULL before the first call. After the last call + to this function, this function needs to be called once more with + DATA set to NULL so that the function can release its internal + state. After that the pointer variable is free for use again. + Note that we use a delimiter and thus a trailing delimiter is not + required. DELIM may not be changed after the first call. */ +static const char * +string_from_data (gpgme_data_t data, int delim, + void **helpptr, gpgme_error_t *r_err) +{ +#define MYBUFLEN 2000 /* Fixme: We don't support URLs longer than that. */ + struct { + int eof_seen; + int nbytes; /* Length of the last returned string including + the delimiter. */ + int buflen; /* Valid length of BUF. */ + char buf[MYBUFLEN+1]; /* Buffer with one byte extra space. */ + } *self; + char *p; + int nread; + + *r_err = 0; + if (!data) + { + if (*helpptr) + { + free (*helpptr); + *helpptr = NULL; + } + return NULL; + } + + if (*helpptr) + self = *helpptr; + else + { + self = malloc (sizeof *self); + if (!self) + { + *r_err = gpg_error_from_syserror (); + return NULL; + } + *helpptr = self; + self->eof_seen = 0; + self->nbytes = 0; + self->buflen = 0; + } + + if (self->eof_seen) + return NULL; + + assert (self->nbytes <= self->buflen); + memmove (self->buf, self->buf + self->nbytes, self->buflen - self->nbytes); + self->buflen -= self->nbytes; + self->nbytes = 0; + + do + { + /* Fixme: This is fairly infective scanning because we may scan + the buffer several times. */ + p = memchr (self->buf, delim, self->buflen); + if (p) + { + *p = 0; + self->nbytes = p - self->buf + 1; + return self->buf; + } + + if ( !(MYBUFLEN - self->buflen) ) + { + /* Not enough space - URL too long. */ + *r_err = gpg_error (GPG_ERR_TOO_LARGE); + return NULL; + } + + nread = gpgme_data_read (data, self->buf + self->buflen, + MYBUFLEN - self->buflen); + if (nread < 0) + { + *r_err = gpg_error_from_syserror (); + return NULL; + } + self->buflen += nread; + } + while (nread); + + /* EOF reached. If we have anything in the buffer, append a Nul and + return it. */ + self->eof_seen = 1; + if (self->buflen) + { + self->buf[self->buflen] = 0; /* (we allocated one extra byte) */ + return self->buf; + } + return NULL; +#undef MYBUFLEN +} + + + +static gpgme_error_t +gpg_import (void *engine, gpgme_data_t keydata, gpgme_key_t *keyarray) +{ + engine_gpg_t gpg = engine; + gpgme_error_t err; + int idx; + gpgme_data_encoding_t dataenc; + + if (keydata && keyarray) + gpg_error (GPG_ERR_INV_VALUE); /* Only one is allowed. */ + + dataenc = gpgme_data_get_encoding (keydata); + + if (keyarray) + { + err = add_arg (gpg, "--recv-keys"); + if (!err) + err = add_arg (gpg, "--"); + for (idx=0; !err && keyarray[idx]; idx++) + { + if (keyarray[idx]->protocol != GPGME_PROTOCOL_OpenPGP) + ; + else if (!keyarray[idx]->subkeys) + ; + else if (keyarray[idx]->subkeys->fpr && *keyarray[idx]->subkeys->fpr) + err = add_arg (gpg, keyarray[idx]->subkeys->fpr); + else if (*keyarray[idx]->subkeys->keyid) + err = add_arg (gpg, keyarray[idx]->subkeys->keyid); + } + } + else if (dataenc == GPGME_DATA_ENCODING_URL + || dataenc == GPGME_DATA_ENCODING_URL0) + { + void *helpptr; + const char *string; + gpgme_error_t xerr; + int delim = (dataenc == GPGME_DATA_ENCODING_URL)? '\n': 0; + + /* FIXME: --fetch-keys is probably not correct because it can't + grok all kinds of URLs. On Unix it should just work but on + Windows we will build the command line and that may fail for + some embedded control characters. It is anyway limited to + the maximum size of the command line. We need another + command which can take its input from a file. Maybe we + should use an option to gpg to modify such commands (ala + --multifile). */ + err = add_arg (gpg, "--fetch-keys"); + if (!err) + err = add_arg (gpg, "--"); + helpptr = NULL; + while (!err + && (string = string_from_data (keydata, delim, &helpptr, &xerr))) + err = add_arg (gpg, string); + if (!err) + err = xerr; + string_from_data (NULL, delim, &helpptr, &xerr); + } + else if (dataenc == GPGME_DATA_ENCODING_URLESC) + { + /* Already escaped URLs are not yet supported. */ + err = gpg_error (GPG_ERR_NOT_IMPLEMENTED); + } + else + { + err = add_arg (gpg, "--import"); + if (!err) + err = add_arg (gpg, "--"); + if (!err) + err = add_data (gpg, keydata, -1, 0); + } + + if (!err) + err = start (gpg); + + return err; +} + + +/* The output for external keylistings in GnuPG is different from all + the other key listings. We catch this here with a special + preprocessor that reformats the colon handler lines. */ +static gpgme_error_t +gpg_keylist_preprocess (char *line, char **r_line) +{ + enum + { + RT_NONE, RT_INFO, RT_PUB, RT_UID + } + rectype = RT_NONE; +#define NR_FIELDS 16 + char *field[NR_FIELDS]; + int fields = 0; + + *r_line = NULL; + + while (line && fields < NR_FIELDS) + { + field[fields++] = line; + line = strchr (line, ':'); + if (line) + *(line++) = '\0'; + } + + if (!strcmp (field[0], "info")) + rectype = RT_INFO; + else if (!strcmp (field[0], "pub")) + rectype = RT_PUB; + else if (!strcmp (field[0], "uid")) + rectype = RT_UID; + else + rectype = RT_NONE; + + switch (rectype) + { + case RT_INFO: + /* FIXME: Eventually, check the version number at least. */ + return 0; + + case RT_PUB: + if (fields < 7) + return 0; + + /* The format is: + + pub:::::: + + as defined in 5.2. Machine Readable Indexes of the OpenPGP + HTTP Keyserver Protocol (draft). + + We want: + pub:o::::::::::::: + */ + + if (asprintf (r_line, "pub:o%s:%s:%s:%s:%s:%s::::::::", + field[6], field[3], field[2], field[1], + field[4], field[5]) < 0) + return gpg_error_from_errno (errno); + return 0; + + case RT_UID: + /* The format is: + + uid:::: + + as defined in 5.2. Machine Readable Indexes of the OpenPGP + HTTP Keyserver Protocol (draft). + + We want: + uid:o::::::::: + */ + + { + /* The user ID is percent escaped, but we want c-coded. + Because we have to replace each '%HL' by '\xHL', we need at + most 4/3 th the number of bytes. But because we also need + to escape the backslashes we allocate twice as much. */ + char *uid = malloc (2 * strlen (field[1]) + 1); + char *src; + char *dst; + + if (! uid) + return gpg_error_from_errno (errno); + src = field[1]; + dst = uid; + while (*src) + { + if (*src == '%') + { + *(dst++) = '\\'; + *(dst++) = 'x'; + src++; + /* Copy the next two bytes unconditionally. */ + if (*src) + *(dst++) = *(src++); + if (*src) + *(dst++) = *(src++); + } + else if (*src == '\\') + { + *dst++ = '\\'; + *dst++ = '\\'; + } + else + *(dst++) = *(src++); + } + *dst = '\0'; + + if (asprintf (r_line, "uid:o%s::::%s:%s:::%s:", + field[4], field[2], field[3], uid) < 0) + return gpg_error_from_errno (errno); + } + return 0; + + case RT_NONE: + /* Unknown record. */ + break; + } + return 0; + +} + + +static gpg_error_t +gpg_keylist_build_options (engine_gpg_t gpg, int secret_only, + gpgme_keylist_mode_t mode) +{ + gpg_error_t err; + + err = add_arg (gpg, "--with-colons"); + if (!err) + err = add_arg (gpg, "--fixed-list-mode"); + if (!err) + err = add_arg (gpg, "--with-fingerprint"); + if (!err) + err = add_arg (gpg, "--with-fingerprint"); + if (!err + && (mode & GPGME_KEYLIST_MODE_SIGS) + && (mode & GPGME_KEYLIST_MODE_SIG_NOTATIONS)) + { + err = add_arg (gpg, "--list-options"); + if (!err) + err = add_arg (gpg, "show-sig-subpackets=\"20,26\""); + } + if (!err) + { + if ( (mode & GPGME_KEYLIST_MODE_EXTERN) ) + { + if (secret_only) + err = gpg_error (GPG_ERR_NOT_SUPPORTED); + else if ( (mode & GPGME_KEYLIST_MODE_LOCAL)) + { + /* The local+extern mode is special. It works only with + gpg >= 2.0.10. FIXME: We should check that we have + such a version to that we can return a proper error + code. The problem is that we don't know the context + here and thus can't accesses the cached version + number for the engine info structure. */ + err = add_arg (gpg, "--locate-keys"); + if ((mode & GPGME_KEYLIST_MODE_SIGS)) + err = add_arg (gpg, "--with-sig-check"); + } + else + { + err = add_arg (gpg, "--search-keys"); + gpg->colon.preprocess_fnc = gpg_keylist_preprocess; + } + } + else + { + err = add_arg (gpg, secret_only ? "--list-secret-keys" + : ((mode & GPGME_KEYLIST_MODE_SIGS) + ? "--check-sigs" : "--list-keys")); + } + } + if (!err) + err = add_arg (gpg, "--"); + + return err; +} + + +static gpgme_error_t +gpg_keylist (void *engine, const char *pattern, int secret_only, + gpgme_keylist_mode_t mode) +{ + engine_gpg_t gpg = engine; + gpgme_error_t err; + + err = gpg_keylist_build_options (gpg, secret_only, mode); + + if (!err && pattern && *pattern) + err = add_arg (gpg, pattern); + + if (!err) + err = start (gpg); + + return err; +} + + +static gpgme_error_t +gpg_keylist_ext (void *engine, const char *pattern[], int secret_only, + int reserved, gpgme_keylist_mode_t mode) +{ + engine_gpg_t gpg = engine; + gpgme_error_t err; + + if (reserved) + return gpg_error (GPG_ERR_INV_VALUE); + + err = gpg_keylist_build_options (gpg, secret_only, mode); + + if (pattern) + { + while (!err && *pattern && **pattern) + err = add_arg (gpg, *(pattern++)); + } + + if (!err) + err = start (gpg); + + return err; +} + + +static gpgme_error_t +gpg_sign (void *engine, gpgme_data_t in, gpgme_data_t out, + gpgme_sig_mode_t mode, int use_armor, int use_textmode, + int include_certs, gpgme_ctx_t ctx /* FIXME */) +{ + engine_gpg_t gpg = engine; + gpgme_error_t err; + + if (mode == GPGME_SIG_MODE_CLEAR) + err = add_arg (gpg, "--clearsign"); + else + { + err = add_arg (gpg, "--sign"); + if (!err && mode == GPGME_SIG_MODE_DETACH) + err = add_arg (gpg, "--detach"); + if (!err && use_armor) + err = add_arg (gpg, "--armor"); + if (!err && use_textmode) + err = add_arg (gpg, "--textmode"); + } + + if (!err) + err = append_args_from_signers (gpg, ctx); + if (!err) + err = append_args_from_sig_notations (gpg, ctx); + + if (gpgme_data_get_file_name (in)) + { + if (!err) + err = add_arg (gpg, "--set-filename"); + if (!err) + err = add_arg (gpg, gpgme_data_get_file_name (in)); + } + + /* Tell the gpg object about the data. */ + if (!err) + err = add_arg (gpg, "--"); + if (!err) + err = add_data (gpg, in, -1, 0); + if (!err) + err = add_data (gpg, out, 1, 1); + + if (!err) + start (gpg); + + return err; +} + +static gpgme_error_t +gpg_trustlist (void *engine, const char *pattern) +{ + engine_gpg_t gpg = engine; + gpgme_error_t err; + + err = add_arg (gpg, "--with-colons"); + if (!err) + err = add_arg (gpg, "--list-trust-path"); + + /* Tell the gpg object about the data. */ + if (!err) + err = add_arg (gpg, "--"); + if (!err) + err = add_arg (gpg, pattern); + + if (!err) + err = start (gpg); + + return err; +} + + +static gpgme_error_t +gpg_verify (void *engine, gpgme_data_t sig, gpgme_data_t signed_text, + gpgme_data_t plaintext) +{ + engine_gpg_t gpg = engine; + gpgme_error_t err = 0; + + if (plaintext) + { + /* Normal or cleartext signature. */ + + err = add_arg (gpg, "--output"); + if (!err) + err = add_arg (gpg, "-"); + if (!err) + err = add_arg (gpg, "--"); + if (!err) + err = add_data (gpg, sig, -1, 0); + if (!err) + err = add_data (gpg, plaintext, 1, 1); + } + else + { + err = add_arg (gpg, "--verify"); + if (!err) + err = add_arg (gpg, "--"); + if (!err) + err = add_data (gpg, sig, -1, 0); + if (!err && signed_text) + err = add_data (gpg, signed_text, -1, 0); + } + + if (!err) + err = start (gpg); + + return err; +} + + +static void +gpg_set_io_cbs (void *engine, gpgme_io_cbs_t io_cbs) +{ + engine_gpg_t gpg = engine; + + gpg->io_cbs = *io_cbs; +} + + +struct engine_ops _gpgme_engine_ops_gpg = + { + /* Static functions. */ + _gpgme_get_gpg_path, + NULL, + gpg_get_version, + gpg_get_req_version, + gpg_new, + + /* Member functions. */ + gpg_release, + NULL, /* reset */ + gpg_set_status_handler, + gpg_set_command_handler, + gpg_set_colon_line_handler, + gpg_set_locale, + gpg_decrypt, + gpg_delete, + gpg_edit, + gpg_encrypt, + gpg_encrypt_sign, + gpg_export, + gpg_export_ext, + gpg_genkey, + gpg_import, + gpg_keylist, + gpg_keylist_ext, + gpg_sign, + gpg_trustlist, + gpg_verify, + NULL, /* getauditlog */ + NULL, /* opassuan_transact */ + NULL, /* conf_load */ + NULL, /* conf_save */ + gpg_set_io_cbs, + gpg_io_event, + gpg_cancel + }; diff -urpNP gpgme-1.1.8/src/engine-gpgconf.c gpgme-1.2.0/src/engine-gpgconf.c --- gpgme-1.1.8/src/engine-gpgconf.c 2008-11-03 16:50:12.000000000 +0000 +++ gpgme-1.2.0/src/engine-gpgconf.c 2009-06-15 11:59:37.000000000 +0000 @@ -221,7 +221,7 @@ gpgconf_read (void *engine, char *arg1, cfd[0].fd = rp[1]; - status = _gpgme_io_spawn (gpgconf->file_name, argv, cfd, NULL); + status = _gpgme_io_spawn (gpgconf->file_name, argv, 0, cfd, NULL); if (status < 0) { _gpgme_io_close (rp[0]); @@ -659,7 +659,7 @@ gpgconf_write (void *engine, char *arg1, cfd[0].fd = rp[0]; - status = _gpgme_io_spawn (gpgconf->file_name, argv, cfd, NULL); + status = _gpgme_io_spawn (gpgconf->file_name, argv, 0, cfd, NULL); if (status < 0) { _gpgme_io_close (rp[0]); @@ -885,6 +885,7 @@ struct engine_ops _gpgme_engine_ops_gpgc { /* Static functions. */ _gpgme_get_gpgconf_path, + NULL, gpgconf_get_version, gpgconf_get_req_version, gpgconf_new, @@ -911,6 +912,7 @@ struct engine_ops _gpgme_engine_ops_gpgc NULL, /* trustlist */ NULL, /* verify */ NULL, /* getauditlog */ + NULL, /* opassuan_transact */ gpgconf_conf_load, gpgconf_conf_save, gpgconf_set_io_cbs, diff -urpNP gpgme-1.1.8/src/engine-gpgsm.c gpgme-1.2.0/src/engine-gpgsm.c --- gpgme-1.1.8/src/engine-gpgsm.c 2008-11-03 16:50:12.000000000 +0000 +++ gpgme-1.2.0/src/engine-gpgsm.c 2009-06-17 12:36:07.000000000 +0000 @@ -1,6 +1,6 @@ /* engine-gpgsm.c - GpgSM engine. Copyright (C) 2000 Werner Koch (dd9jn) - Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007 g10 Code GmbH + Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2009 g10 Code GmbH This file is part of GPGME. @@ -292,7 +292,7 @@ default_inq_cb (engine_gpgsm_t gpgsm, co { if (!strncmp (line, "PINENTRY_LAUNCHED", 17) && (line[17]==' '||!line[17])) { - _gpgme_allow_set_foregound_window ((pid_t)strtoul (line+17, NULL, 10)); + _gpgme_allow_set_foreground_window ((pid_t)strtoul (line+17, NULL, 10)); } return 0; @@ -1349,6 +1349,14 @@ gpgsm_encrypt (void *engine, gpgme_key_t if (!recp) return gpg_error (GPG_ERR_NOT_IMPLEMENTED); + if (flags & GPGME_ENCRYPT_NO_ENCRYPT_TO) + { + err = gpgsm_assuan_simple_command (gpgsm->assuan_ctx, + "OPTION no-encrypt-to", NULL, NULL); + if (err) + return err; + } + gpgsm->input_cb.data = plain; err = gpgsm_set_fd (gpgsm, INPUT_FD, map_data_enc (gpgsm->input_cb.data)); if (err) @@ -1371,15 +1379,18 @@ gpgsm_encrypt (void *engine, gpgme_key_t static gpgme_error_t -gpgsm_export (void *engine, const char *pattern, unsigned int reserved, +gpgsm_export (void *engine, const char *pattern, gpgme_export_mode_t mode, gpgme_data_t keydata, int use_armor) { engine_gpgsm_t gpgsm = engine; gpgme_error_t err = 0; char *cmd; - if (!gpgsm || reserved) + if (!gpgsm) return gpg_error (GPG_ERR_INV_VALUE); + + if (mode) + return gpg_error (GPG_ERR_NOT_SUPPORTED); if (!pattern) pattern = ""; @@ -1406,7 +1417,7 @@ gpgsm_export (void *engine, const char * static gpgme_error_t -gpgsm_export_ext (void *engine, const char *pattern[], unsigned int reserved, +gpgsm_export_ext (void *engine, const char *pattern[], gpgme_export_mode_t mode, gpgme_data_t keydata, int use_armor) { engine_gpgsm_t gpgsm = engine; @@ -1416,9 +1427,12 @@ gpgsm_export_ext (void *engine, const ch int length = 7 + 1; char *linep; - if (!gpgsm || reserved) + if (!gpgsm) return gpg_error (GPG_ERR_INV_VALUE); + if (mode) + return gpg_error (GPG_ERR_NOT_SUPPORTED); + if (pattern && *pattern) { const char **pat = pattern; @@ -1526,7 +1540,7 @@ gpgsm_genkey (void *engine, gpgme_data_t static gpgme_error_t -gpgsm_import (void *engine, gpgme_data_t keydata) +gpgsm_import (void *engine, gpgme_data_t keydata, gpgme_key_t *keyarray) { engine_gpgsm_t gpgsm = engine; gpgme_error_t err; @@ -1534,13 +1548,23 @@ gpgsm_import (void *engine, gpgme_data_t if (!gpgsm) return gpg_error (GPG_ERR_INV_VALUE); - gpgsm->input_cb.data = keydata; - err = gpgsm_set_fd (gpgsm, INPUT_FD, map_data_enc (gpgsm->input_cb.data)); - if (err) - return err; - gpgsm_clear_fd (gpgsm, OUTPUT_FD); - gpgsm_clear_fd (gpgsm, MESSAGE_FD); - gpgsm->inline_data = NULL; + if (keydata && keyarray) + gpg_error (GPG_ERR_INV_VALUE); /* Only one is allowed. */ + + if (keyarray) + { + return gpg_error (GPG_ERR_NOT_IMPLEMENTED); + } + else + { + gpgsm->input_cb.data = keydata; + err = gpgsm_set_fd (gpgsm, INPUT_FD, map_data_enc (gpgsm->input_cb.data)); + if (err) + return err; + gpgsm_clear_fd (gpgsm, OUTPUT_FD); + gpgsm_clear_fd (gpgsm, MESSAGE_FD); + gpgsm->inline_data = NULL; + } err = start (gpgsm, "IMPORT"); return err; @@ -1575,13 +1599,20 @@ gpgsm_keylist (void *engine, const char /* Always send key validation because RESET does not reset it. */ - /* Use the validation mode if required. We don't check for an error + /* Use the validation mode if requested. We don't check for an error yet because this is a pretty fresh gpgsm features. */ gpgsm_assuan_simple_command (gpgsm->assuan_ctx, (mode & GPGME_KEYLIST_MODE_VALIDATE)? "OPTION with-validation=1": "OPTION with-validation=0" , NULL, NULL); + /* Include the ephemeral keys if requested. We don't check for an error + yet because this is a pretty fresh gpgsm features. */ + gpgsm_assuan_simple_command (gpgsm->assuan_ctx, + (mode & GPGME_KEYLIST_MODE_EPHEMERAL)? + "OPTION with-ephemeral-keys=1": + "OPTION with-ephemeral-keys=0" , + NULL, NULL); /* Length is "LISTSECRETKEYS " + p + '\0'. */ @@ -1922,6 +1953,7 @@ struct engine_ops _gpgme_engine_ops_gpgs { /* Static functions. */ _gpgme_get_gpgsm_path, + NULL, gpgsm_get_version, gpgsm_get_req_version, gpgsm_new, @@ -1952,6 +1984,7 @@ struct engine_ops _gpgme_engine_ops_gpgs NULL, /* trustlist */ gpgsm_verify, gpgsm_getauditlog, + NULL, /* opassuan_transact */ NULL, /* conf_load */ NULL, /* conf_save */ gpgsm_set_io_cbs, diff -urpNP gpgme-1.1.8/src/engine.c gpgme-1.2.0/src/engine.c --- gpgme-1.1.8/src/engine.c 2008-11-03 16:50:12.000000000 +0000 +++ gpgme-1.2.0/src/engine.c 2009-06-17 12:36:07.000000000 +0000 @@ -1,6 +1,6 @@ /* engine.c - GPGME engine support. Copyright (C) 2000 Werner Koch (dd9jn) - Copyright (C) 2001, 2002, 2003, 2004, 2006 g10 Code GmbH + Copyright (C) 2001, 2002, 2003, 2004, 2006, 2009 g10 Code GmbH This file is part of GPGME. @@ -15,9 +15,8 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + License along with this program; if not, see . +*/ #ifdef HAVE_CONFIG_H #include @@ -52,7 +51,12 @@ static struct engine_ops *engine_ops[] = NULL, #endif #ifdef ENABLE_GPGCONF - &_gpgme_engine_ops_gpgconf /* gpg-conf. */ + &_gpgme_engine_ops_gpgconf, /* gpg-conf. */ +#else + NULL, +#endif +#ifdef ENABLE_GPGSM /* This indicates that we have assuan support. */ + &_gpgme_engine_ops_assuan /* Low-Level Assuan. */ #else NULL #endif @@ -78,6 +82,20 @@ engine_get_file_name (gpgme_protocol_t p } +/* Get the standard home dir of the engine for PROTOCOL. */ +static const char * +engine_get_home_dir (gpgme_protocol_t proto) +{ + if (proto > DIM (engine_ops)) + return NULL; + + if (engine_ops[proto] && engine_ops[proto]->get_home_dir) + return (*engine_ops[proto]->get_home_dir) (); + else + return NULL; +} + + /* Get a malloced string containing the version number of the engine for PROTOCOL. */ static char * @@ -175,18 +193,22 @@ gpgme_get_engine_info (gpgme_engine_info gpgme_engine_info_t *lastp = &engine_info; gpgme_protocol_t proto_list[] = { GPGME_PROTOCOL_OpenPGP, GPGME_PROTOCOL_CMS, - GPGME_PROTOCOL_GPGCONF }; + GPGME_PROTOCOL_GPGCONF, + GPGME_PROTOCOL_ASSUAN }; unsigned int proto; for (proto = 0; proto < DIM (proto_list); proto++) { const char *ofile_name = engine_get_file_name (proto_list[proto]); + const char *ohome_dir = engine_get_home_dir (proto_list[proto]); char *file_name; + char *home_dir; if (!ofile_name) continue; file_name = strdup (ofile_name); + home_dir = ohome_dir? strdup (ohome_dir): NULL; *lastp = malloc (sizeof (*engine_info)); if (!*lastp || !file_name) @@ -198,6 +220,8 @@ gpgme_get_engine_info (gpgme_engine_info if (file_name) free (file_name); + if (home_dir) + free (home_dir); UNLOCK (engine_info_lock); return gpg_error_from_errno (saved_errno); @@ -205,7 +229,7 @@ gpgme_get_engine_info (gpgme_engine_info (*lastp)->protocol = proto_list[proto]; (*lastp)->file_name = file_name; - (*lastp)->home_dir = NULL; + (*lastp)->home_dir = home_dir; (*lastp)->version = engine_get_version (proto_list[proto], NULL); (*lastp)->req_version = engine_get_req_version (proto_list[proto]); (*lastp)->next = NULL; @@ -347,7 +371,20 @@ _gpgme_set_engine_info (gpgme_engine_inf } } else - new_home_dir = NULL; + { + const char *ohome_dir = engine_get_home_dir (proto); + if (ohome_dir) + { + new_home_dir = strdup (ohome_dir); + if (!new_home_dir) + { + free (new_file_name); + return gpg_error_from_errno (errno); + } + } + else + new_home_dir = NULL; + } /* Remove the old members. */ assert (info->file_name); @@ -583,7 +620,7 @@ _gpgme_engine_op_encrypt_sign (engine_t gpgme_error_t _gpgme_engine_op_export (engine_t engine, const char *pattern, - unsigned int reserved, gpgme_data_t keydata, + gpgme_export_mode_t mode, gpgme_data_t keydata, int use_armor) { if (!engine) @@ -592,7 +629,7 @@ _gpgme_engine_op_export (engine_t engine if (!engine->ops->export) return gpg_error (GPG_ERR_NOT_IMPLEMENTED); - return (*engine->ops->export) (engine->engine, pattern, reserved, + return (*engine->ops->export) (engine->engine, pattern, mode, keydata, use_armor); } @@ -630,7 +667,8 @@ _gpgme_engine_op_genkey (engine_t engine gpgme_error_t -_gpgme_engine_op_import (engine_t engine, gpgme_data_t keydata) +_gpgme_engine_op_import (engine_t engine, gpgme_data_t keydata, + gpgme_key_t *keyarray) { if (!engine) return gpg_error (GPG_ERR_INV_VALUE); @@ -638,7 +676,7 @@ _gpgme_engine_op_import (engine_t engine if (!engine->ops->import) return gpg_error (GPG_ERR_NOT_IMPLEMENTED); - return (*engine->ops->import) (engine->engine, keydata); + return (*engine->ops->import) (engine->engine, keydata, keyarray); } @@ -731,6 +769,33 @@ _gpgme_engine_op_getauditlog (engine_t e gpgme_error_t +_gpgme_engine_op_assuan_transact (engine_t engine, + const char *command, + engine_assuan_result_cb_t result_cb, + void *result_cb_value, + gpgme_assuan_data_cb_t data_cb, + void *data_cb_value, + gpgme_assuan_inquire_cb_t inq_cb, + void *inq_cb_value, + gpgme_assuan_status_cb_t status_cb, + void *status_cb_value) +{ + if (!engine) + return gpg_error (GPG_ERR_INV_VALUE); + + if (!engine->ops->opassuan_transact) + return gpg_error (GPG_ERR_NOT_IMPLEMENTED); + + return (*engine->ops->opassuan_transact) (engine->engine, + command, + result_cb, result_cb_value, + data_cb, data_cb_value, + inq_cb, inq_cb_value, + status_cb, status_cb_value); +} + + +gpgme_error_t _gpgme_engine_op_conf_load (engine_t engine, gpgme_conf_comp_t *conf_p) { if (!engine) diff -urpNP gpgme-1.1.8/src/engine.h gpgme-1.2.0/src/engine.h --- gpgme-1.1.8/src/engine.h 2008-11-03 16:50:12.000000000 +0000 +++ gpgme-1.2.0/src/engine.h 2009-06-17 12:36:07.000000000 +0000 @@ -35,6 +35,9 @@ typedef gpgme_error_t (*engine_command_h gpgme_status_code_t code, const char *keyword, int fd, int *processed); +typedef gpgme_error_t (*engine_assuan_result_cb_t) (void *priv, + gpgme_error_t result); + /* Get a deep copy of the engine info and return it in INFO. */ gpgme_error_t _gpgme_engine_info_copy (gpgme_engine_info_t *r_info); @@ -90,11 +93,11 @@ gpgme_error_t _gpgme_engine_op_encrypt_s int use_armor, gpgme_ctx_t ctx /* FIXME */); gpgme_error_t _gpgme_engine_op_export (engine_t engine, const char *pattern, - unsigned int reserved, + gpgme_export_mode_t mode, gpgme_data_t keydata, int use_armor); gpgme_error_t _gpgme_engine_op_export_ext (engine_t engine, const char *pattern[], - unsigned int reserved, + gpgme_export_mode_t mode, gpgme_data_t keydata, int use_armor); gpgme_error_t _gpgme_engine_op_genkey (engine_t engine, @@ -102,7 +105,8 @@ gpgme_error_t _gpgme_engine_op_genkey (e int use_armor, gpgme_data_t pubkey, gpgme_data_t seckey); gpgme_error_t _gpgme_engine_op_import (engine_t engine, - gpgme_data_t keydata); + gpgme_data_t keydata, + gpgme_key_t *keyarray); gpgme_error_t _gpgme_engine_op_keylist (engine_t engine, const char *pattern, int secret_only, @@ -126,6 +130,17 @@ gpgme_error_t _gpgme_engine_op_verify (e gpgme_error_t _gpgme_engine_op_getauditlog (engine_t engine, gpgme_data_t output, unsigned int flags); +gpgme_error_t _gpgme_engine_op_assuan_transact + (engine_t engine, + const char *command, + engine_assuan_result_cb_t result_cb, + void *result_cb_value, + gpgme_assuan_data_cb_t data_cb, + void *data_cb_value, + gpgme_assuan_inquire_cb_t inq_cb, + void *inq_cb_value, + gpgme_assuan_status_cb_t status_cb, + void *status_cb_value); gpgme_error_t _gpgme_engine_op_conf_load (engine_t engine, gpgme_conf_comp_t *conf_p); diff -urpNP gpgme-1.1.8/src/export.c gpgme-1.2.0/src/export.c --- gpgme-1.1.8/src/export.c 2008-11-03 16:50:12.000000000 +0000 +++ gpgme-1.2.0/src/export.c 2009-06-17 12:36:07.000000000 +0000 @@ -22,6 +22,8 @@ #if HAVE_CONFIG_H #include #endif +#include +#include #include "gpgme.h" #include "context.h" @@ -37,12 +39,24 @@ export_status_handler (void *priv, gpgme static gpgme_error_t export_start (gpgme_ctx_t ctx, int synchronous, const char *pattern, - unsigned int reserved, gpgme_data_t keydata) + gpgme_export_mode_t mode, gpgme_data_t keydata) { gpgme_error_t err; - if (!keydata) - return gpg_error (GPG_ERR_INV_VALUE); + if ((mode & ~(GPGME_EXPORT_MODE_EXTERN))) + return gpg_error (GPG_ERR_INV_VALUE); /* Invalid flags in MODE. */ + + + if ((mode & GPGME_EXPORT_MODE_EXTERN)) + { + if (keydata) + return gpg_error (GPG_ERR_INV_VALUE); + } + else + { + if (!keydata) + return gpg_error (GPG_ERR_INV_VALUE); + } err = _gpgme_op_reset (ctx, synchronous); if (err) @@ -50,26 +64,26 @@ export_start (gpgme_ctx_t ctx, int synch _gpgme_engine_set_status_handler (ctx->engine, export_status_handler, ctx); - return _gpgme_engine_op_export (ctx->engine, pattern, reserved, keydata, + return _gpgme_engine_op_export (ctx->engine, pattern, mode, keydata, ctx->use_armor); } -/* Export the keys listed in RECP into KEYDATA. */ +/* Export the keys listed in PATTERN into KEYDATA. */ gpgme_error_t gpgme_op_export_start (gpgme_ctx_t ctx, const char *pattern, - unsigned int reserved, gpgme_data_t keydata) + gpgme_export_mode_t mode, gpgme_data_t keydata) { - return export_start (ctx, 0, pattern, reserved, keydata); + return export_start (ctx, 0, pattern, mode, keydata); } -/* Export the keys listed in RECP into KEYDATA. */ +/* Export the keys listed in PATTERN into KEYDATA. */ gpgme_error_t -gpgme_op_export (gpgme_ctx_t ctx, const char *pattern, unsigned int reserved, - gpgme_data_t keydata) +gpgme_op_export (gpgme_ctx_t ctx, const char *pattern, + gpgme_export_mode_t mode, gpgme_data_t keydata) { - gpgme_error_t err = export_start (ctx, 1, pattern, reserved, keydata); + gpgme_error_t err = export_start (ctx, 1, pattern, mode, keydata); if (!err) err = _gpgme_wait_one (ctx); return err; @@ -78,12 +92,23 @@ gpgme_op_export (gpgme_ctx_t ctx, const static gpgme_error_t export_ext_start (gpgme_ctx_t ctx, int synchronous, const char *pattern[], - unsigned int reserved, gpgme_data_t keydata) + gpgme_export_mode_t mode, gpgme_data_t keydata) { gpgme_error_t err; - if (!keydata) - return gpg_error (GPG_ERR_INV_VALUE); + if ((mode & ~(GPGME_EXPORT_MODE_EXTERN))) + return gpg_error (GPG_ERR_INV_VALUE); /* Invalid flags in MODE. */ + + if ((mode & GPGME_EXPORT_MODE_EXTERN)) + { + if (keydata) + return gpg_error (GPG_ERR_INV_VALUE); + } + else + { + if (!keydata) + return gpg_error (GPG_ERR_INV_VALUE); + } err = _gpgme_op_reset (ctx, synchronous); if (err) @@ -91,27 +116,108 @@ export_ext_start (gpgme_ctx_t ctx, int s _gpgme_engine_set_status_handler (ctx->engine, export_status_handler, ctx); - return _gpgme_engine_op_export_ext (ctx->engine, pattern, reserved, keydata, + return _gpgme_engine_op_export_ext (ctx->engine, pattern, mode, keydata, ctx->use_armor); } -/* Export the keys listed in RECP into KEYDATA. */ +/* Export the keys listed in PATTERN into KEYDATA. */ gpgme_error_t gpgme_op_export_ext_start (gpgme_ctx_t ctx, const char *pattern[], - unsigned int reserved, gpgme_data_t keydata) + gpgme_export_mode_t mode, gpgme_data_t keydata) { - return export_ext_start (ctx, 0, pattern, reserved, keydata); + return export_ext_start (ctx, 0, pattern, mode, keydata); } -/* Export the keys listed in RECP into KEYDATA. */ +/* Export the keys listed in PATTERN into KEYDATA. */ gpgme_error_t gpgme_op_export_ext (gpgme_ctx_t ctx, const char *pattern[], - unsigned int reserved, gpgme_data_t keydata) + gpgme_export_mode_t mode, gpgme_data_t keydata) { - gpgme_error_t err = export_ext_start (ctx, 1, pattern, reserved, keydata); + gpgme_error_t err = export_ext_start (ctx, 1, pattern, mode, keydata); if (!err) err = _gpgme_wait_one (ctx); return err; } + + + + + +static gpgme_error_t +export_keys_start (gpgme_ctx_t ctx, int synchronous, gpgme_key_t keys[], + gpgme_export_mode_t mode, gpgme_data_t keydata) +{ + gpgme_error_t err; + int nkeys, idx; + char **pattern; + + if (!keys) + return gpg_error (GPG_ERR_INV_VALUE); + + /* Create a list of pattern from the keys. */ + for (idx=nkeys=0; keys[idx]; idx++) + if (keys[idx]->protocol == ctx->protocol) + nkeys++; + if (!nkeys) + return gpg_error (GPG_ERR_NO_DATA); + + pattern = calloc (nkeys+1, sizeof *pattern); + if (!pattern) + return gpg_error_from_syserror (); + + for (idx=nkeys=0; keys[idx]; idx++) + if (keys[idx]->protocol == ctx->protocol + && keys[idx]->subkeys + && keys[idx]->subkeys->fpr + && *keys[idx]->subkeys->fpr) + { + pattern[nkeys] = strdup (keys[idx]->subkeys->fpr); + if (!pattern[nkeys]) + { + err = gpg_error_from_syserror (); + goto leave; + } + nkeys++; + } + + + /* Pass on to the regular function. */ + err = export_ext_start (ctx, synchronous, (const char**)pattern, + mode, keydata); + + leave: + for (idx=0; pattern[idx]; idx++) + free (pattern[idx]); + free (pattern); + + return err; +} + + +/* Export the keys from the array KEYS into KEYDATA. Only keys of the + current protocol are exported and only those which have a + fingerprint set; that is keys received with some external search + methods are silently skipped. */ +gpgme_error_t +gpgme_op_export_keys_start (gpgme_ctx_t ctx, + gpgme_key_t keys[], + gpgme_export_mode_t mode, + gpgme_data_t keydata) +{ + return export_keys_start (ctx, 0, keys, mode, keydata); +} + +gpgme_error_t +gpgme_op_export_keys (gpgme_ctx_t ctx, + gpgme_key_t keys[], + gpgme_export_mode_t mode, + gpgme_data_t keydata) +{ + gpgme_error_t err = export_keys_start (ctx, 1, keys, mode, keydata); + if (!err) + err = _gpgme_wait_one (ctx); + return err; +} + diff -urpNP gpgme-1.1.8/src/gpgme-config.in gpgme-1.2.0/src/gpgme-config.in --- gpgme-1.1.8/src/gpgme-config.in 2008-11-03 16:50:12.000000000 +0000 +++ gpgme-1.2.0/src/gpgme-config.in 2009-03-17 14:24:07.000000000 +0000 @@ -14,6 +14,11 @@ exec_prefix=@exec_prefix@ includedir=@includedir@ libdir=@libdir@ +# Make sure that no weird locale setting messes up our sed regexps etc. +LC_COLLATE=C +LC_ALL=C +LANG=C + # Network libraries. netlibs="@NETLIBS@" diff -urpNP gpgme-1.1.8/src/gpgme-w32spawn.c gpgme-1.2.0/src/gpgme-w32spawn.c --- gpgme-1.1.8/src/gpgme-w32spawn.c 2008-11-03 16:50:12.000000000 +0000 +++ gpgme-1.2.0/src/gpgme-w32spawn.c 2009-06-15 11:59:37.000000000 +0000 @@ -34,6 +34,13 @@ #include #include +/* Flag values as used by gpgme. */ +#define IOSPAWN_FLAG_ALLOW_SET_FG 1 + + +/* Name of this program. */ +#define PGM "gpgme-w32spawn" + struct spawn_fd_item_s @@ -101,7 +108,7 @@ build_commandline (char **argv) int -my_spawn (char **argv, struct spawn_fd_item_s *fd_list) +my_spawn (char **argv, struct spawn_fd_item_s *fd_list, unsigned int flags) { SECURITY_ATTRIBUTES sec_attr; PROCESS_INFORMATION pi = @@ -127,7 +134,7 @@ my_spawn (char **argv, struct spawn_fd_i i = 0; while (argv[i]) { - fprintf (stderr, "argv[%2i] = %s\n", i, argv[i]); + fprintf (stderr, PGM": argv[%2i] = %s\n", i, argv[i]); i++; } @@ -147,7 +154,7 @@ my_spawn (char **argv, struct spawn_fd_i si.hStdOutput = GetStdHandle (STD_OUTPUT_HANDLE); si.hStdError = GetStdHandle (STD_ERROR_HANDLE); - fprintf (stderr, "spawning: %s\n", arg_string); + fprintf (stderr, PGM": spawning: %s\n", arg_string); for (i = 0; fd_list[i].handle != -1; i++) { @@ -156,19 +163,19 @@ my_spawn (char **argv, struct spawn_fd_i { si.hStdInput = (HANDLE) fd_list[i].peer_name; duped_stdin = 1; - fprintf (stderr, "dup 0x%x to stdin\n", fd_list[i].peer_name); + fprintf (stderr, PGM": dup 0x%x to stdin\n", fd_list[i].peer_name); } else if (fd_list[i].dup_to == 1) { si.hStdOutput = (HANDLE) fd_list[i].peer_name; duped_stdout = 1; - fprintf (stderr, "dup 0x%x to stdout\n", fd_list[i].peer_name); + fprintf (stderr, PGM": dup 0x%x to stdout\n", fd_list[i].peer_name); } else if (fd_list[i].dup_to == 2) { si.hStdError = (HANDLE) fd_list[i].peer_name; duped_stderr = 1; - fprintf (stderr, "dup 0x%x to stderr\n", fd_list[i].peer_name); + fprintf (stderr, PGM":dup 0x%x to stderr\n", fd_list[i].peer_name); } } @@ -231,6 +238,33 @@ my_spawn (char **argv, struct spawn_fd_i for (i = 0; fd_list[i].handle != -1; i++) CloseHandle ((HANDLE) fd_list[i].handle); + + if (flags & IOSPAWN_FLAG_ALLOW_SET_FG) + { + static int initialized; + static BOOL (WINAPI * func)(DWORD); + void *handle; + + if (!initialized) + { + /* Available since W2000; thus we dynload it. */ + initialized = 1; + handle = LoadLibrary ("user32.dll"); + if (handle) + { + func = GetProcAddress (handle, "AllowSetForegroundWindow"); + if (!func) + FreeLibrary (handle); + } + } + + if (func) + { + int rc = func (pi.dwProcessId); + fprintf (stderr, PGM": AllowSetForegroundWindow(%d): rc=%d\n", + (int)pi.dwProcessId, rc); + } + } ResumeThread (pi.hThread); CloseHandle (pi.hThread); @@ -244,12 +278,13 @@ my_spawn (char **argv, struct spawn_fd_i int translate_get_from_file (const char *trans_file, - struct spawn_fd_item_s *fd_list) + struct spawn_fd_item_s *fd_list, + unsigned int *r_flags) { /* Hold roughly MAX_TRANS triplets of 64 bit numbers in hex notation: "0xFEDCBA9876543210". 10*19*4 - 1 = 759. This plans ahead for a time when a HANDLE is 64 bit. */ -#define BUFFER_MAX 800 +#define BUFFER_MAX 810 char line[BUFFER_MAX + 1]; char *linep; @@ -257,6 +292,8 @@ translate_get_from_file (const char *tra int res; int fd; + *r_flags = 0; + fd = open (trans_file, O_RDONLY); if (fd < 0) return -1; @@ -269,10 +306,12 @@ translate_get_from_file (const char *tra line[BUFFER_MAX] = '\0'; linep = strchr (line, '\n'); - if (linep > line && linep[-1] == '\r') - linep--; - *linep = '\0'; - + if (linep) + { + if (linep > line && linep[-1] == '\r') + linep--; + *linep = '\0'; + } linep = line; /* Now start to read mapping pairs. */ @@ -289,6 +328,21 @@ translate_get_from_file (const char *tra linep++; if (*linep == '\0') break; + if (!idx && *linep == '~') + { + /* Spawn flags have been passed. */ + linep++; + *r_flags = strtoul (linep, &tail, 0); + if (tail == NULL || ! (*tail == '\0' || isspace (*tail))) + break; + linep = tail; + + while (isspace (*((unsigned char *)linep))) + linep++; + if (*linep == '\0') + break; + } + from = strtoul (linep, &tail, 0); if (tail == NULL || ! (*tail == '\0' || isspace (*tail))) break; @@ -339,13 +393,14 @@ translate_get_from_file (const char *tra FD_LIST (which must be MAX_TRANS+1 large). */ char ** translate_handles (const char *trans_file, const char * const *argv, - struct spawn_fd_item_s *fd_list) + struct spawn_fd_item_s *fd_list, unsigned int *r_flags) { int res; int idx; + int n_args; char **args; - res = translate_get_from_file (trans_file, fd_list); + res = translate_get_from_file (trans_file, fd_list, r_flags); if (res < 0) return NULL; @@ -359,6 +414,7 @@ translate_handles (const char *trans_fil return NULL; } args[idx] = NULL; + n_args = idx; for (idx = 0; fd_list[idx].handle != -1; idx++) { @@ -369,6 +425,12 @@ translate_handles (const char *trans_fil if (aidx == 0) continue; + if (aidx >= n_args) + { + fprintf (stderr, PGM": translation file does not match args\n"); + return NULL; + } + args[aidx] = malloc (sizeof (buf)); /* We currently disable translation for stdin/stdout/stderr. We assume that the spawned program handles 0/1/2 specially @@ -394,6 +456,7 @@ main (int argc, const char * const *argv int rc = 0; char **argv_spawn; struct spawn_fd_item_s fd_list[MAX_TRANS + 1]; + unsigned int flags; if (argc < 3) { @@ -401,7 +464,7 @@ main (int argc, const char * const *argv goto leave; } - argv_spawn = translate_handles (argv[1], &argv[2], fd_list); + argv_spawn = translate_handles (argv[1], &argv[2], fd_list, &flags); if (!argv_spawn) { rc = 2; @@ -411,10 +474,10 @@ main (int argc, const char * const *argv /* Using execv does not replace the existing program image, but spawns a new one and daemonizes it, confusing the command line interpreter. So we have to use spawnv. */ - rc = my_spawn (argv_spawn, fd_list); + rc = my_spawn (argv_spawn, fd_list, flags); if (rc < 0) { - fprintf (stderr, "gpgwrap: executing `%s' failed: %s\n", + fprintf (stderr, PGM": executing `%s' failed: %s\n", argv[0], strerror (errno)); rc = 2; goto leave; @@ -422,12 +485,12 @@ main (int argc, const char * const *argv leave: if (rc) - fprintf (stderr, "gpg-w32spawn: internal error\n"); + fprintf (stderr, PGM": internal error\n"); /* Always try to delete the temporary file. */ if (argc >= 2) { if (DeleteFile (argv[1]) == 0) - fprintf (stderr, "Failed to delete %s: ec=%ld\n", + fprintf (stderr, PGM": failed to delete %s: ec=%ld\n", argv[1], GetLastError ()); } return rc; diff -urpNP gpgme-1.1.8/src/gpgme.c gpgme-1.2.0/src/gpgme.c --- gpgme-1.1.8/src/gpgme.c 2008-11-03 16:50:12.000000000 +0000 +++ gpgme-1.2.0/src/gpgme.c 2009-06-18 16:09:23.000000000 +0000 @@ -34,6 +34,7 @@ #include "ops.h" #include "wait.h" #include "debug.h" +#include "priv-io.h" /* The default locale. */ @@ -42,6 +43,13 @@ static char *def_lc_ctype; static char *def_lc_messages; +gpgme_error_t _gpgme_selftest = GPG_ERR_NOT_OPERATIONAL; + +/* Protects all reference counters in result structures. All other + accesses to a key are read only. */ +DEFINE_STATIC_LOCK (result_ref_lock); + + /* Create a new context as an environment for GPGME crypto operations. */ gpgme_error_t @@ -50,6 +58,9 @@ gpgme_new (gpgme_ctx_t *r_ctx) gpgme_ctx_t ctx; TRACE_BEG (DEBUG_CTX, "gpgme_new", r_ctx); + if (_gpgme_selftest) + return TRACE_ERR (gpgme_error (_gpgme_selftest)); + ctx = calloc (1, sizeof *ctx); if (!ctx) return TRACE_ERR (gpg_error_from_errno (errno)); @@ -169,6 +180,50 @@ gpgme_release (gpgme_ctx_t ctx) void +gpgme_result_ref (void *result) +{ + struct ctx_op_data *data; + + if (! result) + return; + + data = result - sizeof (struct ctx_op_data); + + assert (data->magic == CTX_OP_DATA_MAGIC); + + LOCK (result_ref_lock); + data->references++; + UNLOCK (result_ref_lock); +} + + +void +gpgme_result_unref (void *result) +{ + struct ctx_op_data *data; + + if (! result) + return; + + data = result - sizeof (struct ctx_op_data); + + assert (data->magic == CTX_OP_DATA_MAGIC); + + LOCK (result_ref_lock); + if (--data->references) + { + UNLOCK (result_ref_lock); + return; + } + UNLOCK (result_ref_lock); + + if (data->cleanup) + (*data->cleanup) (data->hook); + free (data); +} + + +void _gpgme_release_result (gpgme_ctx_t ctx) { struct ctx_op_data *data = ctx->op_data; @@ -176,9 +231,8 @@ _gpgme_release_result (gpgme_ctx_t ctx) while (data) { struct ctx_op_data *next_data = data->next; - if (data->cleanup) - (*data->cleanup) (data->hook); - free (data); + data->next = NULL; + gpgme_result_unref (data->hook); data = next_data; } ctx->op_data = NULL; @@ -192,7 +246,9 @@ gpgme_set_protocol (gpgme_ctx_t ctx, gpg protocol, gpgme_get_protocol_name (protocol) ? gpgme_get_protocol_name (protocol) : "unknown"); - if (protocol != GPGME_PROTOCOL_OpenPGP && protocol != GPGME_PROTOCOL_CMS) + if (protocol != GPGME_PROTOCOL_OpenPGP + && protocol != GPGME_PROTOCOL_CMS + && protocol != GPGME_PROTOCOL_ASSUAN) return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE)); if (ctx->protocol != protocol) @@ -233,6 +289,9 @@ gpgme_get_protocol_name (gpgme_protocol_ case GPGME_PROTOCOL_CMS: return "CMS"; + case GPGME_PROTOCOL_ASSUAN: + return "Assuan"; + case GPGME_PROTOCOL_UNKNOWN: return "unknown"; @@ -417,6 +476,33 @@ gpgme_set_io_cbs (gpgme_ctx_t ctx, gpgme } +/* This function provides access to the internal read function; it is + normally not used. */ +ssize_t +gpgme_io_read (int fd, void *buffer, size_t count) +{ + int ret; + + ret = _gpgme_io_read (fd, buffer, count); + + return ret; +} + + +/* This function provides access to the internal write function. It + is to be used by user callbacks to return data to gpgme. See + gpgme_passphrase_cb_t and gpgme_edit_cb_t. */ +ssize_t +gpgme_io_write (int fd, const void *buffer, size_t count) +{ + int ret; + + ret = _gpgme_io_write (fd, buffer, count); + + return ret; +} + + /* This function returns the callback function for I/O. */ void gpgme_get_io_cbs (gpgme_ctx_t ctx, gpgme_io_cbs_t io_cbs) diff -urpNP gpgme-1.1.8/src/gpgme.def gpgme-1.2.0/src/gpgme.def --- gpgme-1.1.8/src/gpgme.def 2008-11-03 16:50:12.000000000 +0000 +++ gpgme-1.2.0/src/gpgme.def 2009-06-18 16:09:23.000000000 +0000 @@ -167,5 +167,23 @@ EXPORTS gpgme_op_conf_save @130 gpgme_cancel_async @131 + + gpgme_op_assuan_result @132 + gpgme_op_assuan_transact_start @133 + gpgme_op_assuan_transact @134 + + gpgme_check_version_internal @135 + + gpgme_io_read @136 + gpgme_io_write @137 + + gpgme_result_ref @138 + gpgme_result_unref @139 + + gpgme_op_import_keys @140 + gpgme_op_import_keys_start @141 + gpgme_op_export_keys @142 + gpgme_op_export_keys_start @143 + ; END diff -urpNP gpgme-1.1.8/src/gpgme.h gpgme-1.2.0/src/gpgme.h --- gpgme-1.1.8/src/gpgme.h 2008-12-08 18:42:02.000000000 +0000 +++ gpgme-1.2.0/src/gpgme.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,1893 +0,0 @@ -/* gpgme.h - Public interface to GnuPG Made Easy. -*- c -*- - Copyright (C) 2000 Werner Koch (dd9jn) - Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007 g10 Code GmbH - - This file is part of GPGME. - - GPGME is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 2.1 of - the License, or (at your option) any later version. - - GPGME is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program; if not, see . - - File: src/gpgme.h. Generated from gpgme.h.in by configure. */ - -#ifndef GPGME_H -#define GPGME_H - -#ifdef __GNUC__ -#define _GPGME_INLINE __inline__ -#elif __STDC_VERSION__ >= 199901L -#define _GPGME_INLINE inline -#else -#define _GPGME_INLINE -#endif - -/* Include stdio.h for the FILE type definition. */ -#include - -#ifdef _MSC_VER - typedef long off_t; - typedef long ssize_t; -#else -# include -#endif - -#include - -#ifdef __cplusplus -extern "C" { -#if 0 /* just to make Emacs auto-indent happy */ -} -#endif -#endif /* __cplusplus */ - - - -/* Check for compiler features. */ -#if __GNUC__ -#define _GPGME_GCC_VERSION (__GNUC__ * 10000 \ - + __GNUC_MINOR__ * 100 \ - + __GNUC_PATCHLEVEL__) - -#if _GPGME_GCC_VERSION > 30100 -#define _GPGME_DEPRECATED __attribute__ ((__deprecated__)) -#endif -#endif - -#ifndef _GPGME_DEPRECATED -#define _GPGME_DEPRECATED -#endif - - -/* The version of this header should match the one of the library. Do - not use this symbol in your application, use gpgme_check_version - instead. The purpose of this macro is to let autoconf (using the - AM_PATH_GPGME macro) check that this header matches the installed - library. */ -#define GPGME_VERSION "1.1.8" - - - -/* Some opaque data types used by GPGME. */ - -/* The context holds some global state and configration options, as - well as the results of a crypto operation. */ -struct gpgme_context; -typedef struct gpgme_context *gpgme_ctx_t; - -/* The data object is used by GPGME to exchange arbitrary data. */ -struct gpgme_data; -typedef struct gpgme_data *gpgme_data_t; - - -/* Wrappers for the libgpg-error library. */ - -typedef gpg_error_t gpgme_error_t; -typedef gpg_err_code_t gpgme_err_code_t; -typedef gpg_err_source_t gpgme_err_source_t; - - -static _GPGME_INLINE gpgme_error_t -gpgme_err_make (gpgme_err_source_t source, gpgme_err_code_t code) -{ - return gpg_err_make (source, code); -} - - -/* The user can define GPGME_ERR_SOURCE_DEFAULT before including this - file to specify a default source for gpgme_error. */ -#ifndef GPGME_ERR_SOURCE_DEFAULT -#define GPGME_ERR_SOURCE_DEFAULT GPG_ERR_SOURCE_USER_1 -#endif - -static _GPGME_INLINE gpgme_error_t -gpgme_error (gpgme_err_code_t code) -{ - return gpgme_err_make (GPGME_ERR_SOURCE_DEFAULT, code); -} - - -static _GPGME_INLINE gpgme_err_code_t -gpgme_err_code (gpgme_error_t err) -{ - return gpg_err_code (err); -} - - -static _GPGME_INLINE gpgme_err_source_t -gpgme_err_source (gpgme_error_t err) -{ - return gpg_err_source (err); -} - - -/* Return a pointer to a string containing a description of the error - code in the error value ERR. This function is not thread safe. */ -const char *gpgme_strerror (gpgme_error_t err); - -/* Return the error string for ERR in the user-supplied buffer BUF of - size BUFLEN. This function is, in contrast to gpg_strerror, - thread-safe if a thread-safe strerror_r() function is provided by - the system. If the function succeeds, 0 is returned and BUF - contains the string describing the error. If the buffer was not - large enough, ERANGE is returned and BUF contains as much of the - beginning of the error string as fits into the buffer. */ -int gpgme_strerror_r (gpg_error_t err, char *buf, size_t buflen); - - -/* Return a pointer to a string containing a description of the error - source in the error value ERR. */ -const char *gpgme_strsource (gpgme_error_t err); - - -/* Retrieve the error code for the system error ERR. This returns - GPG_ERR_UNKNOWN_ERRNO if the system error is not mapped (report - this). */ -gpgme_err_code_t gpgme_err_code_from_errno (int err); - - -/* Retrieve the system error for the error code CODE. This returns 0 - if CODE is not a system error code. */ -int gpgme_err_code_to_errno (gpgme_err_code_t code); - - -/* Return an error value with the error source SOURCE and the system - error ERR. */ -gpgme_error_t gpgme_err_make_from_errno (gpgme_err_source_t source, int err); - - -/* Return an error value with the system error ERR. */ -gpgme_err_code_t gpgme_error_from_errno (int err); - - -/* The possible encoding mode of gpgme_data_t objects. */ -typedef enum - { - GPGME_DATA_ENCODING_NONE = 0, /* Not specified. */ - GPGME_DATA_ENCODING_BINARY = 1, - GPGME_DATA_ENCODING_BASE64 = 2, - GPGME_DATA_ENCODING_ARMOR = 3 /* Either PEM or OpenPGP Armor. */ - } -gpgme_data_encoding_t; - - -/* Public key algorithms from libgcrypt. */ -typedef enum - { - GPGME_PK_RSA = 1, - GPGME_PK_RSA_E = 2, - GPGME_PK_RSA_S = 3, - GPGME_PK_ELG_E = 16, - GPGME_PK_DSA = 17, - GPGME_PK_ELG = 20 - } -gpgme_pubkey_algo_t; - - -/* Hash algorithms from libgcrypt. */ -typedef enum - { - GPGME_MD_NONE = 0, - GPGME_MD_MD5 = 1, - GPGME_MD_SHA1 = 2, - GPGME_MD_RMD160 = 3, - GPGME_MD_MD2 = 5, - GPGME_MD_TIGER = 6, /* TIGER/192. */ - GPGME_MD_HAVAL = 7, /* HAVAL, 5 pass, 160 bit. */ - GPGME_MD_SHA256 = 8, - GPGME_MD_SHA384 = 9, - GPGME_MD_SHA512 = 10, - GPGME_MD_MD4 = 301, - GPGME_MD_CRC32 = 302, - GPGME_MD_CRC32_RFC1510 = 303, - GPGME_MD_CRC24_RFC2440 = 304 - } -gpgme_hash_algo_t; - - -/* The possible signature stati. Deprecated, use error value in sig - status. */ -typedef enum - { - GPGME_SIG_STAT_NONE = 0, - GPGME_SIG_STAT_GOOD = 1, - GPGME_SIG_STAT_BAD = 2, - GPGME_SIG_STAT_NOKEY = 3, - GPGME_SIG_STAT_NOSIG = 4, - GPGME_SIG_STAT_ERROR = 5, - GPGME_SIG_STAT_DIFF = 6, - GPGME_SIG_STAT_GOOD_EXP = 7, - GPGME_SIG_STAT_GOOD_EXPKEY = 8 - } -_gpgme_sig_stat_t; -typedef _gpgme_sig_stat_t gpgme_sig_stat_t _GPGME_DEPRECATED; - - -/* The available signature modes. */ -typedef enum - { - GPGME_SIG_MODE_NORMAL = 0, - GPGME_SIG_MODE_DETACH = 1, - GPGME_SIG_MODE_CLEAR = 2 - } -gpgme_sig_mode_t; - - -/* The available key and signature attributes. Deprecated, use the - individual result structures instead. */ -typedef enum - { - GPGME_ATTR_KEYID = 1, - GPGME_ATTR_FPR = 2, - GPGME_ATTR_ALGO = 3, - GPGME_ATTR_LEN = 4, - GPGME_ATTR_CREATED = 5, - GPGME_ATTR_EXPIRE = 6, - GPGME_ATTR_OTRUST = 7, - GPGME_ATTR_USERID = 8, - GPGME_ATTR_NAME = 9, - GPGME_ATTR_EMAIL = 10, - GPGME_ATTR_COMMENT = 11, - GPGME_ATTR_VALIDITY = 12, - GPGME_ATTR_LEVEL = 13, - GPGME_ATTR_TYPE = 14, - GPGME_ATTR_IS_SECRET = 15, - GPGME_ATTR_KEY_REVOKED = 16, - GPGME_ATTR_KEY_INVALID = 17, - GPGME_ATTR_UID_REVOKED = 18, - GPGME_ATTR_UID_INVALID = 19, - GPGME_ATTR_KEY_CAPS = 20, - GPGME_ATTR_CAN_ENCRYPT = 21, - GPGME_ATTR_CAN_SIGN = 22, - GPGME_ATTR_CAN_CERTIFY = 23, - GPGME_ATTR_KEY_EXPIRED = 24, - GPGME_ATTR_KEY_DISABLED = 25, - GPGME_ATTR_SERIAL = 26, - GPGME_ATTR_ISSUER = 27, - GPGME_ATTR_CHAINID = 28, - GPGME_ATTR_SIG_STATUS = 29, - GPGME_ATTR_ERRTOK = 30, - GPGME_ATTR_SIG_SUMMARY = 31, - GPGME_ATTR_SIG_CLASS = 32 - } -_gpgme_attr_t; -typedef _gpgme_attr_t gpgme_attr_t _GPGME_DEPRECATED; - - -/* The available validities for a trust item or key. */ -typedef enum - { - GPGME_VALIDITY_UNKNOWN = 0, - GPGME_VALIDITY_UNDEFINED = 1, - GPGME_VALIDITY_NEVER = 2, - GPGME_VALIDITY_MARGINAL = 3, - GPGME_VALIDITY_FULL = 4, - GPGME_VALIDITY_ULTIMATE = 5 - } -gpgme_validity_t; - - -/* The available protocols. */ -typedef enum - { - GPGME_PROTOCOL_OpenPGP = 0, /* The default mode. */ - GPGME_PROTOCOL_CMS = 1, - GPGME_PROTOCOL_GPGCONF = 2, /* Special code for gpgconf. */ - GPGME_PROTOCOL_UNKNOWN = 255 - } -gpgme_protocol_t; - - -/* The available keylist mode flags. */ -#define GPGME_KEYLIST_MODE_LOCAL 1 -#define GPGME_KEYLIST_MODE_EXTERN 2 -#define GPGME_KEYLIST_MODE_SIGS 4 -#define GPGME_KEYLIST_MODE_SIG_NOTATIONS 8 -#define GPGME_KEYLIST_MODE_VALIDATE 256 - -typedef unsigned int gpgme_keylist_mode_t; - - -/* Flags for the audit log functions. */ -#define GPGME_AUDITLOG_HTML 1 -#define GPGME_AUDITLOG_WITH_HELP 128 - - -/* Signature notations. */ - -/* The available signature notation flags. */ -#define GPGME_SIG_NOTATION_HUMAN_READABLE 1 -#define GPGME_SIG_NOTATION_CRITICAL 2 - -typedef unsigned int gpgme_sig_notation_flags_t; - -struct _gpgme_sig_notation -{ - struct _gpgme_sig_notation *next; - - /* If NAME is a null pointer, then VALUE contains a policy URL - rather than a notation. */ - char *name; - - /* The value of the notation data. */ - char *value; - - /* The length of the name of the notation data. */ - int name_len; - - /* The length of the value of the notation data. */ - int value_len; - - /* The accumulated flags. */ - gpgme_sig_notation_flags_t flags; - - /* Notation data is human-readable. */ - unsigned int human_readable : 1; - - /* Notation data is critical. */ - unsigned int critical : 1; - - /* Internal to GPGME, do not use. */ - int _unused : 30; -}; -typedef struct _gpgme_sig_notation *gpgme_sig_notation_t; - - -/* The possible stati for the edit operation. */ -typedef enum - { - GPGME_STATUS_EOF, - /* mkstatus processing starts here */ - GPGME_STATUS_ENTER, - GPGME_STATUS_LEAVE, - GPGME_STATUS_ABORT, - - GPGME_STATUS_GOODSIG, - GPGME_STATUS_BADSIG, - GPGME_STATUS_ERRSIG, - - GPGME_STATUS_BADARMOR, - - GPGME_STATUS_RSA_OR_IDEA, - GPGME_STATUS_KEYEXPIRED, - GPGME_STATUS_KEYREVOKED, - - GPGME_STATUS_TRUST_UNDEFINED, - GPGME_STATUS_TRUST_NEVER, - GPGME_STATUS_TRUST_MARGINAL, - GPGME_STATUS_TRUST_FULLY, - GPGME_STATUS_TRUST_ULTIMATE, - - GPGME_STATUS_SHM_INFO, - GPGME_STATUS_SHM_GET, - GPGME_STATUS_SHM_GET_BOOL, - GPGME_STATUS_SHM_GET_HIDDEN, - - GPGME_STATUS_NEED_PASSPHRASE, - GPGME_STATUS_VALIDSIG, - GPGME_STATUS_SIG_ID, - GPGME_STATUS_ENC_TO, - GPGME_STATUS_NODATA, - GPGME_STATUS_BAD_PASSPHRASE, - GPGME_STATUS_NO_PUBKEY, - GPGME_STATUS_NO_SECKEY, - GPGME_STATUS_NEED_PASSPHRASE_SYM, - GPGME_STATUS_DECRYPTION_FAILED, - GPGME_STATUS_DECRYPTION_OKAY, - GPGME_STATUS_MISSING_PASSPHRASE, - GPGME_STATUS_GOOD_PASSPHRASE, - GPGME_STATUS_GOODMDC, - GPGME_STATUS_BADMDC, - GPGME_STATUS_ERRMDC, - GPGME_STATUS_IMPORTED, - GPGME_STATUS_IMPORT_OK, - GPGME_STATUS_IMPORT_PROBLEM, - GPGME_STATUS_IMPORT_RES, - GPGME_STATUS_FILE_START, - GPGME_STATUS_FILE_DONE, - GPGME_STATUS_FILE_ERROR, - - GPGME_STATUS_BEGIN_DECRYPTION, - GPGME_STATUS_END_DECRYPTION, - GPGME_STATUS_BEGIN_ENCRYPTION, - GPGME_STATUS_END_ENCRYPTION, - - GPGME_STATUS_DELETE_PROBLEM, - GPGME_STATUS_GET_BOOL, - GPGME_STATUS_GET_LINE, - GPGME_STATUS_GET_HIDDEN, - GPGME_STATUS_GOT_IT, - GPGME_STATUS_PROGRESS, - GPGME_STATUS_SIG_CREATED, - GPGME_STATUS_SESSION_KEY, - GPGME_STATUS_NOTATION_NAME, - GPGME_STATUS_NOTATION_DATA, - GPGME_STATUS_POLICY_URL, - GPGME_STATUS_BEGIN_STREAM, - GPGME_STATUS_END_STREAM, - GPGME_STATUS_KEY_CREATED, - GPGME_STATUS_USERID_HINT, - GPGME_STATUS_UNEXPECTED, - GPGME_STATUS_INV_RECP, - GPGME_STATUS_NO_RECP, - GPGME_STATUS_ALREADY_SIGNED, - GPGME_STATUS_SIGEXPIRED, - GPGME_STATUS_EXPSIG, - GPGME_STATUS_EXPKEYSIG, - GPGME_STATUS_TRUNCATED, - GPGME_STATUS_ERROR, - GPGME_STATUS_NEWSIG, - GPGME_STATUS_REVKEYSIG, - GPGME_STATUS_SIG_SUBPACKET, - GPGME_STATUS_NEED_PASSPHRASE_PIN, - GPGME_STATUS_SC_OP_FAILURE, - GPGME_STATUS_SC_OP_SUCCESS, - GPGME_STATUS_CARDCTRL, - GPGME_STATUS_BACKUP_KEY_CREATED, - GPGME_STATUS_PKA_TRUST_BAD, - GPGME_STATUS_PKA_TRUST_GOOD, - - GPGME_STATUS_PLAINTEXT - } -gpgme_status_code_t; - - -/* The engine information structure. */ -struct _gpgme_engine_info -{ - struct _gpgme_engine_info *next; - - /* The protocol ID. */ - gpgme_protocol_t protocol; - - /* The file name of the engine binary. */ - char *file_name; - - /* The version string of the installed engine. */ - char *version; - - /* The minimum version required for GPGME. */ - const char *req_version; - - /* The home directory used, or NULL if default. */ - char *home_dir; -}; -typedef struct _gpgme_engine_info *gpgme_engine_info_t; - - -/* A subkey from a key. */ -struct _gpgme_subkey -{ - struct _gpgme_subkey *next; - - /* True if subkey is revoked. */ - unsigned int revoked : 1; - - /* True if subkey is expired. */ - unsigned int expired : 1; - - /* True if subkey is disabled. */ - unsigned int disabled : 1; - - /* True if subkey is invalid. */ - unsigned int invalid : 1; - - /* True if subkey can be used for encryption. */ - unsigned int can_encrypt : 1; - - /* True if subkey can be used for signing. */ - unsigned int can_sign : 1; - - /* True if subkey can be used for certification. */ - unsigned int can_certify : 1; - - /* True if subkey is secret. */ - unsigned int secret : 1; - - /* True if subkey can be used for authentication. */ - unsigned int can_authenticate : 1; - - /* True if subkey is qualified for signatures according to German law. */ - unsigned int is_qualified : 1; - - /* Internal to GPGME, do not use. */ - unsigned int _unused : 22; - - /* Public key algorithm supported by this subkey. */ - gpgme_pubkey_algo_t pubkey_algo; - - /* Length of the subkey. */ - unsigned int length; - - /* The key ID of the subkey. */ - char *keyid; - - /* Internal to GPGME, do not use. */ - char _keyid[16 + 1]; - - /* The fingerprint of the subkey in hex digit form. */ - char *fpr; - - /* The creation timestamp, -1 if invalid, 0 if not available. */ - long int timestamp; - - /* The expiration timestamp, 0 if the subkey does not expire. */ - long int expires; -}; -typedef struct _gpgme_subkey *gpgme_subkey_t; - - -/* A signature on a user ID. */ -struct _gpgme_key_sig -{ - struct _gpgme_key_sig *next; - - /* True if the signature is a revocation signature. */ - unsigned int revoked : 1; - - /* True if the signature is expired. */ - unsigned int expired : 1; - - /* True if the signature is invalid. */ - unsigned int invalid : 1; - - /* True if the signature should be exported. */ - unsigned int exportable : 1; - - /* Internal to GPGME, do not use. */ - unsigned int _unused : 28; - - /* The public key algorithm used to create the signature. */ - gpgme_pubkey_algo_t pubkey_algo; - - /* The key ID of key used to create the signature. */ - char *keyid; - - /* Internal to GPGME, do not use. */ - char _keyid[16 + 1]; - - /* The creation timestamp, -1 if invalid, 0 if not available. */ - long int timestamp; - - /* The expiration timestamp, 0 if the subkey does not expire. */ - long int expires; - - /* Same as in gpgme_signature_t. */ - gpgme_error_t status; - -#ifdef __cplusplus - unsigned int _obsolete_class _GPGME_DEPRECATED; -#else - /* Must be set to SIG_CLASS below. */ - unsigned int class _GPGME_DEPRECATED; -#endif - - /* The user ID string. */ - char *uid; - - /* The name part of the user ID. */ - char *name; - - /* The email part of the user ID. */ - char *email; - - /* The comment part of the user ID. */ - char *comment; - - /* Crypto backend specific signature class. */ - unsigned int sig_class; - - /* Notation data and policy URLs. */ - gpgme_sig_notation_t notations; - - /* Internal to GPGME, do not use. */ - gpgme_sig_notation_t _last_notation; -}; -typedef struct _gpgme_key_sig *gpgme_key_sig_t; - - -/* An user ID from a key. */ -struct _gpgme_user_id -{ - struct _gpgme_user_id *next; - - /* True if the user ID is revoked. */ - unsigned int revoked : 1; - - /* True if the user ID is invalid. */ - unsigned int invalid : 1; - - /* Internal to GPGME, do not use. */ - unsigned int _unused : 30; - - /* The validity of the user ID. */ - gpgme_validity_t validity; - - /* The user ID string. */ - char *uid; - - /* The name part of the user ID. */ - char *name; - - /* The email part of the user ID. */ - char *email; - - /* The comment part of the user ID. */ - char *comment; - - /* The signatures of the user ID. */ - gpgme_key_sig_t signatures; - - /* Internal to GPGME, do not use. */ - gpgme_key_sig_t _last_keysig; -}; -typedef struct _gpgme_user_id *gpgme_user_id_t; - - -/* A key from the keyring. */ -struct _gpgme_key -{ - /* Internal to GPGME, do not use. */ - unsigned int _refs; - - /* True if key is revoked. */ - unsigned int revoked : 1; - - /* True if key is expired. */ - unsigned int expired : 1; - - /* True if key is disabled. */ - unsigned int disabled : 1; - - /* True if key is invalid. */ - unsigned int invalid : 1; - - /* True if key can be used for encryption. */ - unsigned int can_encrypt : 1; - - /* True if key can be used for signing. */ - unsigned int can_sign : 1; - - /* True if key can be used for certification. */ - unsigned int can_certify : 1; - - /* True if key is secret. */ - unsigned int secret : 1; - - /* True if key can be used for authentication. */ - unsigned int can_authenticate : 1; - - /* True if subkey is qualified for signatures according to German law. */ - unsigned int is_qualified : 1; - - /* Internal to GPGME, do not use. */ - unsigned int _unused : 22; - - /* This is the protocol supported by this key. */ - gpgme_protocol_t protocol; - - /* If protocol is GPGME_PROTOCOL_CMS, this string contains the - issuer serial. */ - char *issuer_serial; - - /* If protocol is GPGME_PROTOCOL_CMS, this string contains the - issuer name. */ - char *issuer_name; - - /* If protocol is GPGME_PROTOCOL_CMS, this string contains the chain - ID. */ - char *chain_id; - - /* If protocol is GPGME_PROTOCOL_OpenPGP, this field contains the - owner trust. */ - gpgme_validity_t owner_trust; - - /* The subkeys of the key. */ - gpgme_subkey_t subkeys; - - /* The user IDs of the key. */ - gpgme_user_id_t uids; - - /* Internal to GPGME, do not use. */ - gpgme_subkey_t _last_subkey; - - /* Internal to GPGME, do not use. */ - gpgme_user_id_t _last_uid; - - /* The keylist mode that was active when listing the key. */ - gpgme_keylist_mode_t keylist_mode; -}; -typedef struct _gpgme_key *gpgme_key_t; - - - -/* Types for callback functions. */ - -/* Request a passphrase from the user. */ -typedef gpgme_error_t (*gpgme_passphrase_cb_t) (void *hook, - const char *uid_hint, - const char *passphrase_info, - int prev_was_bad, int fd); - -/* Inform the user about progress made. */ -typedef void (*gpgme_progress_cb_t) (void *opaque, const char *what, - int type, int current, int total); - -/* Interact with the user about an edit operation. */ -typedef gpgme_error_t (*gpgme_edit_cb_t) (void *opaque, - gpgme_status_code_t status, - const char *args, int fd); - - -/* Context management functions. */ - -/* Create a new context and return it in CTX. */ -gpgme_error_t gpgme_new (gpgme_ctx_t *ctx); - -/* Release the context CTX. */ -void gpgme_release (gpgme_ctx_t ctx); - -/* Set the protocol to be used by CTX to PROTO. */ -gpgme_error_t gpgme_set_protocol (gpgme_ctx_t ctx, gpgme_protocol_t proto); - -/* Get the protocol used with CTX */ -gpgme_protocol_t gpgme_get_protocol (gpgme_ctx_t ctx); - -/* Get the string describing protocol PROTO, or NULL if invalid. */ -const char *gpgme_get_protocol_name (gpgme_protocol_t proto); - -/* If YES is non-zero, enable armor mode in CTX, disable it otherwise. */ -void gpgme_set_armor (gpgme_ctx_t ctx, int yes); - -/* Return non-zero if armor mode is set in CTX. */ -int gpgme_get_armor (gpgme_ctx_t ctx); - -/* If YES is non-zero, enable text mode in CTX, disable it otherwise. */ -void gpgme_set_textmode (gpgme_ctx_t ctx, int yes); - -/* Return non-zero if text mode is set in CTX. */ -int gpgme_get_textmode (gpgme_ctx_t ctx); - -/* Use whatever the default of the backend crypto engine is. */ -#define GPGME_INCLUDE_CERTS_DEFAULT -256 - -/* Include up to NR_OF_CERTS certificates in an S/MIME message. */ -void gpgme_set_include_certs (gpgme_ctx_t ctx, int nr_of_certs); - -/* Return the number of certs to include in an S/MIME message. */ -int gpgme_get_include_certs (gpgme_ctx_t ctx); - -/* Set keylist mode in CTX to MODE. */ -gpgme_error_t gpgme_set_keylist_mode (gpgme_ctx_t ctx, - gpgme_keylist_mode_t mode); - -/* Get keylist mode in CTX. */ -gpgme_keylist_mode_t gpgme_get_keylist_mode (gpgme_ctx_t ctx); - -/* Set the passphrase callback function in CTX to CB. HOOK_VALUE is - passed as first argument to the passphrase callback function. */ -void gpgme_set_passphrase_cb (gpgme_ctx_t ctx, - gpgme_passphrase_cb_t cb, void *hook_value); - -/* Get the current passphrase callback function in *CB and the current - hook value in *HOOK_VALUE. */ -void gpgme_get_passphrase_cb (gpgme_ctx_t ctx, gpgme_passphrase_cb_t *cb, - void **hook_value); - -/* Set the progress callback function in CTX to CB. HOOK_VALUE is - passed as first argument to the progress callback function. */ -void gpgme_set_progress_cb (gpgme_ctx_t c, gpgme_progress_cb_t cb, - void *hook_value); - -/* Get the current progress callback function in *CB and the current - hook value in *HOOK_VALUE. */ -void gpgme_get_progress_cb (gpgme_ctx_t ctx, gpgme_progress_cb_t *cb, - void **hook_value); - -/* This function sets the locale for the context CTX, or the default - locale if CTX is a null pointer. */ -gpgme_error_t gpgme_set_locale (gpgme_ctx_t ctx, int category, - const char *value); - -/* Get the information about the configured engines. A pointer to the - first engine in the statically allocated linked list is returned. - The returned data is valid until the next gpgme_ctx_set_engine_info. */ -gpgme_engine_info_t gpgme_ctx_get_engine_info (gpgme_ctx_t ctx); - -/* Set the engine info for the context CTX, protocol PROTO, to the - file name FILE_NAME and the home directory HOME_DIR. */ -gpgme_error_t gpgme_ctx_set_engine_info (gpgme_ctx_t ctx, - gpgme_protocol_t proto, - const char *file_name, - const char *home_dir); - - -/* Return a statically allocated string with the name of the public - key algorithm ALGO, or NULL if that name is not known. */ -const char *gpgme_pubkey_algo_name (gpgme_pubkey_algo_t algo); - -/* Return a statically allocated string with the name of the hash - algorithm ALGO, or NULL if that name is not known. */ -const char *gpgme_hash_algo_name (gpgme_hash_algo_t algo); - - -/* Delete all signers from CTX. */ -void gpgme_signers_clear (gpgme_ctx_t ctx); - -/* Add KEY to list of signers in CTX. */ -gpgme_error_t gpgme_signers_add (gpgme_ctx_t ctx, const gpgme_key_t key); - -/* Return the SEQth signer's key in CTX. */ -gpgme_key_t gpgme_signers_enum (const gpgme_ctx_t ctx, int seq); - -/* Retrieve the signature status of signature IDX in CTX after a - successful verify operation in R_STAT (if non-null). The creation - time stamp of the signature is returned in R_CREATED (if non-null). - The function returns a string containing the fingerprint. - Deprecated, use verify result directly. */ -const char *gpgme_get_sig_status (gpgme_ctx_t ctx, int idx, - _gpgme_sig_stat_t *r_stat, - time_t *r_created) _GPGME_DEPRECATED; - -/* Retrieve certain attributes of a signature. IDX is the index - number of the signature after a successful verify operation. WHAT - is an attribute where GPGME_ATTR_EXPIRE is probably the most useful - one. WHATIDX is to be passed as 0 for most attributes . */ -unsigned long gpgme_get_sig_ulong_attr (gpgme_ctx_t c, int idx, - _gpgme_attr_t what, int whatidx) - _GPGME_DEPRECATED; -const char *gpgme_get_sig_string_attr (gpgme_ctx_t c, int idx, - _gpgme_attr_t what, int whatidx) - _GPGME_DEPRECATED; - - -/* Get the key used to create signature IDX in CTX and return it in - R_KEY. */ -gpgme_error_t gpgme_get_sig_key (gpgme_ctx_t ctx, int idx, gpgme_key_t *r_key) - _GPGME_DEPRECATED; - - -/* Clear all notation data from the context. */ -void gpgme_sig_notation_clear (gpgme_ctx_t ctx); - -/* Add the human-readable notation data with name NAME and value VALUE - to the context CTX, using the flags FLAGS. If NAME is NULL, then - VALUE should be a policy URL. The flag - GPGME_SIG_NOTATION_HUMAN_READABLE is forced to be true for notation - data, and false for policy URLs. */ -gpgme_error_t gpgme_sig_notation_add (gpgme_ctx_t ctx, const char *name, - const char *value, - gpgme_sig_notation_flags_t flags); - -/* Get the sig notations for this context. */ -gpgme_sig_notation_t gpgme_sig_notation_get (gpgme_ctx_t ctx); - - -/* Run control. */ - -/* The type of an I/O callback function. */ -typedef gpgme_error_t (*gpgme_io_cb_t) (void *data, int fd); - -/* The type of a function that can register FNC as the I/O callback - function for the file descriptor FD with direction dir (0: for writing, - 1: for reading). FNC_DATA should be passed as DATA to FNC. The - function should return a TAG suitable for the corresponding - gpgme_remove_io_cb_t, and an error value. */ -typedef gpgme_error_t (*gpgme_register_io_cb_t) (void *data, int fd, int dir, - gpgme_io_cb_t fnc, - void *fnc_data, void **tag); - -/* The type of a function that can remove a previously registered I/O - callback function given TAG as returned by the register - function. */ -typedef void (*gpgme_remove_io_cb_t) (void *tag); - -typedef enum - { - GPGME_EVENT_START, - GPGME_EVENT_DONE, - GPGME_EVENT_NEXT_KEY, - GPGME_EVENT_NEXT_TRUSTITEM - } -gpgme_event_io_t; - -/* The type of a function that is called when a context finished an - operation. */ -typedef void (*gpgme_event_io_cb_t) (void *data, gpgme_event_io_t type, - void *type_data); - -struct gpgme_io_cbs -{ - gpgme_register_io_cb_t add; - void *add_priv; - gpgme_remove_io_cb_t remove; - gpgme_event_io_cb_t event; - void *event_priv; -}; -typedef struct gpgme_io_cbs *gpgme_io_cbs_t; - -/* Set the I/O callback functions in CTX to IO_CBS. */ -void gpgme_set_io_cbs (gpgme_ctx_t ctx, gpgme_io_cbs_t io_cbs); - -/* Get the current I/O callback functions. */ -void gpgme_get_io_cbs (gpgme_ctx_t ctx, gpgme_io_cbs_t io_cbs); - -/* Process the pending operation and, if HANG is non-zero, wait for - the pending operation to finish. */ -gpgme_ctx_t gpgme_wait (gpgme_ctx_t ctx, gpgme_error_t *status, int hang); - - -/* Functions to handle data objects. */ - -/* Read up to SIZE bytes into buffer BUFFER from the data object with - the handle HANDLE. Return the number of characters read, 0 on EOF - and -1 on error. If an error occurs, errno is set. */ -typedef ssize_t (*gpgme_data_read_cb_t) (void *handle, void *buffer, - size_t size); - -/* Write up to SIZE bytes from buffer BUFFER to the data object with - the handle HANDLE. Return the number of characters written, or -1 - on error. If an error occurs, errno is set. */ -typedef ssize_t (*gpgme_data_write_cb_t) (void *handle, const void *buffer, - size_t size); - -/* Set the current position from where the next read or write starts - in the data object with the handle HANDLE to OFFSET, relativ to - WHENCE. */ -typedef off_t (*gpgme_data_seek_cb_t) (void *handle, off_t offset, int whence); - -/* Close the data object with the handle DL. */ -typedef void (*gpgme_data_release_cb_t) (void *handle); - -struct gpgme_data_cbs -{ - gpgme_data_read_cb_t read; - gpgme_data_write_cb_t write; - gpgme_data_seek_cb_t seek; - gpgme_data_release_cb_t release; -}; -typedef struct gpgme_data_cbs *gpgme_data_cbs_t; - -/* Read up to SIZE bytes into buffer BUFFER from the data object with - the handle DH. Return the number of characters read, 0 on EOF and - -1 on error. If an error occurs, errno is set. */ -ssize_t gpgme_data_read (gpgme_data_t dh, void *buffer, size_t size); - -/* Write up to SIZE bytes from buffer BUFFER to the data object with - the handle DH. Return the number of characters written, or -1 on - error. If an error occurs, errno is set. */ -ssize_t gpgme_data_write (gpgme_data_t dh, const void *buffer, size_t size); - -/* Set the current position from where the next read or write starts - in the data object with the handle DH to OFFSET, relativ to - WHENCE. */ -off_t gpgme_data_seek (gpgme_data_t dh, off_t offset, int whence); - -/* Create a new data buffer and return it in R_DH. */ -gpgme_error_t gpgme_data_new (gpgme_data_t *r_dh); - -/* Destroy the data buffer DH. */ -void gpgme_data_release (gpgme_data_t dh); - -/* Create a new data buffer filled with SIZE bytes starting from - BUFFER. If COPY is zero, copying is delayed until necessary, and - the data is taken from the original location when needed. */ -gpgme_error_t gpgme_data_new_from_mem (gpgme_data_t *r_dh, - const char *buffer, size_t size, - int copy); - -/* Destroy the data buffer DH and return a pointer to its content. - The memory has be to released with gpgme_free() by the user. It's - size is returned in R_LEN. */ -char *gpgme_data_release_and_get_mem (gpgme_data_t dh, size_t *r_len); - -/* Release the memory returned by gpgme_data_release_and_get_mem(). */ -void gpgme_free (void *buffer); - -gpgme_error_t gpgme_data_new_from_cbs (gpgme_data_t *dh, - gpgme_data_cbs_t cbs, - void *handle); - -gpgme_error_t gpgme_data_new_from_fd (gpgme_data_t *dh, int fd); - -gpgme_error_t gpgme_data_new_from_stream (gpgme_data_t *dh, FILE *stream); - -/* Return the encoding attribute of the data buffer DH */ -gpgme_data_encoding_t gpgme_data_get_encoding (gpgme_data_t dh); - -/* Set the encoding attribute of data buffer DH to ENC */ -gpgme_error_t gpgme_data_set_encoding (gpgme_data_t dh, - gpgme_data_encoding_t enc); - -/* Get the file name associated with the data object with handle DH, or - NULL if there is none. */ -char *gpgme_data_get_file_name (gpgme_data_t dh); - -/* Set the file name associated with the data object with handle DH to - FILE_NAME. */ -gpgme_error_t gpgme_data_set_file_name (gpgme_data_t dh, - const char *file_name); - - -/* Create a new data buffer which retrieves the data from the callback - function READ_CB. Deprecated, please use gpgme_data_new_from_cbs - instead. */ -gpgme_error_t gpgme_data_new_with_read_cb (gpgme_data_t *r_dh, - int (*read_cb) (void*,char *, - size_t,size_t*), - void *read_cb_value) - _GPGME_DEPRECATED; - -/* Create a new data buffer filled with the content of file FNAME. - COPY must be non-zero. For delayed read, please use - gpgme_data_new_from_fd or gpgme_data_new_from stream instead. */ -gpgme_error_t gpgme_data_new_from_file (gpgme_data_t *r_dh, - const char *fname, - int copy); - -/* Create a new data buffer filled with LENGTH bytes starting from - OFFSET within the file FNAME or stream FP (exactly one must be - non-zero). */ -gpgme_error_t gpgme_data_new_from_filepart (gpgme_data_t *r_dh, - const char *fname, FILE *fp, - off_t offset, size_t length); - -/* Reset the read pointer in DH. Deprecated, please use - gpgme_data_seek instead. */ -gpgme_error_t gpgme_data_rewind (gpgme_data_t dh) _GPGME_DEPRECATED; - - -/* Key and trust functions. */ - -/* Get the key with the fingerprint FPR from the crypto backend. If - SECRET is true, get the secret key. */ -gpgme_error_t gpgme_get_key (gpgme_ctx_t ctx, const char *fpr, - gpgme_key_t *r_key, int secret); - -/* Acquire a reference to KEY. */ -void gpgme_key_ref (gpgme_key_t key); - -/* Release a reference to KEY. If this was the last one the key is - destroyed. */ -void gpgme_key_unref (gpgme_key_t key); -void gpgme_key_release (gpgme_key_t key); - -/* Return the value of the attribute WHAT of KEY, which has to be - representable by a string. IDX specifies the sub key or user ID - for attributes related to sub keys or user IDs. Deprecated, use - key structure directly instead. */ -const char *gpgme_key_get_string_attr (gpgme_key_t key, _gpgme_attr_t what, - const void *reserved, int idx) - _GPGME_DEPRECATED; - -/* Return the value of the attribute WHAT of KEY, which has to be - representable by an unsigned integer. IDX specifies the sub key or - user ID for attributes related to sub keys or user IDs. - Deprecated, use key structure directly instead. */ -unsigned long gpgme_key_get_ulong_attr (gpgme_key_t key, _gpgme_attr_t what, - const void *reserved, int idx) - _GPGME_DEPRECATED; - -/* Return the value of the attribute WHAT of a signature on user ID - UID_IDX in KEY, which has to be representable by a string. IDX - specifies the signature. Deprecated, use key structure directly - instead. */ -const char *gpgme_key_sig_get_string_attr (gpgme_key_t key, int uid_idx, - _gpgme_attr_t what, - const void *reserved, int idx) - _GPGME_DEPRECATED; - -/* Return the value of the attribute WHAT of a signature on user ID - UID_IDX in KEY, which has to be representable by an unsigned - integer string. IDX specifies the signature. Deprecated, use key - structure directly instead. */ -unsigned long gpgme_key_sig_get_ulong_attr (gpgme_key_t key, int uid_idx, - _gpgme_attr_t what, - const void *reserved, int idx) - _GPGME_DEPRECATED; - - -/* Crypto Operations. */ - -/* Cancel a pending asynchronous operation. */ -gpgme_error_t gpgme_cancel (gpgme_ctx_t ctx); - -/* Cancel a pending operation asynchronously. */ -gpgme_error_t gpgme_cancel_async (gpgme_ctx_t ctx); - - -struct _gpgme_invalid_key -{ - struct _gpgme_invalid_key *next; - char *fpr; - gpgme_error_t reason; -}; -typedef struct _gpgme_invalid_key *gpgme_invalid_key_t; - - -/* Encryption. */ -struct _gpgme_op_encrypt_result -{ - /* The list of invalid recipients. */ - gpgme_invalid_key_t invalid_recipients; -}; -typedef struct _gpgme_op_encrypt_result *gpgme_encrypt_result_t; - -/* Retrieve a pointer to the result of the encrypt operation. */ -gpgme_encrypt_result_t gpgme_op_encrypt_result (gpgme_ctx_t ctx); - -/* The valid encryption flags. */ -typedef enum - { - GPGME_ENCRYPT_ALWAYS_TRUST = 1 - } -gpgme_encrypt_flags_t; - -/* Encrypt plaintext PLAIN within CTX for the recipients RECP and - store the resulting ciphertext in CIPHER. */ -gpgme_error_t gpgme_op_encrypt_start (gpgme_ctx_t ctx, gpgme_key_t recp[], - gpgme_encrypt_flags_t flags, - gpgme_data_t plain, gpgme_data_t cipher); -gpgme_error_t gpgme_op_encrypt (gpgme_ctx_t ctx, gpgme_key_t recp[], - gpgme_encrypt_flags_t flags, - gpgme_data_t plain, gpgme_data_t cipher); - -/* Encrypt plaintext PLAIN within CTX for the recipients RECP and - store the resulting ciphertext in CIPHER. Also sign the ciphertext - with the signers in CTX. */ -gpgme_error_t gpgme_op_encrypt_sign_start (gpgme_ctx_t ctx, - gpgme_key_t recp[], - gpgme_encrypt_flags_t flags, - gpgme_data_t plain, - gpgme_data_t cipher); -gpgme_error_t gpgme_op_encrypt_sign (gpgme_ctx_t ctx, gpgme_key_t recp[], - gpgme_encrypt_flags_t flags, - gpgme_data_t plain, gpgme_data_t cipher); - - -/* Decryption. */ - -struct _gpgme_recipient -{ - struct _gpgme_recipient *next; - - /* The key ID of key for which the text was encrypted. */ - char *keyid; - - /* Internal to GPGME, do not use. */ - char _keyid[16 + 1]; - - /* The public key algorithm of the recipient key. */ - gpgme_pubkey_algo_t pubkey_algo; - - /* The status of the recipient. */ - gpgme_error_t status; -}; -typedef struct _gpgme_recipient *gpgme_recipient_t; - -struct _gpgme_op_decrypt_result -{ - char *unsupported_algorithm; - - /* Key should not have been used for encryption. */ - unsigned int wrong_key_usage : 1; - - /* Internal to GPGME, do not use. */ - int _unused : 31; - - gpgme_recipient_t recipients; - - /* The original file name of the plaintext message, if - available. */ - char *file_name; -}; -typedef struct _gpgme_op_decrypt_result *gpgme_decrypt_result_t; - -/* Retrieve a pointer to the result of the decrypt operation. */ -gpgme_decrypt_result_t gpgme_op_decrypt_result (gpgme_ctx_t ctx); - -/* Decrypt ciphertext CIPHER within CTX and store the resulting - plaintext in PLAIN. */ -gpgme_error_t gpgme_op_decrypt_start (gpgme_ctx_t ctx, gpgme_data_t cipher, - gpgme_data_t plain); -gpgme_error_t gpgme_op_decrypt (gpgme_ctx_t ctx, - gpgme_data_t cipher, gpgme_data_t plain); - -/* Decrypt ciphertext CIPHER and make a signature verification within - CTX and store the resulting plaintext in PLAIN. */ -gpgme_error_t gpgme_op_decrypt_verify_start (gpgme_ctx_t ctx, - gpgme_data_t cipher, - gpgme_data_t plain); -gpgme_error_t gpgme_op_decrypt_verify (gpgme_ctx_t ctx, gpgme_data_t cipher, - gpgme_data_t plain); - - -/* Signing. */ -struct _gpgme_new_signature -{ - struct _gpgme_new_signature *next; - - /* The type of the signature. */ - gpgme_sig_mode_t type; - - /* The public key algorithm used to create the signature. */ - gpgme_pubkey_algo_t pubkey_algo; - - /* The hash algorithm used to create the signature. */ - gpgme_hash_algo_t hash_algo; - - /* Internal to GPGME, do not use. Must be set to the same value as - CLASS below. */ - unsigned long _obsolete_class; - - /* Signature creation time. */ - long int timestamp; - - /* The fingerprint of the signature. */ - char *fpr; - -#ifdef __cplusplus - unsigned int _obsolete_class_2; -#else - /* Must be set to SIG_CLASS below. */ - unsigned int class _GPGME_DEPRECATED; -#endif - - /* Crypto backend specific signature class. */ - unsigned int sig_class; -}; -typedef struct _gpgme_new_signature *gpgme_new_signature_t; - -struct _gpgme_op_sign_result -{ - /* The list of invalid signers. */ - gpgme_invalid_key_t invalid_signers; - gpgme_new_signature_t signatures; -}; -typedef struct _gpgme_op_sign_result *gpgme_sign_result_t; - -/* Retrieve a pointer to the result of the signing operation. */ -gpgme_sign_result_t gpgme_op_sign_result (gpgme_ctx_t ctx); - -/* Sign the plaintext PLAIN and store the signature in SIG. */ -gpgme_error_t gpgme_op_sign_start (gpgme_ctx_t ctx, - gpgme_data_t plain, gpgme_data_t sig, - gpgme_sig_mode_t mode); -gpgme_error_t gpgme_op_sign (gpgme_ctx_t ctx, - gpgme_data_t plain, gpgme_data_t sig, - gpgme_sig_mode_t mode); - - -/* Verify. */ - -/* Flags used for the SUMMARY field in a gpgme_signature_t. */ -typedef enum - { - GPGME_SIGSUM_VALID = 0x0001, /* The signature is fully valid. */ - GPGME_SIGSUM_GREEN = 0x0002, /* The signature is good. */ - GPGME_SIGSUM_RED = 0x0004, /* The signature is bad. */ - GPGME_SIGSUM_KEY_REVOKED = 0x0010, /* One key has been revoked. */ - GPGME_SIGSUM_KEY_EXPIRED = 0x0020, /* One key has expired. */ - GPGME_SIGSUM_SIG_EXPIRED = 0x0040, /* The signature has expired. */ - GPGME_SIGSUM_KEY_MISSING = 0x0080, /* Can't verify: key missing. */ - GPGME_SIGSUM_CRL_MISSING = 0x0100, /* CRL not available. */ - GPGME_SIGSUM_CRL_TOO_OLD = 0x0200, /* Available CRL is too old. */ - GPGME_SIGSUM_BAD_POLICY = 0x0400, /* A policy was not met. */ - GPGME_SIGSUM_SYS_ERROR = 0x0800 /* A system error occured. */ - } -gpgme_sigsum_t; - -struct _gpgme_signature -{ - struct _gpgme_signature *next; - - /* A summary of the signature status. */ - gpgme_sigsum_t summary; - - /* The fingerprint or key ID of the signature. */ - char *fpr; - - /* The status of the signature. */ - gpgme_error_t status; - - /* Notation data and policy URLs. */ - gpgme_sig_notation_t notations; - - /* Signature creation time. */ - unsigned long timestamp; - - /* Signature exipration time or 0. */ - unsigned long exp_timestamp; - - /* Key should not have been used for signing. */ - unsigned int wrong_key_usage : 1; - - /* PKA status: 0 = not available, 1 = bad, 2 = okay, 3 = RFU. */ - unsigned int pka_trust : 2; - - /* Validity has been verified using the chain model. */ - unsigned int chain_model : 1; - - /* Internal to GPGME, do not use. */ - int _unused : 28; - - gpgme_validity_t validity; - gpgme_error_t validity_reason; - - /* The public key algorithm used to create the signature. */ - gpgme_pubkey_algo_t pubkey_algo; - - /* The hash algorithm used to create the signature. */ - gpgme_hash_algo_t hash_algo; - - /* The mailbox from the PKA information or NULL. */ - char *pka_address; -}; -typedef struct _gpgme_signature *gpgme_signature_t; - -struct _gpgme_op_verify_result -{ - gpgme_signature_t signatures; - - /* The original file name of the plaintext message, if - available. */ - char *file_name; -}; -typedef struct _gpgme_op_verify_result *gpgme_verify_result_t; - -/* Retrieve a pointer to the result of the verify operation. */ -gpgme_verify_result_t gpgme_op_verify_result (gpgme_ctx_t ctx); - -/* Verify within CTX that SIG is a valid signature for TEXT. */ -gpgme_error_t gpgme_op_verify_start (gpgme_ctx_t ctx, gpgme_data_t sig, - gpgme_data_t signed_text, - gpgme_data_t plaintext); -gpgme_error_t gpgme_op_verify (gpgme_ctx_t ctx, gpgme_data_t sig, - gpgme_data_t signed_text, - gpgme_data_t plaintext); - - -/* Import. */ - -/* The key was new. */ -#define GPGME_IMPORT_NEW 1 - -/* The key contained new user IDs. */ -#define GPGME_IMPORT_UID 2 - -/* The key contained new signatures. */ -#define GPGME_IMPORT_SIG 4 - -/* The key contained new sub keys. */ -#define GPGME_IMPORT_SUBKEY 8 - -/* The key contained a secret key. */ -#define GPGME_IMPORT_SECRET 16 - - -struct _gpgme_import_status -{ - struct _gpgme_import_status *next; - - /* Fingerprint. */ - char *fpr; - - /* If a problem occured, the reason why the key could not be - imported. Otherwise GPGME_No_Error. */ - gpgme_error_t result; - - /* The result of the import, the GPGME_IMPORT_* values bit-wise - ORed. 0 means the key was already known and no new components - have been added. */ - unsigned int status; -}; -typedef struct _gpgme_import_status *gpgme_import_status_t; - -/* Import. */ -struct _gpgme_op_import_result -{ - /* Number of considered keys. */ - int considered; - - /* Keys without user ID. */ - int no_user_id; - - /* Imported keys. */ - int imported; - - /* Imported RSA keys. */ - int imported_rsa; - - /* Unchanged keys. */ - int unchanged; - - /* Number of new user ids. */ - int new_user_ids; - - /* Number of new sub keys. */ - int new_sub_keys; - - /* Number of new signatures. */ - int new_signatures; - - /* Number of new revocations. */ - int new_revocations; - - /* Number of secret keys read. */ - int secret_read; - - /* Number of secret keys imported. */ - int secret_imported; - - /* Number of secret keys unchanged. */ - int secret_unchanged; - - /* Number of new keys skipped. */ - int skipped_new_keys; - - /* Number of keys not imported. */ - int not_imported; - - /* List of keys for which an import was attempted. */ - gpgme_import_status_t imports; -}; -typedef struct _gpgme_op_import_result *gpgme_import_result_t; - -/* Retrieve a pointer to the result of the import operation. */ -gpgme_import_result_t gpgme_op_import_result (gpgme_ctx_t ctx); - -/* Import the key in KEYDATA into the keyring. */ -gpgme_error_t gpgme_op_import_start (gpgme_ctx_t ctx, gpgme_data_t keydata); -gpgme_error_t gpgme_op_import (gpgme_ctx_t ctx, gpgme_data_t keydata); -gpgme_error_t gpgme_op_import_ext (gpgme_ctx_t ctx, gpgme_data_t keydata, - int *nr) _GPGME_DEPRECATED; - - -/* Export the keys found by PATTERN into KEYDATA. */ -gpgme_error_t gpgme_op_export_start (gpgme_ctx_t ctx, const char *pattern, - unsigned int reserved, - gpgme_data_t keydata); -gpgme_error_t gpgme_op_export (gpgme_ctx_t ctx, const char *pattern, - unsigned int reserved, gpgme_data_t keydata); - -gpgme_error_t gpgme_op_export_ext_start (gpgme_ctx_t ctx, - const char *pattern[], - unsigned int reserved, - gpgme_data_t keydata); -gpgme_error_t gpgme_op_export_ext (gpgme_ctx_t ctx, const char *pattern[], - unsigned int reserved, - gpgme_data_t keydata); - - -/* Key generation. */ -struct _gpgme_op_genkey_result -{ - /* A primary key was generated. */ - unsigned int primary : 1; - - /* A sub key was generated. */ - unsigned int sub : 1; - - /* Internal to GPGME, do not use. */ - unsigned int _unused : 30; - - /* The fingerprint of the generated key. */ - char *fpr; -}; -typedef struct _gpgme_op_genkey_result *gpgme_genkey_result_t; - -/* Generate a new keypair and add it to the keyring. PUBKEY and - SECKEY should be null for now. PARMS specifies what keys should be - generated. */ -gpgme_error_t gpgme_op_genkey_start (gpgme_ctx_t ctx, const char *parms, - gpgme_data_t pubkey, gpgme_data_t seckey); -gpgme_error_t gpgme_op_genkey (gpgme_ctx_t ctx, const char *parms, - gpgme_data_t pubkey, gpgme_data_t seckey); - -/* Retrieve a pointer to the result of the genkey operation. */ -gpgme_genkey_result_t gpgme_op_genkey_result (gpgme_ctx_t ctx); - - -/* Delete KEY from the keyring. If ALLOW_SECRET is non-zero, secret - keys are also deleted. */ -gpgme_error_t gpgme_op_delete_start (gpgme_ctx_t ctx, const gpgme_key_t key, - int allow_secret); -gpgme_error_t gpgme_op_delete (gpgme_ctx_t ctx, const gpgme_key_t key, - int allow_secret); - - -/* Edit the key KEY. Send status and command requests to FNC and - output of edit commands to OUT. */ -gpgme_error_t gpgme_op_edit_start (gpgme_ctx_t ctx, gpgme_key_t key, - gpgme_edit_cb_t fnc, void *fnc_value, - gpgme_data_t out); -gpgme_error_t gpgme_op_edit (gpgme_ctx_t ctx, gpgme_key_t key, - gpgme_edit_cb_t fnc, void *fnc_value, - gpgme_data_t out); - -/* Edit the card for the key KEY. Send status and command requests to - FNC and output of edit commands to OUT. */ -gpgme_error_t gpgme_op_card_edit_start (gpgme_ctx_t ctx, gpgme_key_t key, - gpgme_edit_cb_t fnc, void *fnc_value, - gpgme_data_t out); -gpgme_error_t gpgme_op_card_edit (gpgme_ctx_t ctx, gpgme_key_t key, - gpgme_edit_cb_t fnc, void *fnc_value, - gpgme_data_t out); - - -/* Key management functions. */ -struct _gpgme_op_keylist_result -{ - unsigned int truncated : 1; - - /* Internal to GPGME, do not use. */ - unsigned int _unused : 31; -}; -typedef struct _gpgme_op_keylist_result *gpgme_keylist_result_t; - -/* Retrieve a pointer to the result of the key listing operation. */ -gpgme_keylist_result_t gpgme_op_keylist_result (gpgme_ctx_t ctx); - -/* Start a keylist operation within CTX, searching for keys which - match PATTERN. If SECRET_ONLY is true, only secret keys are - returned. */ -gpgme_error_t gpgme_op_keylist_start (gpgme_ctx_t ctx, const char *pattern, - int secret_only); -gpgme_error_t gpgme_op_keylist_ext_start (gpgme_ctx_t ctx, - const char *pattern[], - int secret_only, int reserved); - -/* Return the next key from the keylist in R_KEY. */ -gpgme_error_t gpgme_op_keylist_next (gpgme_ctx_t ctx, gpgme_key_t *r_key); - -/* Terminate a pending keylist operation within CTX. */ -gpgme_error_t gpgme_op_keylist_end (gpgme_ctx_t ctx); - - -/* Trust items and operations. */ - -struct _gpgme_trust_item -{ - /* Internal to GPGME, do not use. */ - unsigned int _refs; - - /* The key ID to which the trust item belongs. */ - char *keyid; - - /* Internal to GPGME, do not use. */ - char _keyid[16 + 1]; - - /* The type of the trust item, 1 refers to a key, 2 to a user ID. */ - int type; - - /* The trust level. */ - int level; - - /* The owner trust if TYPE is 1. */ - char *owner_trust; - - /* Internal to GPGME, do not use. */ - char _owner_trust[2]; - - /* The calculated validity. */ - char *validity; - - /* Internal to GPGME, do not use. */ - char _validity[2]; - - /* The user name if TYPE is 2. */ - char *name; -}; -typedef struct _gpgme_trust_item *gpgme_trust_item_t; - -/* Start a trustlist operation within CTX, searching for trust items - which match PATTERN. */ -gpgme_error_t gpgme_op_trustlist_start (gpgme_ctx_t ctx, - const char *pattern, int max_level); - -/* Return the next trust item from the trustlist in R_ITEM. */ -gpgme_error_t gpgme_op_trustlist_next (gpgme_ctx_t ctx, - gpgme_trust_item_t *r_item); - -/* Terminate a pending trustlist operation within CTX. */ -gpgme_error_t gpgme_op_trustlist_end (gpgme_ctx_t ctx); - -/* Acquire a reference to ITEM. */ -void gpgme_trust_item_ref (gpgme_trust_item_t item); - -/* Release a reference to ITEM. If this was the last one the trust - item is destroyed. */ -void gpgme_trust_item_unref (gpgme_trust_item_t item); - -/* Release the trust item ITEM. Deprecated, use - gpgme_trust_item_unref. */ -void gpgme_trust_item_release (gpgme_trust_item_t item) _GPGME_DEPRECATED; - -/* Return the value of the attribute WHAT of ITEM, which has to be - representable by a string. Deprecated, use trust item structure - directly. */ -const char *gpgme_trust_item_get_string_attr (gpgme_trust_item_t item, - _gpgme_attr_t what, - const void *reserved, int idx) - _GPGME_DEPRECATED; - -/* Return the value of the attribute WHAT of KEY, which has to be - representable by an integer. IDX specifies a running index if the - attribute appears more than once in the key. Deprecated, use trust - item structure directly. */ -int gpgme_trust_item_get_int_attr (gpgme_trust_item_t item, _gpgme_attr_t what, - const void *reserved, int idx) - _GPGME_DEPRECATED; - - -/* Return the auditlog for the current session. This may be called - after a successful or failed operation. If no audit log is - available GPG_ERR_NO_DATA is returned. */ -gpgme_error_t gpgme_op_getauditlog_start (gpgme_ctx_t ctx, gpgme_data_t output, - unsigned int flags); -gpgme_error_t gpgme_op_getauditlog (gpgme_ctx_t ctx, gpgme_data_t output, - unsigned int flags); - - -/* Interface to gpgconf(1). */ - -/* The expert level at which a configuration option or group of - options should be displayed. See the gpgconf(1) documentation for - more details. */ -typedef enum - { - GPGME_CONF_BASIC = 0, - GPGME_CONF_ADVANCED = 1, - GPGME_CONF_EXPERT = 2, - GPGME_CONF_INVISIBLE = 3, - GPGME_CONF_INTERNAL = 4 - } -gpgme_conf_level_t; - - -/* The data type of a configuration option argument. See the gpgconf(1) - documentation for more details. */ -typedef enum - { - /* Basic types. */ - GPGME_CONF_NONE = 0, - GPGME_CONF_STRING = 1, - GPGME_CONF_INT32 = 2, - GPGME_CONF_UINT32 = 3, - - /* Complex types. */ - GPGME_CONF_FILENAME = 32, - GPGME_CONF_LDAP_SERVER = 33, - GPGME_CONF_KEY_FPR = 34, - GPGME_CONF_PUB_KEY = 35, - GPGME_CONF_SEC_KEY = 36, - GPGME_CONF_ALIAS_LIST = 37 - } -gpgme_conf_type_t; -/* Macro for backward compatibility (even though it was undocumented - and marked as experimental in 1.1.6 - will be removed after 1.1.7): */ -#define GPGME_CONF_PATHNAME GPGME_CONF_FILENAME - - -/* This represents a single argument for a configuration option. - Which of the members of value is used depends on the ALT_TYPE. */ -typedef struct gpgme_conf_arg -{ - struct gpgme_conf_arg *next; - /* True if the option appears without an (optional) argument. */ - unsigned int no_arg; - union - { - unsigned int count; - unsigned int uint32; - int int32; - char *string; - } value; -} *gpgme_conf_arg_t; - - -/* The flags of a configuration option. See the gpg-conf - documentation for details. */ -#define GPGME_CONF_GROUP (1 << 0) -#define GPGME_CONF_OPTIONAL (1 << 1) -#define GPGME_CONF_LIST (1 << 2) -#define GPGME_CONF_RUNTIME (1 << 3) -#define GPGME_CONF_DEFAULT (1 << 4) -#define GPGME_CONF_DEFAULT_DESC (1 << 5) -#define GPGME_CONF_NO_ARG_DESC (1 << 6) -#define GPGME_CONF_NO_CHANGE (1 << 7) - - -/* The representation of a single configuration option. See the - gpg-conf documentation for details. */ -typedef struct gpgme_conf_opt -{ - struct gpgme_conf_opt *next; - - /* The option name. */ - char *name; - - /* The flags for this option. */ - unsigned int flags; - - /* The level of this option. */ - gpgme_conf_level_t level; - - /* The localized description of this option. */ - char *description; - - /* The type and alternate type of this option. */ - gpgme_conf_type_t type; - gpgme_conf_type_t alt_type; - - /* The localized (short) name of the argument, if any. */ - char *argname; - - /* The default value. */ - gpgme_conf_arg_t default_value; - char *default_description; - - /* The default value if the option is not set. */ - gpgme_conf_arg_t no_arg_value; - char *no_arg_description; - - /* The current value if the option is set. */ - gpgme_conf_arg_t value; - - /* The new value, if any. NULL means reset to default. */ - int change_value; - gpgme_conf_arg_t new_value; - - /* Free for application use. */ - void *user_data; -} *gpgme_conf_opt_t; - - -/* The representation of a component that can be configured. See the - gpg-conf documentation for details. */ -typedef struct gpgme_conf_comp -{ - struct gpgme_conf_comp *next; - - /* Internal to GPGME, do not use! */ - gpgme_conf_opt_t *_last_opt_p; - - /* The component name. */ - char *name; - - /* A human-readable description for the component. */ - char *description; - - /* The program name (an absolute path to the program). */ - char *program_name; - - /* A linked list of options for this component. */ - struct gpgme_conf_opt *options; -} *gpgme_conf_comp_t; - - -/* Allocate a new gpgme_conf_arg_t. If VALUE is NULL, a "no arg - default" is prepared. If type is a string type, VALUE should point - to the string. Else, it should point to an unsigned or signed - integer respectively. */ -gpgme_error_t gpgme_conf_arg_new (gpgme_conf_arg_t *arg_p, - gpgme_conf_type_t type, void *value); - -/* This also releases all chained argument structures! */ -void gpgme_conf_arg_release (gpgme_conf_arg_t arg, gpgme_conf_type_t type); - -/* Register a change for the value of OPT to ARG. If RESET is 1 (do - not use any values but 0 or 1), ARG is ignored and the option is - not changed (reverting a previous change). Otherwise, if ARG is - NULL, the option is cleared or reset to its default. */ -gpgme_error_t gpgme_conf_opt_change (gpgme_conf_opt_t opt, int reset, - gpgme_conf_arg_t arg); - -/* Release a set of configurations. */ -void gpgme_conf_release (gpgme_conf_comp_t conf); - -/* Retrieve the current configurations. */ -gpgme_error_t gpgme_op_conf_load (gpgme_ctx_t ctx, gpgme_conf_comp_t *conf_p); - -/* Save the configuration of component comp. This function does not - follow chained components! */ -gpgme_error_t gpgme_op_conf_save (gpgme_ctx_t ctx, gpgme_conf_comp_t comp); - - -/* Various functions. */ - -/* Check that the library fulfills the version requirement. */ -const char *gpgme_check_version (const char *req_version); - -/* Get the information about the configured and installed engines. A - pointer to the first engine in the statically allocated linked list - is returned in *INFO. If an error occurs, it is returned. The - returned data is valid until the next gpgme_set_engine_info. */ -gpgme_error_t gpgme_get_engine_info (gpgme_engine_info_t *engine_info); - -/* Set the default engine info for the protocol PROTO to the file name - FILE_NAME and the home directory HOME_DIR. */ -gpgme_error_t gpgme_set_engine_info (gpgme_protocol_t proto, - const char *file_name, - const char *home_dir); - - -/* Engine support functions. */ - -/* Verify that the engine implementing PROTO is installed and - available. */ -gpgme_error_t gpgme_engine_check_version (gpgme_protocol_t proto); - - -/* Deprecated types. */ -typedef gpgme_ctx_t GpgmeCtx _GPGME_DEPRECATED; -typedef gpgme_data_t GpgmeData _GPGME_DEPRECATED; -typedef gpgme_error_t GpgmeError _GPGME_DEPRECATED; -typedef gpgme_data_encoding_t GpgmeDataEncoding _GPGME_DEPRECATED; -typedef gpgme_pubkey_algo_t GpgmePubKeyAlgo _GPGME_DEPRECATED; -typedef gpgme_hash_algo_t GpgmeHashAlgo _GPGME_DEPRECATED; -typedef gpgme_sig_stat_t GpgmeSigStat _GPGME_DEPRECATED; -typedef gpgme_sig_mode_t GpgmeSigMode _GPGME_DEPRECATED; -typedef gpgme_attr_t GpgmeAttr _GPGME_DEPRECATED; -typedef gpgme_validity_t GpgmeValidity _GPGME_DEPRECATED; -typedef gpgme_protocol_t GpgmeProtocol _GPGME_DEPRECATED; -typedef gpgme_engine_info_t GpgmeEngineInfo _GPGME_DEPRECATED; -typedef gpgme_subkey_t GpgmeSubkey _GPGME_DEPRECATED; -typedef gpgme_key_sig_t GpgmeKeySig _GPGME_DEPRECATED; -typedef gpgme_user_id_t GpgmeUserID _GPGME_DEPRECATED; -typedef gpgme_key_t GpgmeKey _GPGME_DEPRECATED; -typedef gpgme_passphrase_cb_t GpgmePassphraseCb _GPGME_DEPRECATED; -typedef gpgme_progress_cb_t GpgmeProgressCb _GPGME_DEPRECATED; -typedef gpgme_io_cb_t GpgmeIOCb _GPGME_DEPRECATED; -typedef gpgme_register_io_cb_t GpgmeRegisterIOCb _GPGME_DEPRECATED; -typedef gpgme_remove_io_cb_t GpgmeRemoveIOCb _GPGME_DEPRECATED; -typedef gpgme_event_io_t GpgmeEventIO _GPGME_DEPRECATED; -typedef gpgme_event_io_cb_t GpgmeEventIOCb _GPGME_DEPRECATED; -#define GpgmeIOCbs gpgme_io_cbs -typedef gpgme_data_read_cb_t GpgmeDataReadCb _GPGME_DEPRECATED; -typedef gpgme_data_write_cb_t GpgmeDataWriteCb _GPGME_DEPRECATED; -typedef gpgme_data_seek_cb_t GpgmeDataSeekCb _GPGME_DEPRECATED; -typedef gpgme_data_release_cb_t GpgmeDataReleaseCb _GPGME_DEPRECATED; -#define GpgmeDataCbs gpgme_data_cbs -typedef gpgme_encrypt_result_t GpgmeEncryptResult _GPGME_DEPRECATED; -typedef gpgme_sig_notation_t GpgmeSigNotation _GPGME_DEPRECATED; -typedef gpgme_signature_t GpgmeSignature _GPGME_DEPRECATED; -typedef gpgme_verify_result_t GpgmeVerifyResult _GPGME_DEPRECATED; -typedef gpgme_import_status_t GpgmeImportStatus _GPGME_DEPRECATED; -typedef gpgme_import_result_t GpgmeImportResult _GPGME_DEPRECATED; -typedef gpgme_genkey_result_t GpgmeGenKeyResult _GPGME_DEPRECATED; -typedef gpgme_trust_item_t GpgmeTrustItem _GPGME_DEPRECATED; -typedef gpgme_status_code_t GpgmeStatusCode _GPGME_DEPRECATED; - -#ifdef __cplusplus -} -#endif -#endif /* GPGME_H */ diff -urpNP gpgme-1.1.8/src/gpgme.h.in gpgme-1.2.0/src/gpgme.h.in --- gpgme-1.1.8/src/gpgme.h.in 2008-11-03 16:50:12.000000000 +0000 +++ gpgme-1.2.0/src/gpgme.h.in 2009-06-18 16:09:23.000000000 +0000 @@ -1,6 +1,6 @@ /* gpgme.h - Public interface to GnuPG Made Easy. -*- c -*- Copyright (C) 2000 Werner Koch (dd9jn) - Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007 g10 Code GmbH + Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2009 g10 Code GmbH This file is part of GPGME. @@ -74,6 +74,17 @@ extern "C" { library. */ #define GPGME_VERSION "@PACKAGE_VERSION@" +/* Check for a matching _FILE_OFFSET_BITS definition. */ +#if @NEED__FILE_OFFSET_BITS@ +#ifndef _FILE_OFFSET_BITS +#error GPGME was compiled with _FILE_OFFSET_BITS = @NEED__FILE_OFFSET_BITS@, please see the section "Largefile support (LFS)" in the GPGME manual. +#else +#if (_FILE_OFFSET_BITS) != (@NEED__FILE_OFFSET_BITS@) +#error GPGME was compiled with a different value for _FILE_OFFSET_BITS, namely @NEED__FILE_OFFSET_BITS@, please see the section "Largefile support (LFS)" in the GPGME manual. +#endif +#endif +#endif + /* Some opaque data types used by GPGME. */ @@ -174,7 +185,10 @@ typedef enum GPGME_DATA_ENCODING_NONE = 0, /* Not specified. */ GPGME_DATA_ENCODING_BINARY = 1, GPGME_DATA_ENCODING_BASE64 = 2, - GPGME_DATA_ENCODING_ARMOR = 3 /* Either PEM or OpenPGP Armor. */ + GPGME_DATA_ENCODING_ARMOR = 3, /* Either PEM or OpenPGP Armor. */ + GPGME_DATA_ENCODING_URL = 4, /* LF delimited URL list. */ + GPGME_DATA_ENCODING_URLESC = 5, /* Ditto, but percent escaped. */ + GPGME_DATA_ENCODING_URL0 = 6 /* Nul delimited URL list. */ } gpgme_data_encoding_t; @@ -301,6 +315,7 @@ typedef enum GPGME_PROTOCOL_OpenPGP = 0, /* The default mode. */ GPGME_PROTOCOL_CMS = 1, GPGME_PROTOCOL_GPGCONF = 2, /* Special code for gpgconf. */ + GPGME_PROTOCOL_ASSUAN = 3, /* Low-level access to an Assuan server. */ GPGME_PROTOCOL_UNKNOWN = 255 } gpgme_protocol_t; @@ -311,11 +326,18 @@ gpgme_protocol_t; #define GPGME_KEYLIST_MODE_EXTERN 2 #define GPGME_KEYLIST_MODE_SIGS 4 #define GPGME_KEYLIST_MODE_SIG_NOTATIONS 8 +#define GPGME_KEYLIST_MODE_EPHEMERAL 128 #define GPGME_KEYLIST_MODE_VALIDATE 256 typedef unsigned int gpgme_keylist_mode_t; +/* The available export mode flags. */ +#define GPGME_EXPORT_MODE_EXTERN 2 + +typedef unsigned int gpgme_export_mode_t; + + /* Flags for the audit log functions. */ #define GPGME_AUDITLOG_HTML 1 #define GPGME_AUDITLOG_WITH_HELP 128 @@ -364,98 +386,98 @@ typedef struct _gpgme_sig_notation *gpgm /* The possible stati for the edit operation. */ typedef enum { - GPGME_STATUS_EOF, + GPGME_STATUS_EOF = 0, /* mkstatus processing starts here */ - GPGME_STATUS_ENTER, - GPGME_STATUS_LEAVE, - GPGME_STATUS_ABORT, - - GPGME_STATUS_GOODSIG, - GPGME_STATUS_BADSIG, - GPGME_STATUS_ERRSIG, - - GPGME_STATUS_BADARMOR, - - GPGME_STATUS_RSA_OR_IDEA, - GPGME_STATUS_KEYEXPIRED, - GPGME_STATUS_KEYREVOKED, - - GPGME_STATUS_TRUST_UNDEFINED, - GPGME_STATUS_TRUST_NEVER, - GPGME_STATUS_TRUST_MARGINAL, - GPGME_STATUS_TRUST_FULLY, - GPGME_STATUS_TRUST_ULTIMATE, - - GPGME_STATUS_SHM_INFO, - GPGME_STATUS_SHM_GET, - GPGME_STATUS_SHM_GET_BOOL, - GPGME_STATUS_SHM_GET_HIDDEN, - - GPGME_STATUS_NEED_PASSPHRASE, - GPGME_STATUS_VALIDSIG, - GPGME_STATUS_SIG_ID, - GPGME_STATUS_ENC_TO, - GPGME_STATUS_NODATA, - GPGME_STATUS_BAD_PASSPHRASE, - GPGME_STATUS_NO_PUBKEY, - GPGME_STATUS_NO_SECKEY, - GPGME_STATUS_NEED_PASSPHRASE_SYM, - GPGME_STATUS_DECRYPTION_FAILED, - GPGME_STATUS_DECRYPTION_OKAY, - GPGME_STATUS_MISSING_PASSPHRASE, - GPGME_STATUS_GOOD_PASSPHRASE, - GPGME_STATUS_GOODMDC, - GPGME_STATUS_BADMDC, - GPGME_STATUS_ERRMDC, - GPGME_STATUS_IMPORTED, - GPGME_STATUS_IMPORT_OK, - GPGME_STATUS_IMPORT_PROBLEM, - GPGME_STATUS_IMPORT_RES, - GPGME_STATUS_FILE_START, - GPGME_STATUS_FILE_DONE, - GPGME_STATUS_FILE_ERROR, - - GPGME_STATUS_BEGIN_DECRYPTION, - GPGME_STATUS_END_DECRYPTION, - GPGME_STATUS_BEGIN_ENCRYPTION, - GPGME_STATUS_END_ENCRYPTION, - - GPGME_STATUS_DELETE_PROBLEM, - GPGME_STATUS_GET_BOOL, - GPGME_STATUS_GET_LINE, - GPGME_STATUS_GET_HIDDEN, - GPGME_STATUS_GOT_IT, - GPGME_STATUS_PROGRESS, - GPGME_STATUS_SIG_CREATED, - GPGME_STATUS_SESSION_KEY, - GPGME_STATUS_NOTATION_NAME, - GPGME_STATUS_NOTATION_DATA, - GPGME_STATUS_POLICY_URL, - GPGME_STATUS_BEGIN_STREAM, - GPGME_STATUS_END_STREAM, - GPGME_STATUS_KEY_CREATED, - GPGME_STATUS_USERID_HINT, - GPGME_STATUS_UNEXPECTED, - GPGME_STATUS_INV_RECP, - GPGME_STATUS_NO_RECP, - GPGME_STATUS_ALREADY_SIGNED, - GPGME_STATUS_SIGEXPIRED, - GPGME_STATUS_EXPSIG, - GPGME_STATUS_EXPKEYSIG, - GPGME_STATUS_TRUNCATED, - GPGME_STATUS_ERROR, - GPGME_STATUS_NEWSIG, - GPGME_STATUS_REVKEYSIG, - GPGME_STATUS_SIG_SUBPACKET, - GPGME_STATUS_NEED_PASSPHRASE_PIN, - GPGME_STATUS_SC_OP_FAILURE, - GPGME_STATUS_SC_OP_SUCCESS, - GPGME_STATUS_CARDCTRL, - GPGME_STATUS_BACKUP_KEY_CREATED, - GPGME_STATUS_PKA_TRUST_BAD, - GPGME_STATUS_PKA_TRUST_GOOD, + GPGME_STATUS_ENTER = 1, + GPGME_STATUS_LEAVE = 2, + GPGME_STATUS_ABORT = 3, + + GPGME_STATUS_GOODSIG = 4, + GPGME_STATUS_BADSIG = 5, + GPGME_STATUS_ERRSIG = 6, + + GPGME_STATUS_BADARMOR = 7, + + GPGME_STATUS_RSA_OR_IDEA = 8, + GPGME_STATUS_KEYEXPIRED = 9, + GPGME_STATUS_KEYREVOKED = 10, + + GPGME_STATUS_TRUST_UNDEFINED = 11, + GPGME_STATUS_TRUST_NEVER = 12, + GPGME_STATUS_TRUST_MARGINAL = 13, + GPGME_STATUS_TRUST_FULLY = 14, + GPGME_STATUS_TRUST_ULTIMATE = 15, + + GPGME_STATUS_SHM_INFO = 16, + GPGME_STATUS_SHM_GET = 17, + GPGME_STATUS_SHM_GET_BOOL = 18, + GPGME_STATUS_SHM_GET_HIDDEN = 19, + + GPGME_STATUS_NEED_PASSPHRASE = 20, + GPGME_STATUS_VALIDSIG = 21, + GPGME_STATUS_SIG_ID = 22, + GPGME_STATUS_ENC_TO = 23, + GPGME_STATUS_NODATA = 24, + GPGME_STATUS_BAD_PASSPHRASE = 25, + GPGME_STATUS_NO_PUBKEY = 26, + GPGME_STATUS_NO_SECKEY = 27, + GPGME_STATUS_NEED_PASSPHRASE_SYM = 28, + GPGME_STATUS_DECRYPTION_FAILED = 29, + GPGME_STATUS_DECRYPTION_OKAY = 30, + GPGME_STATUS_MISSING_PASSPHRASE = 31, + GPGME_STATUS_GOOD_PASSPHRASE = 32, + GPGME_STATUS_GOODMDC = 33, + GPGME_STATUS_BADMDC = 34, + GPGME_STATUS_ERRMDC = 35, + GPGME_STATUS_IMPORTED = 36, + GPGME_STATUS_IMPORT_OK = 37, + GPGME_STATUS_IMPORT_PROBLEM = 38, + GPGME_STATUS_IMPORT_RES = 39, + GPGME_STATUS_FILE_START = 40, + GPGME_STATUS_FILE_DONE = 41, + GPGME_STATUS_FILE_ERROR = 42, + + GPGME_STATUS_BEGIN_DECRYPTION = 43, + GPGME_STATUS_END_DECRYPTION = 44, + GPGME_STATUS_BEGIN_ENCRYPTION = 45, + GPGME_STATUS_END_ENCRYPTION = 46, + + GPGME_STATUS_DELETE_PROBLEM = 47, + GPGME_STATUS_GET_BOOL = 48, + GPGME_STATUS_GET_LINE = 49, + GPGME_STATUS_GET_HIDDEN = 50, + GPGME_STATUS_GOT_IT = 51, + GPGME_STATUS_PROGRESS = 52, + GPGME_STATUS_SIG_CREATED = 53, + GPGME_STATUS_SESSION_KEY = 54, + GPGME_STATUS_NOTATION_NAME = 55, + GPGME_STATUS_NOTATION_DATA = 56, + GPGME_STATUS_POLICY_URL = 57, + GPGME_STATUS_BEGIN_STREAM = 58, + GPGME_STATUS_END_STREAM = 59, + GPGME_STATUS_KEY_CREATED = 60, + GPGME_STATUS_USERID_HINT = 61, + GPGME_STATUS_UNEXPECTED = 62, + GPGME_STATUS_INV_RECP = 63, + GPGME_STATUS_NO_RECP = 64, + GPGME_STATUS_ALREADY_SIGNED = 65, + GPGME_STATUS_SIGEXPIRED = 66, + GPGME_STATUS_EXPSIG = 67, + GPGME_STATUS_EXPKEYSIG = 68, + GPGME_STATUS_TRUNCATED = 69, + GPGME_STATUS_ERROR = 70, + GPGME_STATUS_NEWSIG = 71, + GPGME_STATUS_REVKEYSIG = 72, + GPGME_STATUS_SIG_SUBPACKET = 73, + GPGME_STATUS_NEED_PASSPHRASE_PIN = 74, + GPGME_STATUS_SC_OP_FAILURE = 75, + GPGME_STATUS_SC_OP_SUCCESS = 76, + GPGME_STATUS_CARDCTRL = 77, + GPGME_STATUS_BACKUP_KEY_CREATED = 78, + GPGME_STATUS_PKA_TRUST_BAD = 79, + GPGME_STATUS_PKA_TRUST_GOOD = 80, - GPGME_STATUS_PLAINTEXT + GPGME_STATUS_PLAINTEXT = 81 } gpgme_status_code_t; @@ -518,8 +540,11 @@ struct _gpgme_subkey /* True if subkey is qualified for signatures according to German law. */ unsigned int is_qualified : 1; + /* True if the secret key is stored on a smart card. */ + unsigned int is_cardkey : 1; + /* Internal to GPGME, do not use. */ - unsigned int _unused : 22; + unsigned int _unused : 21; /* Public key algorithm supported by this subkey. */ gpgme_pubkey_algo_t pubkey_algo; @@ -541,6 +566,9 @@ struct _gpgme_subkey /* The expiration timestamp, 0 if the subkey does not expire. */ long int expires; + + /* The serial number of a smart card holding this key or NULL. */ + char *card_number; }; typedef struct _gpgme_subkey *gpgme_subkey_t; @@ -746,6 +774,8 @@ typedef gpgme_error_t (*gpgme_edit_cb_t) gpgme_status_code_t status, const char *args, int fd); + + /* Context management functions. */ @@ -940,6 +970,11 @@ void gpgme_set_io_cbs (gpgme_ctx_t ctx, /* Get the current I/O callback functions. */ void gpgme_get_io_cbs (gpgme_ctx_t ctx, gpgme_io_cbs_t io_cbs); +/* Wrappers around the internal I/O functions for use with + gpgme_passphrase_cb_t and gpgme_edit_cb_t. */ +ssize_t gpgme_io_read (int fd, void *buffer, size_t count); +ssize_t gpgme_io_write (int fd, const void *buffer, size_t count); + /* Process the pending operation and, if HANG is non-zero, wait for the pending operation to finish. */ gpgme_ctx_t gpgme_wait (gpgme_ctx_t ctx, gpgme_error_t *status, int hang); @@ -1147,7 +1182,8 @@ gpgme_encrypt_result_t gpgme_op_encrypt_ /* The valid encryption flags. */ typedef enum { - GPGME_ENCRYPT_ALWAYS_TRUST = 1 + GPGME_ENCRYPT_ALWAYS_TRUST = 1, + GPGME_ENCRYPT_NO_ENCRYPT_TO = 2 } gpgme_encrypt_flags_t; @@ -1470,22 +1506,39 @@ gpgme_error_t gpgme_op_import (gpgme_ctx gpgme_error_t gpgme_op_import_ext (gpgme_ctx_t ctx, gpgme_data_t keydata, int *nr) _GPGME_DEPRECATED; +/* Import the keys from the array KEYS into the keyring. */ +gpgme_error_t gpgme_op_import_keys_start (gpgme_ctx_t ctx, gpgme_key_t keys[]); +gpgme_error_t gpgme_op_import_keys (gpgme_ctx_t ctx, gpgme_key_t keys[]); + + /* Export the keys found by PATTERN into KEYDATA. */ gpgme_error_t gpgme_op_export_start (gpgme_ctx_t ctx, const char *pattern, - unsigned int reserved, + gpgme_export_mode_t mode, gpgme_data_t keydata); gpgme_error_t gpgme_op_export (gpgme_ctx_t ctx, const char *pattern, - unsigned int reserved, gpgme_data_t keydata); + gpgme_export_mode_t mode, + gpgme_data_t keydata); gpgme_error_t gpgme_op_export_ext_start (gpgme_ctx_t ctx, const char *pattern[], - unsigned int reserved, + gpgme_export_mode_t mode, gpgme_data_t keydata); gpgme_error_t gpgme_op_export_ext (gpgme_ctx_t ctx, const char *pattern[], - unsigned int reserved, + gpgme_export_mode_t mode, gpgme_data_t keydata); +/* Export the keys from the array KEYS into KEYDATA. */ +gpgme_error_t gpgme_op_export_keys_start (gpgme_ctx_t ctx, + gpgme_key_t keys[], + gpgme_export_mode_t mode, + gpgme_data_t keydata); +gpgme_error_t gpgme_op_export_keys (gpgme_ctx_t ctx, + gpgme_key_t keys[], + gpgme_export_mode_t mode, + gpgme_data_t keydata); + + /* Key generation. */ struct _gpgme_op_genkey_result @@ -1656,6 +1709,54 @@ gpgme_error_t gpgme_op_getauditlog_start gpgme_error_t gpgme_op_getauditlog (gpgme_ctx_t ctx, gpgme_data_t output, unsigned int flags); + + +/* Low-level Assuan protocol access. */ +typedef gpgme_error_t (*gpgme_assuan_data_cb_t) + (void *opaque, const void *data, size_t datalen); + +typedef gpgme_error_t (*gpgme_assuan_inquire_cb_t) + (void *opaque, const char *name, const char *args, + gpgme_data_t *r_data); + +typedef gpgme_error_t (*gpgme_assuan_status_cb_t) + (void *opaque, const char *status, const char *args); + +struct _gpgme_op_assuan_result +{ + /* The result of the actual assuan command. An OK is indicated by a + value of 0 and an ERR by the respective error error value. */ + gpgme_error_t err; +}; +typedef struct _gpgme_op_assuan_result *gpgme_assuan_result_t; + + +/* Return the result of the last Assuan command. */ +gpgme_assuan_result_t gpgme_op_assuan_result (gpgme_ctx_t ctx); + +/* Send the Assuan COMMAND and return results via the callbacks. + Asynchronous variant. */ +gpgme_error_t gpgme_op_assuan_transact_start (gpgme_ctx_t ctx, + const char *command, + gpgme_assuan_data_cb_t data_cb, + void *data_cb_value, + gpgme_assuan_inquire_cb_t inq_cb, + void *inq_cb_value, + gpgme_assuan_status_cb_t stat_cb, + void *stat_cb_value); + +/* Send the Assuan COMMAND and return results via the callbacks. + Synchronous variant. */ +gpgme_error_t gpgme_op_assuan_transact (gpgme_ctx_t ctx, + const char *command, + gpgme_assuan_data_cb_t data_cb, + void *data_cb_value, + gpgme_assuan_inquire_cb_t inq_cb, + void *inq_cb_value, + gpgme_assuan_status_cb_t stat_cb, + void *stat_cb_value); + + /* Interface to gpgconf(1). */ @@ -1692,8 +1793,8 @@ typedef enum GPGME_CONF_ALIAS_LIST = 37 } gpgme_conf_type_t; -/* Macro for backward compatibility (even though it was undocumented - and marked as experimental in 1.1.6 - will be removed after 1.1.7): */ + +/* For now, compatibility. */ #define GPGME_CONF_PATHNAME GPGME_CONF_FILENAME @@ -1824,9 +1925,21 @@ gpgme_error_t gpgme_op_conf_save (gpgme_ /* Various functions. */ -/* Check that the library fulfills the version requirement. */ +/* Check that the library fulfills the version requirement. Note: + This is here only for the case where a user takes a pointer from + the old version of this function. The new version and macro for + run-time checks are below. */ const char *gpgme_check_version (const char *req_version); +/* Check that the library fulfills the version requirement and check + for struct layout mismatch involving bitfields. */ +const char *gpgme_check_version_internal (const char *req_version, + size_t offset_sig_validity); + +#define gpgme_check_version(req_version) \ + gpgme_check_version_internal (req_version, \ + offsetof (struct _gpgme_signature, validity)) + /* Get the information about the configured and installed engines. A pointer to the first engine in the statically allocated linked list is returned in *INFO. If an error occurs, it is returned. The @@ -1847,6 +1960,10 @@ gpgme_error_t gpgme_set_engine_info (gpg gpgme_error_t gpgme_engine_check_version (gpgme_protocol_t proto); +void gpgme_result_ref (void *result); +void gpgme_result_unref (void *result); + + /* Deprecated types. */ typedef gpgme_ctx_t GpgmeCtx _GPGME_DEPRECATED; typedef gpgme_data_t GpgmeData _GPGME_DEPRECATED; diff -urpNP gpgme-1.1.8/src/import.c gpgme-1.2.0/src/import.c --- gpgme-1.1.8/src/import.c 2008-11-03 16:50:12.000000000 +0000 +++ gpgme-1.2.0/src/import.c 2009-06-17 12:36:07.000000000 +0000 @@ -238,7 +238,7 @@ _gpgme_op_import_start (gpgme_ctx_t ctx, _gpgme_engine_set_status_handler (ctx->engine, import_status_handler, ctx); - return _gpgme_engine_op_import (ctx->engine, keydata); + return _gpgme_engine_op_import (ctx->engine, keydata, NULL); } @@ -260,6 +260,84 @@ gpgme_op_import (gpgme_ctx_t ctx, gpgme_ } + +static gpgme_error_t +_gpgme_op_import_keys_start (gpgme_ctx_t ctx, int synchronous, + gpgme_key_t *keys) +{ + gpgme_error_t err; + void *hook; + op_data_t opd; + int idx, firstidx, nkeys; + + err = _gpgme_op_reset (ctx, synchronous); + if (err) + return err; + + err = _gpgme_op_data_lookup (ctx, OPDATA_IMPORT, &hook, + sizeof (*opd), release_op_data); + opd = hook; + if (err) + return err; + opd->lastp = &opd->result.imports; + + if (!keys) + return gpg_error (GPG_ERR_NO_DATA); + + for (idx=nkeys=0, firstidx=-1; keys[idx]; idx++) + { + /* We only consider keys of the current protocol. */ + if (keys[idx]->protocol != ctx->protocol) + continue; + if (firstidx == -1) + firstidx = idx; + /* If a key has been found using a different key listing mode, + we bail out. This makes the processing easier. Fixme: To + allow a mix of keys we would need to sort them by key listing + mode and start two import operations one after the other. */ + if (keys[idx]->keylist_mode != keys[firstidx]->keylist_mode) + return gpg_error (GPG_ERR_CONFLICT); + nkeys++; + } + if (!nkeys) + return gpg_error (GPG_ERR_NO_DATA); + + _gpgme_engine_set_status_handler (ctx->engine, import_status_handler, ctx); + + return _gpgme_engine_op_import (ctx->engine, NULL, keys); +} + + +/* Asynchronous version of gpgme_op_import_key. */ +gpgme_error_t +gpgme_op_import_keys_start (gpgme_ctx_t ctx, gpgme_key_t *keys) +{ + return _gpgme_op_import_keys_start (ctx, 0, keys); +} + + +/* Import the keys from the array KEYS into the keyring. This + function allows to move a key from one engine to another as long as + they are compatible. In particular it is used to actually import + keys retrieved from an external source (i.e. using + GPGME_KEYLIST_MODE_EXTERN). It replaces the old workaround of + exporting and then importing a key as used to make an X.509 key + permanent. This function automagically does the right thing. + + KEYS is a NULL terminated array of gpgme key objects. The result + is the usual import result structure. Only keys matching the + current protocol are imported; other keys are ignored. */ +gpgme_error_t +gpgme_op_import_keys (gpgme_ctx_t ctx, gpgme_key_t *keys) +{ + gpgme_error_t err = _gpgme_op_import_keys_start (ctx, 1, keys); + if (!err) + err = _gpgme_wait_one (ctx); + return err; +} + + +/* Deprecated interface. */ gpgme_error_t gpgme_op_import_ext (gpgme_ctx_t ctx, gpgme_data_t keydata, int *nr) { diff -urpNP gpgme-1.1.8/src/key.c gpgme-1.2.0/src/key.c --- gpgme-1.1.8/src/key.c 2008-11-03 16:50:12.000000000 +0000 +++ gpgme-1.2.0/src/key.c 2009-02-17 18:03:57.000000000 +0000 @@ -327,6 +327,8 @@ gpgme_key_unref (gpgme_key_t key) gpgme_subkey_t next = subkey->next; if (subkey->fpr) free (subkey->fpr); + if (subkey->card_number) + free (subkey->card_number); free (subkey); subkey = next; } diff -urpNP gpgme-1.1.8/src/keylist.c gpgme-1.2.0/src/keylist.c --- gpgme-1.1.8/src/keylist.c 2008-11-03 16:50:12.000000000 +0000 +++ gpgme-1.2.0/src/keylist.c 2009-02-17 18:03:57.000000000 +0000 @@ -1,7 +1,7 @@ /* keylist.c - Listing keys. Copyright (C) 2000 Werner Koch (dd9jn) Copyright (C) 2001, 2002, 2003, 2004, 2006, 2007, - 2008 g10 Code GmbH + 2008, 2009 g10 Code GmbH This file is part of GPGME. @@ -351,6 +351,38 @@ set_ownertrust (gpgme_key_t key, const c } +/* Parse field 15 of a secret key or subkey. This fields holds a + reference to smartcards. FIELD is the content of the field and we + are allowed to modify it. */ +static gpg_error_t +parse_sec_field15 (gpgme_subkey_t subkey, char *field) +{ + if (!*field) + ; /* Empty. */ + else if (*field == '#') + { + /* This is a stub for an offline key. We reset the SECRET flag + of the subkey here. Note that the secret flag of the entire + key will be true even then. */ + subkey->secret = 0; + } + else if (strchr ("01234567890ABCDEFabcdef", *field)) + { + /* Fields starts with a hex digit; thus it is a serial number. */ + subkey->is_cardkey = 1; + subkey->card_number = strdup (field); + if (!subkey->card_number) + return gpg_error_from_syserror (); + } + else + { + /* RFU. */ + } + + return 0; +} + + /* We have read an entire key into tmp_key and should now finish it. It is assumed that this releases tmp_key. */ static void @@ -533,12 +565,13 @@ keylist_colon_handler (void *priv, char if (fields >= 12) set_mainkey_capability (key, field[11]); - /* Field 15 carries special flags of a secret key. We reset the - SECRET flag of a subkey here if the key is actually only a - stub. The SECRET flag of the key will be true even then. */ + /* Field 15 carries special flags of a secret key. */ if (fields >= 15 && key->secret) - if (*field[14] == '#') - subkey->secret = 0; + { + err = parse_sec_field15 (subkey, field[14]); + if (err) + return err; + } break; case RT_SUB: @@ -596,8 +629,11 @@ keylist_colon_handler (void *priv, char /* Field 15 carries special flags of a secret key. */ if (fields >= 15 && key->secret) - if (*field[14] == '#') - subkey->secret = 0; + { + err = parse_sec_field15 (subkey, field[14]); + if (err) + return err; + } break; case RT_UID: diff -urpNP gpgme-1.1.8/src/libgpgme.vers gpgme-1.2.0/src/libgpgme.vers --- gpgme-1.1.8/src/libgpgme.vers 2008-11-03 16:50:12.000000000 +0000 +++ gpgme-1.2.0/src/libgpgme.vers 2009-06-17 12:36:07.000000000 +0000 @@ -1,5 +1,5 @@ # libgpgme.vers - List of symbols to export. -# Copyright (C) 2002, 2004, 2005 g10 Code GmbH +# Copyright (C) 2002, 2004, 2005, 2009 g10 Code GmbH # # This file is part of GPGME. # @@ -14,8 +14,7 @@ # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public -# License along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA +# License along with this program; if not, see . #------------------------------------------------------- # Please remember to add new functions also to gpgme.def @@ -48,6 +47,23 @@ GPGME_1.1 { gpgme_op_conf_save; gpgme_cancel_async; + + gpgme_op_assuan_result; + gpgme_op_assuan_transact; + gpgme_op_assuan_transact_start; + + gpgme_check_version_internal; + + gpgme_io_read; + gpgme_io_write; + + gpgme_result_ref; + gpgme_result_unref; + + gpgme_op_import_keys; + gpgme_op_import_keys_start; + gpgme_op_export_keys; + gpgme_op_export_keys_start; }; diff -urpNP gpgme-1.1.8/src/op-support.c gpgme-1.2.0/src/op-support.c --- gpgme-1.1.8/src/op-support.c 2008-11-03 16:50:12.000000000 +0000 +++ gpgme-1.2.0/src/op-support.c 2009-06-18 16:09:23.000000000 +0000 @@ -48,10 +48,12 @@ _gpgme_op_data_lookup (gpgme_ctx_t ctx, data = calloc (1, sizeof (struct ctx_op_data) + size); if (!data) return gpg_error_from_errno (errno); + data->magic = CTX_OP_DATA_MAGIC; data->next = ctx->op_data; data->type = type; data->cleanup = cleanup; data->hook = (void *) (((char *) data) + sizeof (struct ctx_op_data)); + data->references = 1; ctx->op_data = data; } *hook = data->hook; diff -urpNP gpgme-1.1.8/src/opassuan.c gpgme-1.2.0/src/opassuan.c --- gpgme-1.1.8/src/opassuan.c 1970-01-01 00:00:00.000000000 +0000 +++ gpgme-1.2.0/src/opassuan.c 2009-02-27 14:26:27.000000000 +0000 @@ -0,0 +1,158 @@ +/* opassuan.c - Low-level Assuan operations. + Copyright (C) 2009 g10 Code GmbH + + This file is part of GPGME. + + GPGME is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2.1 of + the License, or (at your option) any later version. + + GPGME is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this program; if not, see . + */ + +#if HAVE_CONFIG_H +#include +#endif + +#include "gpgme.h" +#include "context.h" +#include "ops.h" +#include "util.h" + + +typedef struct +{ + struct _gpgme_op_assuan_result result; + +} *op_data_t; + + + + +/* This callback is used to return the status of the assuan command + back. Note that this is different from the error code returned + from gpgme_op_assuan_transact because the later only reflects error + with the connection. */ +static gpgme_error_t +result_cb (void *priv, gpgme_error_t result) +{ + gpgme_ctx_t ctx = (gpgme_ctx_t)priv; + gpgme_error_t err; + void *hook; + op_data_t opd; + + err = _gpgme_op_data_lookup (ctx, OPDATA_ASSUAN, &hook, -1, NULL); + opd = hook; + if (err) + return err; + if (!opd) + return gpg_error (GPG_ERR_INTERNAL); + + opd->result.err = result; + return 0; +} + + +gpgme_assuan_result_t +gpgme_op_assuan_result (gpgme_ctx_t ctx) +{ + gpgme_error_t err; + void *hook; + op_data_t opd; + + err = _gpgme_op_data_lookup (ctx, OPDATA_ASSUAN, &hook, -1, NULL); + opd = hook; + /* Check in case this function is used without having run a command + before. */ + if (err || !opd) + return NULL; + + return &opd->result; +} + + +static gpgme_error_t +opassuan_start (gpgme_ctx_t ctx, int synchronous, + const char *command, + gpgme_assuan_data_cb_t data_cb, + void *data_cb_value, + gpgme_assuan_inquire_cb_t inq_cb, + void *inq_cb_value, + gpgme_assuan_status_cb_t status_cb, + void *status_cb_value) +{ + gpgme_error_t err; + void *hook; + op_data_t opd; + + if (!command || !*command) + return gpg_error (GPG_ERR_INV_VALUE); + + /* The flag value 256 is used to suppress an engine reset. This is + required to keep the connection running. */ + err = _gpgme_op_reset (ctx, ((synchronous&255) | 256)); + if (err) + return err; + + err = _gpgme_op_data_lookup (ctx, OPDATA_ASSUAN, &hook, sizeof (*opd), NULL); + opd = hook; + if (err) + return err; + opd->result.err = gpg_error (GPG_ERR_UNFINISHED); + + return _gpgme_engine_op_assuan_transact (ctx->engine, command, + result_cb, ctx, + data_cb, data_cb_value, + inq_cb, inq_cb_value, + status_cb, status_cb_value); +} + + + +/* XXXX. This is the asynchronous variant. */ +gpgme_error_t +gpgme_op_assuan_transact_start (gpgme_ctx_t ctx, + const char *command, + gpgme_assuan_data_cb_t data_cb, + void *data_cb_value, + gpgme_assuan_inquire_cb_t inq_cb, + void *inq_cb_value, + gpgme_assuan_status_cb_t status_cb, + void *status_cb_value) +{ + return opassuan_start (ctx, 0, command, + data_cb, data_cb_value, + inq_cb, inq_cb_value, + status_cb, status_cb_value); +} + + +/* XXXX. This is the synchronous variant. */ +gpgme_error_t +gpgme_op_assuan_transact (gpgme_ctx_t ctx, + const char *command, + gpgme_assuan_data_cb_t data_cb, + void *data_cb_value, + gpgme_assuan_inquire_cb_t inq_cb, + void *inq_cb_value, + gpgme_assuan_status_cb_t status_cb, + void *status_cb_value) +{ + gpgme_error_t err; + + err = opassuan_start (ctx, 1, command, + data_cb, data_cb_value, + inq_cb, inq_cb_value, + status_cb, status_cb_value); + if (!err) + err = _gpgme_wait_one (ctx); + return err; +} + diff -urpNP gpgme-1.1.8/src/posix-io.c gpgme-1.2.0/src/posix-io.c --- gpgme-1.1.8/src/posix-io.c 2008-11-03 16:50:12.000000000 +0000 +++ gpgme-1.2.0/src/posix-io.c 2009-06-15 11:59:37.000000000 +0000 @@ -304,13 +304,16 @@ _gpgme_io_waitpid (int pid, int hang, in /* Returns 0 on success, -1 on error. */ int -_gpgme_io_spawn (const char *path, char *const argv[], +_gpgme_io_spawn (const char *path, char *const argv[], unsigned int flags, struct spawn_fd_item_s *fd_list, pid_t *r_pid) { pid_t pid; int i; int status; int signo; + + (void)flags; + TRACE_BEG1 (DEBUG_SYSIO, "_gpgme_io_spawn", path, "path=%s", path); i = 0; @@ -653,3 +656,31 @@ _gpgme_io_dup (int fd) return new_fd; } + + +int +_gpgme_io_socket (int domain, int type, int proto) +{ + int res; + + TRACE_BEG2 (DEBUG_SYSIO, "_gpgme_io_socket", domain, + "type=%i, proto=%i", type, proto); + + res = socket (domain, type, proto); + + return TRACE_SYSRES (res); +} + + +int +_gpgme_io_connect (int fd, struct sockaddr *addr, int addrlen) +{ + int res; + + TRACE_BEG2 (DEBUG_SYSIO, "_gpgme_io_connect", fd, + "addr=%p, addrlen=%i", addr, addrlen); + + res = ath_connect (fd, addr, addrlen); + + return TRACE_SYSRES (res); +} diff -urpNP gpgme-1.1.8/src/posix-util.c gpgme-1.2.0/src/posix-util.c --- gpgme-1.1.8/src/posix-util.c 2008-11-03 16:50:12.000000000 +0000 +++ gpgme-1.2.0/src/posix-util.c 2009-06-15 11:59:37.000000000 +0000 @@ -67,7 +67,7 @@ _gpgme_get_conf_int (const char *key, in } void -_gpgme_allow_set_foregound_window (pid_t pid) +_gpgme_allow_set_foreground_window (pid_t pid) { (void)pid; /* Not needed. */ diff -urpNP gpgme-1.1.8/src/priv-io.h gpgme-1.2.0/src/priv-io.h --- gpgme-1.1.8/src/priv-io.h 2008-11-03 16:50:12.000000000 +0000 +++ gpgme-1.2.0/src/priv-io.h 2009-06-15 11:59:37.000000000 +0000 @@ -59,11 +59,15 @@ int _gpgme_io_set_close_notify (int fd, void *value); int _gpgme_io_set_nonblocking (int fd); +/* A flag to tell the spawn function to allow the child process to set + the foreground window. */ +#define IOSPAWN_FLAG_ALLOW_SET_FG 1 + /* Spawn the executable PATH with ARGV as arguments. After forking close all fds except for those in FD_LIST in the child, then optionally dup() the child fds. Finally, all fds in the list are closed in the parent. */ -int _gpgme_io_spawn (const char *path, char *const argv[], +int _gpgme_io_spawn (const char *path, char *const argv[], unsigned int flags, struct spawn_fd_item_s *fd_list, pid_t *r_pid); int _gpgme_io_select (struct io_select_fd_s *fds, size_t nfds, int nonblock); diff -urpNP gpgme-1.1.8/src/rungpg.c gpgme-1.2.0/src/rungpg.c --- gpgme-1.1.8/src/rungpg.c 2008-11-03 16:50:12.000000000 +0000 +++ gpgme-1.2.0/src/rungpg.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,2192 +0,0 @@ -/* rungpg.c - Gpg Engine. - Copyright (C) 2000 Werner Koch (dd9jn) - Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 g10 Code GmbH - - This file is part of GPGME. - - GPGME is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 2.1 of - the License, or (at your option) any later version. - - GPGME is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ - -#if HAVE_CONFIG_H -#include -#endif -#include -#include -#include -#include -#include -#include -#include - -#include "gpgme.h" -#include "util.h" -#include "ops.h" -#include "wait.h" -#include "context.h" /*temp hack until we have GpmeData methods to do I/O */ -#include "priv-io.h" -#include "sema.h" -#include "debug.h" - -#include "status-table.h" -#include "engine-backend.h" - - -/* This type is used to build a list of gpg arguments and data - sources/sinks. */ -struct arg_and_data_s -{ - struct arg_and_data_s *next; - gpgme_data_t data; /* If this is not NULL, use arg below. */ - int inbound; /* True if this is used for reading from gpg. */ - int dup_to; - int print_fd; /* Print the fd number and not the special form of it. */ - int *arg_locp; /* Write back the argv idx of this argument when - building command line to this location. */ - char arg[1]; /* Used if data above is not used. */ -}; - - -struct fd_data_map_s -{ - gpgme_data_t data; - int inbound; /* true if this is used for reading from gpg */ - int dup_to; - int fd; /* the fd to use */ - int peer_fd; /* the other side of the pipe */ - int arg_loc; /* The index into the argv for translation purposes. */ - void *tag; -}; - - -typedef gpgme_error_t (*colon_preprocessor_t) (char *line, char **rline); - -struct engine_gpg -{ - char *file_name; - - char *lc_messages; - char *lc_ctype; - - struct arg_and_data_s *arglist; - struct arg_and_data_s **argtail; - - struct - { - int fd[2]; - int arg_loc; - size_t bufsize; - char *buffer; - size_t readpos; - int eof; - engine_status_handler_t fnc; - void *fnc_value; - void *tag; - } status; - - /* This is a kludge - see the comment at colon_line_handler. */ - struct - { - int fd[2]; - int arg_loc; - size_t bufsize; - char *buffer; - size_t readpos; - int eof; - engine_colon_line_handler_t fnc; /* this indicate use of this structrue */ - void *fnc_value; - void *tag; - colon_preprocessor_t preprocess_fnc; - } colon; - - char **argv; - struct fd_data_map_s *fd_data_map; - - /* stuff needed for interactive (command) mode */ - struct - { - int used; - int fd; - void *cb_data; - int idx; /* Index in fd_data_map */ - gpgme_status_code_t code; /* last code */ - char *keyword; /* what has been requested (malloced) */ - engine_command_handler_t fnc; - void *fnc_value; - /* The kludges never end. This is used to couple command handlers - with output data in edit key mode. */ - gpgme_data_t linked_data; - int linked_idx; - } cmd; - - struct gpgme_io_cbs io_cbs; -}; - -typedef struct engine_gpg *engine_gpg_t; - - -static void -gpg_io_event (void *engine, gpgme_event_io_t type, void *type_data) -{ - engine_gpg_t gpg = engine; - - TRACE3 (DEBUG_ENGINE, "gpgme:gpg_io_event", gpg, - "event %p, type %d, type_data %p", - gpg->io_cbs.event, type, type_data); - if (gpg->io_cbs.event) - (*gpg->io_cbs.event) (gpg->io_cbs.event_priv, type, type_data); -} - - -static void -close_notify_handler (int fd, void *opaque) -{ - engine_gpg_t gpg = opaque; - assert (fd != -1); - - if (gpg->status.fd[0] == fd) - { - if (gpg->status.tag) - (*gpg->io_cbs.remove) (gpg->status.tag); - gpg->status.fd[0] = -1; - } - else if (gpg->status.fd[1] == fd) - gpg->status.fd[1] = -1; - else if (gpg->colon.fd[0] == fd) - { - if (gpg->colon.tag) - (*gpg->io_cbs.remove) (gpg->colon.tag); - gpg->colon.fd[0] = -1; - } - else if (gpg->colon.fd[1] == fd) - gpg->colon.fd[1] = -1; - else if (gpg->fd_data_map) - { - int i; - - for (i = 0; gpg->fd_data_map[i].data; i++) - { - if (gpg->fd_data_map[i].fd == fd) - { - if (gpg->fd_data_map[i].tag) - (*gpg->io_cbs.remove) (gpg->fd_data_map[i].tag); - gpg->fd_data_map[i].fd = -1; - break; - } - if (gpg->fd_data_map[i].peer_fd == fd) - { - gpg->fd_data_map[i].peer_fd = -1; - break; - } - } - } -} - -/* If FRONT is true, push at the front of the list. Use this for - options added late in the process. */ -static gpgme_error_t -_add_arg (engine_gpg_t gpg, const char *arg, int front, int *arg_locp) -{ - struct arg_and_data_s *a; - - assert (gpg); - assert (arg); - - a = malloc (sizeof *a + strlen (arg)); - if (!a) - return gpg_error_from_errno (errno); - - a->data = NULL; - a->dup_to = -1; - a->arg_locp = arg_locp; - - strcpy (a->arg, arg); - if (front) - { - a->next = gpg->arglist; - if (!gpg->arglist) - { - /* If this is the first argument, we need to update the tail - pointer. */ - gpg->argtail = &a->next; - } - gpg->arglist = a; - } - else - { - a->next = NULL; - *gpg->argtail = a; - gpg->argtail = &a->next; - } - - return 0; -} - -static gpgme_error_t -add_arg_ext (engine_gpg_t gpg, const char *arg, int front) -{ - return _add_arg (gpg, arg, front, NULL); -} - - -static gpgme_error_t -add_arg_with_locp (engine_gpg_t gpg, const char *arg, int *locp) -{ - return _add_arg (gpg, arg, 0, locp); -} - - -static gpgme_error_t -add_arg (engine_gpg_t gpg, const char *arg) -{ - return add_arg_ext (gpg, arg, 0); -} - - -static gpgme_error_t -add_data (engine_gpg_t gpg, gpgme_data_t data, int dup_to, int inbound) -{ - struct arg_and_data_s *a; - - assert (gpg); - assert (data); - - a = malloc (sizeof *a - 1); - if (!a) - return gpg_error_from_errno (errno); - a->next = NULL; - a->data = data; - a->inbound = inbound; - a->arg_locp = NULL; - - if (dup_to == -2) - { - a->print_fd = 1; - a->dup_to = -1; - } - else - { - a->print_fd = 0; - a->dup_to = dup_to; - } - *gpg->argtail = a; - gpg->argtail = &a->next; - return 0; -} - - -static char * -gpg_get_version (const char *file_name) -{ - return _gpgme_get_program_version (file_name ? file_name - : _gpgme_get_gpg_path ()); -} - - -static const char * -gpg_get_req_version (void) -{ - return NEED_GPG_VERSION; -} - - -static void -free_argv (char **argv) -{ - int i; - - for (i = 0; argv[i]; i++) - free (argv[i]); - free (argv); -} - - -static void -free_fd_data_map (struct fd_data_map_s *fd_data_map) -{ - int i; - - if (!fd_data_map) - return; - - for (i = 0; fd_data_map[i].data; i++) - { - if (fd_data_map[i].fd != -1) - _gpgme_io_close (fd_data_map[i].fd); - if (fd_data_map[i].peer_fd != -1) - _gpgme_io_close (fd_data_map[i].peer_fd); - /* Don't release data because this is only a reference. */ - } - free (fd_data_map); -} - - -static gpgme_error_t -gpg_cancel (void *engine) -{ - engine_gpg_t gpg = engine; - - if (!gpg) - return gpg_error (GPG_ERR_INV_VALUE); - - /* If gpg may be waiting for a cmd, close the cmd fd first. On - Windows, close operations block on the reader/writer thread. */ - if (gpg->cmd.used) - { - if (gpg->cmd.fd != -1) - _gpgme_io_close (gpg->cmd.fd); - else if (gpg->fd_data_map - && gpg->fd_data_map[gpg->cmd.idx].fd != -1) - _gpgme_io_close (gpg->fd_data_map[gpg->cmd.idx].fd); - } - - if (gpg->status.fd[0] != -1) - _gpgme_io_close (gpg->status.fd[0]); - if (gpg->status.fd[1] != -1) - _gpgme_io_close (gpg->status.fd[1]); - if (gpg->colon.fd[0] != -1) - _gpgme_io_close (gpg->colon.fd[0]); - if (gpg->colon.fd[1] != -1) - _gpgme_io_close (gpg->colon.fd[1]); - if (gpg->fd_data_map) - { - free_fd_data_map (gpg->fd_data_map); - gpg->fd_data_map = NULL; - } - - return 0; -} - -static void -gpg_release (void *engine) -{ - engine_gpg_t gpg = engine; - - if (!gpg) - return; - - gpg_cancel (engine); - - if (gpg->file_name) - free (gpg->file_name); - - if (gpg->lc_messages) - free (gpg->lc_messages); - if (gpg->lc_ctype) - free (gpg->lc_ctype); - - while (gpg->arglist) - { - struct arg_and_data_s *next = gpg->arglist->next; - - if (gpg->arglist) - free (gpg->arglist); - gpg->arglist = next; - } - - if (gpg->status.buffer) - free (gpg->status.buffer); - if (gpg->colon.buffer) - free (gpg->colon.buffer); - if (gpg->argv) - free_argv (gpg->argv); - if (gpg->cmd.keyword) - free (gpg->cmd.keyword); - - free (gpg); -} - - -static gpgme_error_t -gpg_new (void **engine, const char *file_name, const char *home_dir) -{ - engine_gpg_t gpg; - gpgme_error_t rc = 0; - char *dft_display = NULL; - char dft_ttyname[64]; - char *dft_ttytype = NULL; - - gpg = calloc (1, sizeof *gpg); - if (!gpg) - return gpg_error_from_errno (errno); - - if (file_name) - { - gpg->file_name = strdup (file_name); - if (!gpg->file_name) - { - rc = gpg_error_from_errno (errno); - goto leave; - } - } - - gpg->argtail = &gpg->arglist; - gpg->status.fd[0] = -1; - gpg->status.fd[1] = -1; - gpg->colon.fd[0] = -1; - gpg->colon.fd[1] = -1; - gpg->cmd.fd = -1; - gpg->cmd.idx = -1; - gpg->cmd.linked_data = NULL; - gpg->cmd.linked_idx = -1; - - /* Allocate the read buffer for the status pipe. */ - gpg->status.bufsize = 1024; - gpg->status.readpos = 0; - gpg->status.buffer = malloc (gpg->status.bufsize); - if (!gpg->status.buffer) - { - rc = gpg_error_from_errno (errno); - goto leave; - } - /* In any case we need a status pipe - create it right here and - don't handle it with our generic gpgme_data_t mechanism. */ - if (_gpgme_io_pipe (gpg->status.fd, 1) == -1) - { - rc = gpg_error_from_errno (errno); - goto leave; - } - if (_gpgme_io_set_close_notify (gpg->status.fd[0], - close_notify_handler, gpg) - || _gpgme_io_set_close_notify (gpg->status.fd[1], - close_notify_handler, gpg)) - { - rc = gpg_error (GPG_ERR_GENERAL); - goto leave; - } - gpg->status.eof = 0; - - if (home_dir) - { - rc = add_arg (gpg, "--homedir"); - if (!rc) - rc = add_arg (gpg, home_dir); - if (rc) - goto leave; - } - - rc = add_arg (gpg, "--status-fd"); - if (rc) - goto leave; - - { - char buf[25]; - _gpgme_io_fd2str (buf, sizeof (buf), gpg->status.fd[1]); - rc = add_arg_with_locp (gpg, buf, &gpg->status.arg_loc); - if (rc) - goto leave; - } - - rc = add_arg (gpg, "--no-tty"); - if (!rc) - rc = add_arg (gpg, "--charset"); - if (!rc) - rc = add_arg (gpg, "utf8"); - if (!rc) - rc = add_arg (gpg, "--enable-progress-filter"); - if (rc) - goto leave; - - rc = _gpgme_getenv ("DISPLAY", &dft_display); - if (rc) - goto leave; - if (dft_display) - { - rc = add_arg (gpg, "--display"); - if (!rc) - rc = add_arg (gpg, dft_display); - - free (dft_display); - } - - if (isatty (1)) - { - int err; - - err = ttyname_r (1, dft_ttyname, sizeof (dft_ttyname)); - if (err) - rc = gpg_error_from_errno (err); - else - { - if (*dft_ttyname) - { - rc = add_arg (gpg, "--ttyname"); - if (!rc) - rc = add_arg (gpg, dft_ttyname); - } - else - rc = 0; - if (!rc) - { - rc = _gpgme_getenv ("TERM", &dft_ttytype); - if (rc) - goto leave; - - if (dft_ttytype) - { - rc = add_arg (gpg, "--ttytype"); - if (!rc) - rc = add_arg (gpg, dft_ttytype); - } - - free (dft_ttytype); - } - } - if (rc) - goto leave; - } - - leave: - if (rc) - gpg_release (gpg); - else - *engine = gpg; - return rc; -} - - -static gpgme_error_t -gpg_set_locale (void *engine, int category, const char *value) -{ - engine_gpg_t gpg = engine; - - if (category == LC_CTYPE) - { - if (gpg->lc_ctype) - { - free (gpg->lc_ctype); - gpg->lc_ctype = NULL; - } - if (value) - { - gpg->lc_ctype = strdup (value); - if (!gpg->lc_ctype) - return gpg_error_from_syserror (); - } - } -#ifdef LC_MESSAGES - else if (category == LC_MESSAGES) - { - if (gpg->lc_messages) - { - free (gpg->lc_messages); - gpg->lc_messages = NULL; - } - if (value) - { - gpg->lc_messages = strdup (value); - if (!gpg->lc_messages) - return gpg_error_from_syserror (); - } - } -#endif /* LC_MESSAGES */ - else - return gpg_error (GPG_ERR_INV_VALUE); - - return 0; -} - - -/* Note, that the status_handler is allowed to modifiy the args - value. */ -static void -gpg_set_status_handler (void *engine, engine_status_handler_t fnc, - void *fnc_value) -{ - engine_gpg_t gpg = engine; - - gpg->status.fnc = fnc; - gpg->status.fnc_value = fnc_value; -} - -/* Kludge to process --with-colon output. */ -static gpgme_error_t -gpg_set_colon_line_handler (void *engine, engine_colon_line_handler_t fnc, - void *fnc_value) -{ - engine_gpg_t gpg = engine; - - gpg->colon.bufsize = 1024; - gpg->colon.readpos = 0; - gpg->colon.buffer = malloc (gpg->colon.bufsize); - if (!gpg->colon.buffer) - return gpg_error_from_errno (errno); - - if (_gpgme_io_pipe (gpg->colon.fd, 1) == -1) - { - int saved_errno = errno; - free (gpg->colon.buffer); - gpg->colon.buffer = NULL; - return gpg_error_from_errno (saved_errno); - } - if (_gpgme_io_set_close_notify (gpg->colon.fd[0], close_notify_handler, gpg) - || _gpgme_io_set_close_notify (gpg->colon.fd[1], - close_notify_handler, gpg)) - return gpg_error (GPG_ERR_GENERAL); - gpg->colon.eof = 0; - gpg->colon.fnc = fnc; - gpg->colon.fnc_value = fnc_value; - return 0; -} - - -static gpgme_error_t -command_handler (void *opaque, int fd) -{ - gpgme_error_t err; - engine_gpg_t gpg = (engine_gpg_t) opaque; - int processed = 0; - - assert (gpg->cmd.used); - assert (gpg->cmd.code); - assert (gpg->cmd.fnc); - - err = gpg->cmd.fnc (gpg->cmd.fnc_value, gpg->cmd.code, gpg->cmd.keyword, fd, - &processed); - - gpg->cmd.code = 0; - /* And sleep again until read_status will wake us up again. */ - /* XXX We must check if there are any more fds active after removing - this one. */ - (*gpg->io_cbs.remove) (gpg->fd_data_map[gpg->cmd.idx].tag); - gpg->cmd.fd = gpg->fd_data_map[gpg->cmd.idx].fd; - gpg->fd_data_map[gpg->cmd.idx].fd = -1; - - if (err) - return err; - - /* We always need to send at least a newline character. */ - if (!processed) - _gpgme_io_write (fd, "\n", 1); - - return 0; -} - - - -/* The Fnc will be called to get a value for one of the commands with - a key KEY. If the Code pssed to FNC is 0, the function may release - resources associated with the returned value from another call. To - match such a second call to a first call, the returned value from - the first call is passed as keyword. */ -static gpgme_error_t -gpg_set_command_handler (void *engine, engine_command_handler_t fnc, - void *fnc_value, gpgme_data_t linked_data) -{ - engine_gpg_t gpg = engine; - gpgme_error_t rc; - - rc = add_arg (gpg, "--command-fd"); - if (rc) - return rc; - - /* This is a hack. We don't have a real data object. The only - thing that matters is that we use something unique, so we use the - address of the cmd structure in the gpg object. */ - rc = add_data (gpg, (void *) &gpg->cmd, -2, 0); - if (rc) - return rc; - - gpg->cmd.fnc = fnc; - gpg->cmd.cb_data = (void *) &gpg->cmd; - gpg->cmd.fnc_value = fnc_value; - gpg->cmd.linked_data = linked_data; - gpg->cmd.used = 1; - return 0; -} - - -static gpgme_error_t -build_argv (engine_gpg_t gpg) -{ - gpgme_error_t err; - struct arg_and_data_s *a; - struct fd_data_map_s *fd_data_map; - size_t datac=0, argc=0; - char **argv; - int need_special = 0; - int use_agent = 0; - char *p; - - /* We don't want to use the agent with a malformed environment - variable. This is only a very basic test but sufficient to make - our life in the regression tests easier. */ - err = _gpgme_getenv ("GPG_AGENT_INFO", &p); - if (err) - return err; - use_agent = (p && strchr (p, ':')); - if (p) - free (p); - - if (gpg->argv) - { - free_argv (gpg->argv); - gpg->argv = NULL; - } - if (gpg->fd_data_map) - { - free_fd_data_map (gpg->fd_data_map); - gpg->fd_data_map = NULL; - } - - argc++; /* For argv[0]. */ - for (a = gpg->arglist; a; a = a->next) - { - argc++; - if (a->data) - { - /*fprintf (stderr, "build_argv: data\n" );*/ - datac++; - if (a->dup_to == -1 && !a->print_fd) - need_special = 1; - } - else - { - /* fprintf (stderr, "build_argv: arg=`%s'\n", a->arg );*/ - } - } - if (need_special) - argc++; - if (use_agent) - argc++; - if (!gpg->cmd.used) - argc++; /* --batch */ - argc += 1; /* --no-sk-comment */ - - argv = calloc (argc + 1, sizeof *argv); - if (!argv) - return gpg_error_from_errno (errno); - fd_data_map = calloc (datac + 1, sizeof *fd_data_map); - if (!fd_data_map) - { - int saved_errno = errno; - free_argv (argv); - return gpg_error_from_errno (saved_errno); - } - - argc = datac = 0; - argv[argc] = strdup ("gpg"); /* argv[0] */ - if (!argv[argc]) - { - int saved_errno = errno; - free (fd_data_map); - free_argv (argv); - return gpg_error_from_errno (saved_errno); - } - argc++; - if (need_special) - { - argv[argc] = strdup ("--enable-special-filenames"); - if (!argv[argc]) - { - int saved_errno = errno; - free (fd_data_map); - free_argv (argv); - return gpg_error_from_errno (saved_errno); - } - argc++; - } - if (use_agent) - { - argv[argc] = strdup ("--use-agent"); - if (!argv[argc]) - { - int saved_errno = errno; - free (fd_data_map); - free_argv (argv); - return gpg_error_from_errno (saved_errno); - } - argc++; - } - if (!gpg->cmd.used) - { - argv[argc] = strdup ("--batch"); - if (!argv[argc]) - { - int saved_errno = errno; - free (fd_data_map); - free_argv (argv); - return gpg_error_from_errno (saved_errno); - } - argc++; - } - argv[argc] = strdup ("--no-sk-comment"); - if (!argv[argc]) - { - int saved_errno = errno; - free (fd_data_map); - free_argv (argv); - return gpg_error_from_errno (saved_errno); - } - argc++; - for (a = gpg->arglist; a; a = a->next) - { - if (a->arg_locp) - *(a->arg_locp) = argc; - - if (a->data) - { - /* Create a pipe to pass it down to gpg. */ - fd_data_map[datac].inbound = a->inbound; - - /* Create a pipe. */ - { - int fds[2]; - - if (_gpgme_io_pipe (fds, fd_data_map[datac].inbound ? 1 : 0) - == -1) - { - int saved_errno = errno; - free (fd_data_map); - free_argv (argv); - return gpg_error (saved_errno); - } - if (_gpgme_io_set_close_notify (fds[0], - close_notify_handler, gpg) - || _gpgme_io_set_close_notify (fds[1], - close_notify_handler, - gpg)) - { - return gpg_error (GPG_ERR_GENERAL); - } - /* If the data_type is FD, we have to do a dup2 here. */ - if (fd_data_map[datac].inbound) - { - fd_data_map[datac].fd = fds[0]; - fd_data_map[datac].peer_fd = fds[1]; - } - else - { - fd_data_map[datac].fd = fds[1]; - fd_data_map[datac].peer_fd = fds[0]; - } - } - - /* Hack to get hands on the fd later. */ - if (gpg->cmd.used) - { - if (gpg->cmd.cb_data == a->data) - { - assert (gpg->cmd.idx == -1); - gpg->cmd.idx = datac; - } - else if (gpg->cmd.linked_data == a->data) - { - assert (gpg->cmd.linked_idx == -1); - gpg->cmd.linked_idx = datac; - } - } - - fd_data_map[datac].data = a->data; - fd_data_map[datac].dup_to = a->dup_to; - - if (a->dup_to == -1) - { - char *ptr; - int buflen = 25; - - argv[argc] = malloc (buflen); - if (!argv[argc]) - { - int saved_errno = errno; - free (fd_data_map); - free_argv (argv); - return gpg_error_from_errno (saved_errno); - } - - ptr = argv[argc]; - if (!a->print_fd) - { - *(ptr++) = '-'; - *(ptr++) = '&'; - buflen -= 2; - } - - _gpgme_io_fd2str (ptr, buflen, fd_data_map[datac].peer_fd); - fd_data_map[datac].arg_loc = argc; - argc++; - } - datac++; - } - else - { - argv[argc] = strdup (a->arg); - if (!argv[argc]) - { - int saved_errno = errno; - free (fd_data_map); - free_argv (argv); - return gpg_error_from_errno (saved_errno); - } - argc++; - } - } - - gpg->argv = argv; - gpg->fd_data_map = fd_data_map; - return 0; -} - - -static gpgme_error_t -add_io_cb (engine_gpg_t gpg, int fd, int dir, gpgme_io_cb_t handler, void *data, - void **tag) -{ - gpgme_error_t err; - - err = (*gpg->io_cbs.add) (gpg->io_cbs.add_priv, fd, dir, handler, data, tag); - if (err) - return err; - if (!dir) - /* FIXME Kludge around poll() problem. */ - err = _gpgme_io_set_nonblocking (fd); - return err; -} - - -static int -status_cmp (const void *ap, const void *bp) -{ - const struct status_table_s *a = ap; - const struct status_table_s *b = bp; - - return strcmp (a->name, b->name); -} - - -/* Handle the status output of GnuPG. This function does read entire - lines and passes them as C strings to the callback function (we can - use C Strings because the status output is always UTF-8 encoded). - Of course we have to buffer the lines to cope with long lines - e.g. with a large user ID. Note: We can optimize this to only cope - with status line code we know about and skip all other stuff - without buffering (i.e. without extending the buffer). */ -static gpgme_error_t -read_status (engine_gpg_t gpg) -{ - char *p; - int nread; - size_t bufsize = gpg->status.bufsize; - char *buffer = gpg->status.buffer; - size_t readpos = gpg->status.readpos; - - assert (buffer); - if (bufsize - readpos < 256) - { - /* Need more room for the read. */ - bufsize += 1024; - buffer = realloc (buffer, bufsize); - if (!buffer) - return gpg_error_from_errno (errno); - } - - nread = _gpgme_io_read (gpg->status.fd[0], - buffer + readpos, bufsize-readpos); - if (nread == -1) - return gpg_error_from_errno (errno); - - if (!nread) - { - gpg->status.eof = 1; - if (gpg->status.fnc) - { - gpgme_error_t err; - err = gpg->status.fnc (gpg->status.fnc_value, GPGME_STATUS_EOF, ""); - if (err) - return err; - } - return 0; - } - - while (nread > 0) - { - for (p = buffer + readpos; nread; nread--, p++) - { - if (*p == '\n') - { - /* (we require that the last line is terminated by a LF) */ - if (p > buffer && p[-1] == '\r') - p[-1] = 0; - *p = 0; - if (!strncmp (buffer, "[GNUPG:] ", 9) - && buffer[9] >= 'A' && buffer[9] <= 'Z') - { - struct status_table_s t, *r; - char *rest; - - rest = strchr (buffer + 9, ' '); - if (!rest) - rest = p; /* Set to an empty string. */ - else - *rest++ = 0; - - t.name = buffer+9; - /* (the status table has one extra element) */ - r = bsearch (&t, status_table, DIM(status_table) - 1, - sizeof t, status_cmp); - if (r) - { - if (gpg->cmd.used - && (r->code == GPGME_STATUS_GET_BOOL - || r->code == GPGME_STATUS_GET_LINE - || r->code == GPGME_STATUS_GET_HIDDEN)) - { - gpg->cmd.code = r->code; - if (gpg->cmd.keyword) - free (gpg->cmd.keyword); - gpg->cmd.keyword = strdup (rest); - if (!gpg->cmd.keyword) - return gpg_error_from_errno (errno); - /* This should be the last thing we have - received and the next thing will be that - the command handler does its action. */ - if (nread > 1) - TRACE0 (DEBUG_CTX, "gpgme:read_status", 0, - "error: unexpected data"); - - add_io_cb (gpg, gpg->cmd.fd, 0, - command_handler, gpg, - &gpg->fd_data_map[gpg->cmd.idx].tag); - gpg->fd_data_map[gpg->cmd.idx].fd = gpg->cmd.fd; - gpg->cmd.fd = -1; - } - else if (gpg->status.fnc) - { - gpgme_error_t err; - err = gpg->status.fnc (gpg->status.fnc_value, - r->code, rest); - if (err) - return err; - } - - if (r->code == GPGME_STATUS_END_STREAM) - { - if (gpg->cmd.used) - { - /* Before we can actually add the - command fd, we might have to flush - the linked output data pipe. */ - if (gpg->cmd.linked_idx != -1 - && gpg->fd_data_map[gpg->cmd.linked_idx].fd - != -1) - { - struct io_select_fd_s fds; - fds.fd = - gpg->fd_data_map[gpg->cmd.linked_idx].fd; - fds.for_read = 1; - fds.for_write = 0; - fds.opaque = NULL; - do - { - fds.signaled = 0; - _gpgme_io_select (&fds, 1, 1); - if (fds.signaled) - _gpgme_data_inbound_handler - (gpg->cmd.linked_data, fds.fd); - } - while (fds.signaled); - } - - /* XXX We must check if there are any - more fds active after removing this - one. */ - (*gpg->io_cbs.remove) - (gpg->fd_data_map[gpg->cmd.idx].tag); - gpg->cmd.fd = gpg->fd_data_map[gpg->cmd.idx].fd; - gpg->fd_data_map[gpg->cmd.idx].fd = -1; - } - } - } - } - /* To reuse the buffer for the next line we have to - shift the remaining data to the buffer start and - restart the loop Hmmm: We can optimize this function - by looking forward in the buffer to see whether a - second complete line is available and in this case - avoid the memmove for this line. */ - nread--; p++; - if (nread) - memmove (buffer, p, nread); - readpos = 0; - break; /* the for loop */ - } - else - readpos++; - } - } - - /* Update the gpg object. */ - gpg->status.bufsize = bufsize; - gpg->status.buffer = buffer; - gpg->status.readpos = readpos; - return 0; -} - - -static gpgme_error_t -status_handler (void *opaque, int fd) -{ - engine_gpg_t gpg = opaque; - int err; - - assert (fd == gpg->status.fd[0]); - err = read_status (gpg); - if (err) - return err; - if (gpg->status.eof) - _gpgme_io_close (fd); - return 0; -} - - -static gpgme_error_t -read_colon_line (engine_gpg_t gpg) -{ - char *p; - int nread; - size_t bufsize = gpg->colon.bufsize; - char *buffer = gpg->colon.buffer; - size_t readpos = gpg->colon.readpos; - - assert (buffer); - if (bufsize - readpos < 256) - { - /* Need more room for the read. */ - bufsize += 1024; - buffer = realloc (buffer, bufsize); - if (!buffer) - return gpg_error_from_errno (errno); - } - - nread = _gpgme_io_read (gpg->colon.fd[0], buffer+readpos, bufsize-readpos); - if (nread == -1) - return gpg_error_from_errno (errno); - - if (!nread) - { - gpg->colon.eof = 1; - assert (gpg->colon.fnc); - gpg->colon.fnc (gpg->colon.fnc_value, NULL); - return 0; - } - - while (nread > 0) - { - for (p = buffer + readpos; nread; nread--, p++) - { - if ( *p == '\n' ) - { - /* (we require that the last line is terminated by a LF) - and we skip empty lines. Note: we use UTF8 encoding - and escaping of special characters. We require at - least one colon to cope with some other printed - information. */ - *p = 0; - if (*buffer && strchr (buffer, ':')) - { - char *line = NULL; - - if (gpg->colon.preprocess_fnc) - { - gpgme_error_t err; - - err = gpg->colon.preprocess_fnc (buffer, &line); - if (err) - return err; - } - - assert (gpg->colon.fnc); - gpg->colon.fnc (gpg->colon.fnc_value, line ? line : buffer); - if (line) - free (line); - } - - /* To reuse the buffer for the next line we have to - shift the remaining data to the buffer start and - restart the loop Hmmm: We can optimize this function - by looking forward in the buffer to see whether a - second complete line is available and in this case - avoid the memmove for this line. */ - nread--; p++; - if (nread) - memmove (buffer, p, nread); - readpos = 0; - break; /* The for loop. */ - } - else - readpos++; - } - } - - /* Update the gpg object. */ - gpg->colon.bufsize = bufsize; - gpg->colon.buffer = buffer; - gpg->colon.readpos = readpos; - return 0; -} - - -/* This colonline handler thing is not the clean way to do it. It - might be better to enhance the gpgme_data_t object to act as a wrapper - for a callback. Same goes for the status thing. For now we use - this thing here because it is easier to implement. */ -static gpgme_error_t -colon_line_handler (void *opaque, int fd) -{ - engine_gpg_t gpg = opaque; - gpgme_error_t rc = 0; - - assert (fd == gpg->colon.fd[0]); - rc = read_colon_line (gpg); - if (rc) - return rc; - if (gpg->colon.eof) - _gpgme_io_close (fd); - return 0; -} - - -static gpgme_error_t -start (engine_gpg_t gpg) -{ - gpgme_error_t rc; - int saved_errno; - int i, n; - int status; - struct spawn_fd_item_s *fd_list; - pid_t pid; - - if (!gpg) - return gpg_error (GPG_ERR_INV_VALUE); - - if (!gpg->file_name && !_gpgme_get_gpg_path ()) - return gpg_error (GPG_ERR_INV_ENGINE); - - if (gpg->lc_ctype) - { - rc = add_arg_ext (gpg, gpg->lc_ctype, 1); - if (!rc) - rc = add_arg_ext (gpg, "--lc-ctype", 1); - if (rc) - return rc; - } - - if (gpg->lc_messages) - { - rc = add_arg_ext (gpg, gpg->lc_messages, 1); - if (!rc) - rc = add_arg_ext (gpg, "--lc-messages", 1); - if (rc) - return rc; - } - - rc = build_argv (gpg); - if (rc) - return rc; - - /* status_fd, colon_fd and end of list. */ - n = 3; - for (i = 0; gpg->fd_data_map[i].data; i++) - n++; - fd_list = calloc (n, sizeof *fd_list); - if (! fd_list) - return gpg_error_from_errno (errno); - - /* Build the fd list for the child. */ - n = 0; - fd_list[n].fd = gpg->status.fd[1]; - fd_list[n].dup_to = -1; - fd_list[n].arg_loc = gpg->status.arg_loc; - n++; - if (gpg->colon.fnc) - { - fd_list[n].fd = gpg->colon.fd[1]; - fd_list[n].dup_to = 1; - n++; - } - for (i = 0; gpg->fd_data_map[i].data; i++) - { - fd_list[n].fd = gpg->fd_data_map[i].peer_fd; - fd_list[n].dup_to = gpg->fd_data_map[i].dup_to; - fd_list[n].arg_loc = gpg->fd_data_map[i].arg_loc; - n++; - } - fd_list[n].fd = -1; - fd_list[n].dup_to = -1; - - status = _gpgme_io_spawn (gpg->file_name ? gpg->file_name : - _gpgme_get_gpg_path (), gpg->argv, fd_list, &pid); - saved_errno = errno; - - free (fd_list); - if (status == -1) - return gpg_error_from_errno (saved_errno); - - /*_gpgme_register_term_handler ( closure, closure_value, pid );*/ - - rc = add_io_cb (gpg, gpg->status.fd[0], 1, status_handler, gpg, - &gpg->status.tag); - if (rc) - /* FIXME: kill the child */ - return rc; - - if (gpg->colon.fnc) - { - assert (gpg->colon.fd[0] != -1); - rc = add_io_cb (gpg, gpg->colon.fd[0], 1, colon_line_handler, gpg, - &gpg->colon.tag); - if (rc) - /* FIXME: kill the child */ - return rc; - } - - for (i = 0; gpg->fd_data_map[i].data; i++) - { - if (gpg->cmd.used && i == gpg->cmd.idx) - { - /* Park the cmd fd. */ - gpg->cmd.fd = gpg->fd_data_map[i].fd; - gpg->fd_data_map[i].fd = -1; - } - else - { - rc = add_io_cb (gpg, gpg->fd_data_map[i].fd, - gpg->fd_data_map[i].inbound, - gpg->fd_data_map[i].inbound - ? _gpgme_data_inbound_handler - : _gpgme_data_outbound_handler, - gpg->fd_data_map[i].data, &gpg->fd_data_map[i].tag); - - if (rc) - /* FIXME: kill the child */ - return rc; - } - } - - _gpgme_allow_set_foregound_window (pid); - - gpg_io_event (gpg, GPGME_EVENT_START, NULL); - - /* fixme: check what data we can release here */ - return 0; -} - - -static gpgme_error_t -gpg_decrypt (void *engine, gpgme_data_t ciph, gpgme_data_t plain) -{ - engine_gpg_t gpg = engine; - gpgme_error_t err; - - err = add_arg (gpg, "--decrypt"); - - /* Tell the gpg object about the data. */ - if (!err) - err = add_arg (gpg, "--output"); - if (!err) - err = add_arg (gpg, "-"); - if (!err) - err = add_data (gpg, plain, 1, 1); - if (!err) - err = add_arg (gpg, "--"); - if (!err) - err = add_data (gpg, ciph, -1, 0); - - if (!err) - start (gpg); - return err; -} - -static gpgme_error_t -gpg_delete (void *engine, gpgme_key_t key, int allow_secret) -{ - engine_gpg_t gpg = engine; - gpgme_error_t err; - - err = add_arg (gpg, allow_secret ? "--delete-secret-and-public-key" - : "--delete-key"); - if (!err) - err = add_arg (gpg, "--"); - if (!err) - { - if (!key->subkeys || !key->subkeys->fpr) - return gpg_error (GPG_ERR_INV_VALUE); - else - err = add_arg (gpg, key->subkeys->fpr); - } - - if (!err) - start (gpg); - return err; -} - - -static gpgme_error_t -append_args_from_signers (engine_gpg_t gpg, gpgme_ctx_t ctx /* FIXME */) -{ - gpgme_error_t err = 0; - int i; - gpgme_key_t key; - - for (i = 0; (key = gpgme_signers_enum (ctx, i)); i++) - { - const char *s = key->subkeys ? key->subkeys->keyid : NULL; - if (s) - { - if (!err) - err = add_arg (gpg, "-u"); - if (!err) - err = add_arg (gpg, s); - } - gpgme_key_unref (key); - if (err) break; - } - return err; -} - - -static gpgme_error_t -append_args_from_sig_notations (engine_gpg_t gpg, gpgme_ctx_t ctx /* FIXME */) -{ - gpgme_error_t err = 0; - gpgme_sig_notation_t notation; - - notation = gpgme_sig_notation_get (ctx); - - while (!err && notation) - { - if (notation->name - && !(notation->flags & GPGME_SIG_NOTATION_HUMAN_READABLE)) - err = gpg_error (GPG_ERR_INV_VALUE); - else if (notation->name) - { - char *arg; - - /* Maximum space needed is one byte for the "critical" flag, - the name, one byte for '=', the value, and a terminating - '\0'. */ - - arg = malloc (1 + notation->name_len + 1 + notation->value_len + 1); - if (!arg) - err = gpg_error_from_errno (errno); - - if (!err) - { - char *argp = arg; - - if (notation->critical) - *(argp++) = '!'; - - memcpy (argp, notation->name, notation->name_len); - argp += notation->name_len; - - *(argp++) = '='; - - /* We know that notation->name is '\0' terminated. */ - strcpy (argp, notation->value); - } - - if (!err) - err = add_arg (gpg, "--sig-notation"); - if (!err) - err = add_arg (gpg, arg); - - if (arg) - free (arg); - } - else - { - /* This is a policy URL. */ - - char *value; - - if (notation->critical) - { - value = malloc (1 + notation->value_len + 1); - if (!value) - err = gpg_error_from_errno (errno); - else - { - value[0] = '!'; - /* We know that notation->value is '\0' terminated. */ - strcpy (&value[1], notation->value); - } - } - else - value = notation->value; - - if (!err) - err = add_arg (gpg, "--sig-policy-url"); - if (!err) - err = add_arg (gpg, value); - - if (value != notation->value) - free (value); - } - - notation = notation->next; - } - return err; -} - - -static gpgme_error_t -gpg_edit (void *engine, int type, gpgme_key_t key, gpgme_data_t out, - gpgme_ctx_t ctx /* FIXME */) -{ - engine_gpg_t gpg = engine; - gpgme_error_t err; - - err = add_arg (gpg, "--with-colons"); - if (!err) - err = append_args_from_signers (gpg, ctx); - if (!err) - err = add_arg (gpg, type == 0 ? "--edit-key" : "--card-edit"); - if (!err) - err = add_data (gpg, out, 1, 1); - if (!err) - err = add_arg (gpg, "--"); - if (!err && type == 0) - { - const char *s = key->subkeys ? key->subkeys->fpr : NULL; - if (!s) - err = gpg_error (GPG_ERR_INV_VALUE); - else - err = add_arg (gpg, s); - } - if (!err) - err = start (gpg); - - return err; -} - - -static gpgme_error_t -append_args_from_recipients (engine_gpg_t gpg, gpgme_key_t recp[]) -{ - gpgme_error_t err = 0; - int i = 0; - - while (recp[i]) - { - if (!recp[i]->subkeys || !recp[i]->subkeys->fpr) - err = gpg_error (GPG_ERR_INV_VALUE); - if (!err) - err = add_arg (gpg, "-r"); - if (!err) - err = add_arg (gpg, recp[i]->subkeys->fpr); - if (err) - break; - i++; - } - return err; -} - - -static gpgme_error_t -gpg_encrypt (void *engine, gpgme_key_t recp[], gpgme_encrypt_flags_t flags, - gpgme_data_t plain, gpgme_data_t ciph, int use_armor) -{ - engine_gpg_t gpg = engine; - gpgme_error_t err; - int symmetric = !recp; - - err = add_arg (gpg, symmetric ? "--symmetric" : "--encrypt"); - - if (!err && use_armor) - err = add_arg (gpg, "--armor"); - - if (!symmetric) - { - /* If we know that all recipients are valid (full or ultimate trust) - we can suppress further checks. */ - if (!err && !symmetric && (flags & GPGME_ENCRYPT_ALWAYS_TRUST)) - err = add_arg (gpg, "--always-trust"); - - if (!err) - err = append_args_from_recipients (gpg, recp); - } - - /* Tell the gpg object about the data. */ - if (!err) - err = add_arg (gpg, "--output"); - if (!err) - err = add_arg (gpg, "-"); - if (!err) - err = add_data (gpg, ciph, 1, 1); - if (gpgme_data_get_file_name (plain)) - { - if (!err) - err = add_arg (gpg, "--set-filename"); - if (!err) - err = add_arg (gpg, gpgme_data_get_file_name (plain)); - } - if (!err) - err = add_arg (gpg, "--"); - if (!err) - err = add_data (gpg, plain, -1, 0); - - if (!err) - err = start (gpg); - - return err; -} - - -static gpgme_error_t -gpg_encrypt_sign (void *engine, gpgme_key_t recp[], - gpgme_encrypt_flags_t flags, gpgme_data_t plain, - gpgme_data_t ciph, int use_armor, - gpgme_ctx_t ctx /* FIXME */) -{ - engine_gpg_t gpg = engine; - gpgme_error_t err; - - err = add_arg (gpg, "--encrypt"); - if (!err) - err = add_arg (gpg, "--sign"); - if (!err && use_armor) - err = add_arg (gpg, "--armor"); - - /* If we know that all recipients are valid (full or ultimate trust) - we can suppress further checks. */ - if (!err && (flags & GPGME_ENCRYPT_ALWAYS_TRUST)) - err = add_arg (gpg, "--always-trust"); - - if (!err) - err = append_args_from_recipients (gpg, recp); - - if (!err) - err = append_args_from_signers (gpg, ctx); - if (!err) - err = append_args_from_sig_notations (gpg, ctx); - - /* Tell the gpg object about the data. */ - if (!err) - err = add_arg (gpg, "--output"); - if (!err) - err = add_arg (gpg, "-"); - if (!err) - err = add_data (gpg, ciph, 1, 1); - if (gpgme_data_get_file_name (plain)) - { - if (!err) - err = add_arg (gpg, "--set-filename"); - if (!err) - err = add_arg (gpg, gpgme_data_get_file_name (plain)); - } - if (!err) - err = add_arg (gpg, "--"); - if (!err) - err = add_data (gpg, plain, -1, 0); - - if (!err) - err = start (gpg); - - return err; -} - - -static gpgme_error_t -gpg_export (void *engine, const char *pattern, unsigned int reserved, - gpgme_data_t keydata, int use_armor) -{ - engine_gpg_t gpg = engine; - gpgme_error_t err; - - if (reserved) - return gpg_error (GPG_ERR_INV_VALUE); - - err = add_arg (gpg, "--export"); - if (!err && use_armor) - err = add_arg (gpg, "--armor"); - if (!err) - err = add_data (gpg, keydata, 1, 1); - if (!err) - err = add_arg (gpg, "--"); - - if (!err && pattern && *pattern) - err = add_arg (gpg, pattern); - - if (!err) - err = start (gpg); - - return err; -} - - -static gpgme_error_t -gpg_export_ext (void *engine, const char *pattern[], unsigned int reserved, - gpgme_data_t keydata, int use_armor) -{ - engine_gpg_t gpg = engine; - gpgme_error_t err; - - if (reserved) - return gpg_error (GPG_ERR_INV_VALUE); - - err = add_arg (gpg, "--export"); - if (!err && use_armor) - err = add_arg (gpg, "--armor"); - if (!err) - err = add_data (gpg, keydata, 1, 1); - if (!err) - err = add_arg (gpg, "--"); - - if (pattern) - { - while (!err && *pattern && **pattern) - err = add_arg (gpg, *(pattern++)); - } - - if (!err) - err = start (gpg); - - return err; -} - - -static gpgme_error_t -gpg_genkey (void *engine, gpgme_data_t help_data, int use_armor, - gpgme_data_t pubkey, gpgme_data_t seckey) -{ - engine_gpg_t gpg = engine; - gpgme_error_t err; - - if (!gpg) - return gpg_error (GPG_ERR_INV_VALUE); - - /* We need a special mechanism to get the fd of a pipe here, so that - we can use this for the %pubring and %secring parameters. We - don't have this yet, so we implement only the adding to the - standard keyrings. */ - if (pubkey || seckey) - return gpg_error (GPG_ERR_NOT_IMPLEMENTED); - - err = add_arg (gpg, "--gen-key"); - if (!err && use_armor) - err = add_arg (gpg, "--armor"); - if (!err) - err = add_arg (gpg, "--"); - if (!err) - err = add_data (gpg, help_data, -1, 0); - - if (!err) - err = start (gpg); - - return err; -} - - -static gpgme_error_t -gpg_import (void *engine, gpgme_data_t keydata) -{ - engine_gpg_t gpg = engine; - gpgme_error_t err; - - err = add_arg (gpg, "--import"); - if (!err) - err = add_arg (gpg, "--"); - if (!err) - err = add_data (gpg, keydata, -1, 0); - - if (!err) - err = start (gpg); - - return err; -} - - -/* The output for external keylistings in GnuPG is different from all - the other key listings. We catch this here with a special - preprocessor that reformats the colon handler lines. */ -static gpgme_error_t -gpg_keylist_preprocess (char *line, char **r_line) -{ - enum - { - RT_NONE, RT_INFO, RT_PUB, RT_UID - } - rectype = RT_NONE; -#define NR_FIELDS 16 - char *field[NR_FIELDS]; - int fields = 0; - - *r_line = NULL; - - while (line && fields < NR_FIELDS) - { - field[fields++] = line; - line = strchr (line, ':'); - if (line) - *(line++) = '\0'; - } - - if (!strcmp (field[0], "info")) - rectype = RT_INFO; - else if (!strcmp (field[0], "pub")) - rectype = RT_PUB; - else if (!strcmp (field[0], "uid")) - rectype = RT_UID; - else - rectype = RT_NONE; - - switch (rectype) - { - case RT_INFO: - /* FIXME: Eventually, check the version number at least. */ - return 0; - - case RT_PUB: - if (fields < 7) - return 0; - - /* The format is: - - pub:::::: - - as defined in 5.2. Machine Readable Indexes of the OpenPGP - HTTP Keyserver Protocol (draft). - - We want: - pub:o::::::::::::: - */ - - if (asprintf (r_line, "pub:o%s:%s:%s:%s:%s:%s::::::::", - field[6], field[3], field[2], field[1], - field[4], field[5]) < 0) - return gpg_error_from_errno (errno); - return 0; - - case RT_UID: - /* The format is: - - uid:::: - - as defined in 5.2. Machine Readable Indexes of the OpenPGP - HTTP Keyserver Protocol (draft). - - We want: - uid:o::::::::: - */ - - { - /* The user ID is percent escaped, but we want c-coded. - Because we have to replace each '%HL' by '\xHL', we need at - most 4/3 th the number of bytes. But because we also need - to escape the backslashes we allocate twice as much. */ - char *uid = malloc (2 * strlen (field[1]) + 1); - char *src; - char *dst; - - if (! uid) - return gpg_error_from_errno (errno); - src = field[1]; - dst = uid; - while (*src) - { - if (*src == '%') - { - *(dst++) = '\\'; - *(dst++) = 'x'; - src++; - /* Copy the next two bytes unconditionally. */ - if (*src) - *(dst++) = *(src++); - if (*src) - *(dst++) = *(src++); - } - else if (*src == '\\') - { - *dst++ = '\\'; - *dst++ = '\\'; - } - else - *(dst++) = *(src++); - } - *dst = '\0'; - - if (asprintf (r_line, "uid:o%s::::%s:%s:::%s:", - field[4], field[2], field[3], uid) < 0) - return gpg_error_from_errno (errno); - } - return 0; - - case RT_NONE: - /* Unknown record. */ - break; - } - return 0; - -} - - -static gpg_error_t -gpg_keylist_build_options (engine_gpg_t gpg, int secret_only, - gpgme_keylist_mode_t mode) -{ - gpg_error_t err; - - err = add_arg (gpg, "--with-colons"); - if (!err) - err = add_arg (gpg, "--fixed-list-mode"); - if (!err) - err = add_arg (gpg, "--with-fingerprint"); - if (!err) - err = add_arg (gpg, "--with-fingerprint"); - if (!err - && (mode & GPGME_KEYLIST_MODE_SIGS) - && (mode & GPGME_KEYLIST_MODE_SIG_NOTATIONS)) - { - err = add_arg (gpg, "--list-options"); - if (!err) - err = add_arg (gpg, "show-sig-subpackets=\"20,26\""); - } - if (!err) - { - if ( (mode & GPGME_KEYLIST_MODE_EXTERN) ) - { - if (secret_only) - err = gpg_error (GPG_ERR_NOT_SUPPORTED); - else if ( (mode & GPGME_KEYLIST_MODE_LOCAL)) - { - /* The local+extern mode is special. It works only with - gpg >= 2.0.10. FIXME: We should check that we have - such a version to that we can return a proper error - code. The problem is that we don't know the context - here and thus can't accesses the cached version - number for the engine info structure. */ - err = add_arg (gpg, "--locate-keys"); - if ((mode & GPGME_KEYLIST_MODE_SIGS)) - err = add_arg (gpg, "--with-sig-check"); - } - else - { - err = add_arg (gpg, "--search-keys"); - gpg->colon.preprocess_fnc = gpg_keylist_preprocess; - } - } - else - { - err = add_arg (gpg, secret_only ? "--list-secret-keys" - : ((mode & GPGME_KEYLIST_MODE_SIGS) - ? "--check-sigs" : "--list-keys")); - } - } - if (!err) - err = add_arg (gpg, "--"); - - return err; -} - - -static gpgme_error_t -gpg_keylist (void *engine, const char *pattern, int secret_only, - gpgme_keylist_mode_t mode) -{ - engine_gpg_t gpg = engine; - gpgme_error_t err; - - err = gpg_keylist_build_options (gpg, secret_only, mode); - - if (!err && pattern && *pattern) - err = add_arg (gpg, pattern); - - if (!err) - err = start (gpg); - - return err; -} - - -static gpgme_error_t -gpg_keylist_ext (void *engine, const char *pattern[], int secret_only, - int reserved, gpgme_keylist_mode_t mode) -{ - engine_gpg_t gpg = engine; - gpgme_error_t err; - - if (reserved) - return gpg_error (GPG_ERR_INV_VALUE); - - err = gpg_keylist_build_options (gpg, secret_only, mode); - - if (pattern) - { - while (!err && *pattern && **pattern) - err = add_arg (gpg, *(pattern++)); - } - - if (!err) - err = start (gpg); - - return err; -} - - -static gpgme_error_t -gpg_sign (void *engine, gpgme_data_t in, gpgme_data_t out, - gpgme_sig_mode_t mode, int use_armor, int use_textmode, - int include_certs, gpgme_ctx_t ctx /* FIXME */) -{ - engine_gpg_t gpg = engine; - gpgme_error_t err; - - if (mode == GPGME_SIG_MODE_CLEAR) - err = add_arg (gpg, "--clearsign"); - else - { - err = add_arg (gpg, "--sign"); - if (!err && mode == GPGME_SIG_MODE_DETACH) - err = add_arg (gpg, "--detach"); - if (!err && use_armor) - err = add_arg (gpg, "--armor"); - if (!err && use_textmode) - err = add_arg (gpg, "--textmode"); - } - - if (!err) - err = append_args_from_signers (gpg, ctx); - if (!err) - err = append_args_from_sig_notations (gpg, ctx); - - if (gpgme_data_get_file_name (in)) - { - if (!err) - err = add_arg (gpg, "--set-filename"); - if (!err) - err = add_arg (gpg, gpgme_data_get_file_name (in)); - } - - /* Tell the gpg object about the data. */ - if (!err) - err = add_arg (gpg, "--"); - if (!err) - err = add_data (gpg, in, -1, 0); - if (!err) - err = add_data (gpg, out, 1, 1); - - if (!err) - start (gpg); - - return err; -} - -static gpgme_error_t -gpg_trustlist (void *engine, const char *pattern) -{ - engine_gpg_t gpg = engine; - gpgme_error_t err; - - err = add_arg (gpg, "--with-colons"); - if (!err) - err = add_arg (gpg, "--list-trust-path"); - - /* Tell the gpg object about the data. */ - if (!err) - err = add_arg (gpg, "--"); - if (!err) - err = add_arg (gpg, pattern); - - if (!err) - err = start (gpg); - - return err; -} - - -static gpgme_error_t -gpg_verify (void *engine, gpgme_data_t sig, gpgme_data_t signed_text, - gpgme_data_t plaintext) -{ - engine_gpg_t gpg = engine; - gpgme_error_t err = 0; - - if (plaintext) - { - /* Normal or cleartext signature. */ - - err = add_arg (gpg, "--output"); - if (!err) - err = add_arg (gpg, "-"); - if (!err) - err = add_arg (gpg, "--"); - if (!err) - err = add_data (gpg, sig, -1, 0); - if (!err) - err = add_data (gpg, plaintext, 1, 1); - } - else - { - err = add_arg (gpg, "--verify"); - if (!err) - err = add_arg (gpg, "--"); - if (!err) - err = add_data (gpg, sig, -1, 0); - if (!err && signed_text) - err = add_data (gpg, signed_text, -1, 0); - } - - if (!err) - err = start (gpg); - - return err; -} - - -static void -gpg_set_io_cbs (void *engine, gpgme_io_cbs_t io_cbs) -{ - engine_gpg_t gpg = engine; - - gpg->io_cbs = *io_cbs; -} - - -struct engine_ops _gpgme_engine_ops_gpg = - { - /* Static functions. */ - _gpgme_get_gpg_path, - gpg_get_version, - gpg_get_req_version, - gpg_new, - - /* Member functions. */ - gpg_release, - NULL, /* reset */ - gpg_set_status_handler, - gpg_set_command_handler, - gpg_set_colon_line_handler, - gpg_set_locale, - gpg_decrypt, - gpg_delete, - gpg_edit, - gpg_encrypt, - gpg_encrypt_sign, - gpg_export, - gpg_export_ext, - gpg_genkey, - gpg_import, - gpg_keylist, - gpg_keylist_ext, - gpg_sign, - gpg_trustlist, - gpg_verify, - NULL, /* getauditlog */ - NULL, /* conf_load */ - NULL, /* conf_save */ - gpg_set_io_cbs, - gpg_io_event, - gpg_cancel - }; diff -urpNP gpgme-1.1.8/src/util.h gpgme-1.2.0/src/util.h --- gpgme-1.1.8/src/util.h 2008-11-03 16:50:12.000000000 +0000 +++ gpgme-1.2.0/src/util.h 2009-06-15 11:59:37.000000000 +0000 @@ -33,7 +33,12 @@ const char *_gpgme_get_gpg_path (void); const char *_gpgme_get_gpgsm_path (void); const char *_gpgme_get_gpgconf_path (void); int _gpgme_get_conf_int (const char *key, int *value); -void _gpgme_allow_set_foregound_window (pid_t pid); +void _gpgme_allow_set_foreground_window (pid_t pid); + +/*-- dirinfo.c --*/ +const char *_gpgme_get_default_homedir (void); +const char *_gpgme_get_default_agent_socket (void); + /*-- replacement functions in .c --*/ @@ -111,4 +116,12 @@ int _gpgme_mkstemp (int *fd, char **name const char *_gpgme_get_w32spawn_path (void); #endif +/*-- Error codes not yet available in current gpg-error.h. --*/ +#ifndef GPG_ERR_UNFINISHED +#define GPG_ERR_UNFINISHED 199 +#endif +#ifndef GPG_ERR_NOT_OPERATIONAL +#define GPG_ERR_NOT_OPERATIONAL 176 +#endif + #endif /* UTIL_H */ diff -urpNP gpgme-1.1.8/src/version.c gpgme-1.2.0/src/version.c --- gpgme-1.1.8/src/version.c 2008-11-18 17:20:14.000000000 +0000 +++ gpgme-1.2.0/src/version.c 2009-06-17 12:36:07.000000000 +0000 @@ -22,6 +22,7 @@ #if HAVE_CONFIG_H #include #endif +#include #include #include #include @@ -32,6 +33,7 @@ #include "gpgme.h" #include "priv-io.h" #include "debug.h" +#include "context.h" /* For _gpgme_sema_subsystem_init (). */ #include "sema.h" @@ -40,6 +42,14 @@ #include "assuan.h" #endif +#ifdef HAVE_W32_SYSTEM +#include "windows.h" +#endif + +/* We implement this function, so we have to disable the overriding + macro. */ +#undef gpgme_check_version + /* Bootstrap the subsystems needed for concurrent operation. This must be done once at startup. We can not guarantee this using a @@ -54,9 +64,16 @@ do_subsystem_inits (void) if (done) return; +#ifdef HAVE_W32_SYSTEM + { + WSADATA wsadat; + + WSAStartup (0x202, &wsadat); + } +#endif + _gpgme_sema_subsystem_init (); #ifdef HAVE_ASSUAN_H - assuan_set_assuan_log_level (0); assuan_set_assuan_err_source (GPG_ERR_SOURCE_GPGME); #endif /*HAVE_ASSUAN_H*/ _gpgme_debug_subsystem_init (); @@ -172,6 +189,7 @@ _gpgme_compare_versions (const char *my_ const char * gpgme_check_version (const char *req_version) { + char *result; do_subsystem_inits (); /* Catch-22: We need to get at least the debug subsystem ready @@ -179,9 +197,42 @@ gpgme_check_version (const char *req_ver automagically initialize the debug system with out the locks being initialized and missing the assuan log level setting. */ TRACE2 (DEBUG_INIT, "gpgme_check_version: ", 0, - "req_version=%s, VERSION=%s", req_version, VERSION); + "req_version=%s, VERSION=%s", + req_version? req_version:"(null)", VERSION); - return _gpgme_compare_versions (VERSION, req_version) ? VERSION : NULL; + result = _gpgme_compare_versions (VERSION, req_version) ? VERSION : NULL; + if (result != NULL) + _gpgme_selftest = 0; + + return result; +} + +/* Check the version and also at runtime if the struct layout of the + library matches the one of the user. This is particular useful for + Windows targets (-mms-bitfields). */ +const char * +gpgme_check_version_internal (const char *req_version, + size_t offset_sig_validity) +{ + const char *result; + + TRACE2 (DEBUG_INIT, "gpgme_check_version_internal: ", 0, + "req_version=%s, offset_sig_validity=%i", + req_version ? req_version : "(null)", offset_sig_validity); + + result = gpgme_check_version (req_version); + if (result == NULL) + return result; + + if (offset_sig_validity != offsetof (struct _gpgme_signature, validity)) + { + TRACE1 (DEBUG_INIT, "gpgme_check_version_internal: ", 0, + "offset_sig_validity mismatch: expected %i", + offsetof (struct _gpgme_signature, validity)); + _gpgme_selftest = GPG_ERR_SELFTEST_FAILED; + } + + return result; } @@ -260,7 +311,7 @@ _gpgme_get_program_version (const char * cfd[0].fd = rp[1]; - status = _gpgme_io_spawn (file_name, argv, cfd, NULL); + status = _gpgme_io_spawn (file_name, argv, 0, cfd, NULL); if (status < 0) { _gpgme_io_close (rp[0]); diff -urpNP gpgme-1.1.8/src/w32-glib-io.c gpgme-1.2.0/src/w32-glib-io.c --- gpgme-1.1.8/src/w32-glib-io.c 2008-11-03 16:50:12.000000000 +0000 +++ gpgme-1.2.0/src/w32-glib-io.c 2009-06-15 11:59:37.000000000 +0000 @@ -80,6 +80,13 @@ static struct { + int used; + + /* If this is not -1, then it's a libc file descriptor. */ + int fd; + /* If fd is -1, this is the Windows socket handle. */ + int socket; + GIOChannel *chan; /* The boolean PRIMARY is true if this file descriptor caused the allocation of CHAN. Only then should CHAN be destroyed when this @@ -102,20 +109,96 @@ static struct static GIOChannel * -find_channel (int fd, int create) +find_channel (int fd) { if (fd < 0 || fd >= MAX_SLAFD) return NULL; - if (create && !giochannel_table[fd].chan) + return giochannel_table[fd].chan; +} + + +/* Returns the FD or -1 on resource limit. */ +int +new_dummy_channel_from_fd (int cfd) +{ + int idx; + + for (idx = 0; idx < MAX_SLAFD; idx++) + if (! giochannel_table[idx].used) + break; + + if (idx == MAX_SLAFD) { - giochannel_table[fd].chan = g_io_channel_win32_new_fd (fd); - giochannel_table[fd].primary = 1; - g_io_channel_set_encoding (giochannel_table[fd].chan, NULL, NULL); - g_io_channel_set_buffered (giochannel_table[fd].chan, FALSE); + errno = EIO; + return -1; } - return giochannel_table[fd].chan; + giochannel_table[idx].used = 1; + giochannel_table[idx].chan = NULL; + giochannel_table[idx].fd = cfd; + giochannel_table[idx].socket = INVALID_SOCKET; + giochannel_table[idx].primary = 1; + + return idx; +} + + +/* Returns the FD or -1 on resource limit. */ +int +new_channel_from_fd (int cfd) +{ + int idx; + + for (idx = 0; idx < MAX_SLAFD; idx++) + if (! giochannel_table[idx].used) + break; + + if (idx == MAX_SLAFD) + { + errno = EIO; + return -1; + } + + giochannel_table[idx].used = 1; + giochannel_table[idx].chan = g_io_channel_win32_new_fd (cfd); + giochannel_table[idx].fd = cfd; + giochannel_table[idx].socket = INVALID_SOCKET; + giochannel_table[idx].primary = 1; + + g_io_channel_set_encoding (giochannel_table[idx].chan, NULL, NULL); + g_io_channel_set_buffered (giochannel_table[idx].chan, FALSE); + + return idx; +} + + +/* Returns the FD or -1 on resource limit. */ +int +new_channel_from_socket (int sock) +{ + int idx; + + for (idx = 0; idx < MAX_SLAFD; idx++) + if (! giochannel_table[idx].used) + break; + + if (idx == MAX_SLAFD) + { + errno = EIO; + return -1; + } + + giochannel_table[idx].used = 1; + giochannel_table[idx].chan = g_io_channel_win32_new_socket (sock); + giochannel_table[idx].fd = -1; + giochannel_table[idx].socket = sock; + giochannel_table[idx].primary = 1; + + g_io_channel_set_encoding (giochannel_table[idx].chan, NULL, NULL); + g_io_channel_set_buffered (giochannel_table[idx].chan, FALSE); + + return idx; } @@ -123,7 +206,7 @@ find_channel (int fd, int create) void * gpgme_get_giochannel (int fd) { - return find_channel (fd, 0); + return find_channel (fd); } @@ -131,7 +214,7 @@ gpgme_get_giochannel (int fd) void * gpgme_get_fdptr (int fd) { - return find_channel (fd, 0); + return find_channel (fd); } @@ -141,9 +224,17 @@ gpgme_get_fdptr (int fd) int _gpgme_io_fd2str (char *buf, int buflen, int fd) { + HANDLE hndl; + TRACE_BEG1 (DEBUG_SYSIO, "_gpgme_io_fd2str", fd, "fd=%d", fd); - TRACE_SUC1 ("syshd=%p", _get_osfhandle (fd)); - return snprintf (buf, buflen, "%d", (int) _get_osfhandle (fd)); + if (giochannel_table[fd].fd != -1) + hndl = (HANDLE) _get_osfhandle (giochannel_table[fd].fd); + else + hndl = (HANDLE) giochannel_table[fd].socket; + + TRACE_SUC1 ("syshd=%p", hndl); + + return snprintf (buf, buflen, "%d", (int) hndl); } @@ -170,7 +261,7 @@ _gpgme_io_read (int fd, void *buffer, si TRACE_BEG2 (DEBUG_SYSIO, "_gpgme_io_read", fd, "buffer=%p, count=%u", buffer, count); - chan = find_channel (fd, 0); + chan = find_channel (fd); if (!chan) { TRACE_LOG ("no channel registered"); @@ -192,14 +283,20 @@ _gpgme_io_read (int fd, void *buffer, si if (status == G_IO_STATUS_EOF) nread = 0; + else if (status == G_IO_STATUS_AGAIN) + { + nread = -1; + saved_errno = EAGAIN; + } else if (status != G_IO_STATUS_NORMAL) { TRACE_LOG1 ("status %d", status); nread = -1; saved_errno = EIO; } - - TRACE_LOGBUF (buffer, nread); + + if (nread != 0 && nread != -1) + TRACE_LOGBUF (buffer, nread); errno = saved_errno; return TRACE_SYSRES (nread); @@ -213,11 +310,13 @@ _gpgme_io_write (int fd, const void *buf gsize nwritten; GIOChannel *chan; GIOStatus status; + GError *err = NULL; + TRACE_BEG2 (DEBUG_SYSIO, "_gpgme_io_write", fd, "buffer=%p, count=%u", buffer, count); TRACE_LOGBUF (buffer, count); - chan = find_channel (fd, 0); + chan = find_channel (fd); if (!chan) { TRACE_LOG ("fd %d: no channel registered"); @@ -226,8 +325,19 @@ _gpgme_io_write (int fd, const void *buf } status = g_io_channel_write_chars (chan, (gchar *) buffer, count, - &nwritten, NULL); - if (status != G_IO_STATUS_NORMAL) + &nwritten, &err); + if (err) + { + TRACE_LOG1 ("write error: %s", err->message); + g_error_free (err); + } + + if (status == G_IO_STATUS_AGAIN) + { + nwritten = -1; + saved_errno = EAGAIN; + } + else if (status != G_IO_STATUS_NORMAL) { nwritten = -1; saved_errno = EIO; @@ -241,13 +351,14 @@ _gpgme_io_write (int fd, const void *buf int _gpgme_io_pipe (int filedes[2], int inherit_idx) { - GIOChannel *chan; + int fds[2]; + TRACE_BEG2 (DEBUG_SYSIO, "_gpgme_io_pipe", filedes, "inherit_idx=%i (GPGME uses it for %s)", inherit_idx, inherit_idx ? "reading" : "writing"); #define PIPEBUF_SIZE 4096 - if (_pipe (filedes, PIPEBUF_SIZE, O_NOINHERIT | O_BINARY) == -1) + if (_pipe (fds, PIPEBUF_SIZE, O_NOINHERIT | O_BINARY) == -1) return TRACE_SYSRES (-1); /* Make one end inheritable. */ @@ -255,13 +366,13 @@ _gpgme_io_pipe (int filedes[2], int inhe { int new_read; - new_read = _dup (filedes[0]); - _close (filedes[0]); - filedes[0] = new_read; + new_read = _dup (fds[0]); + _close (fds[0]); + fds[0] = new_read; if (new_read < 0) { - _close (filedes[1]); + _close (fds[1]); return TRACE_SYSRES (-1); } } @@ -269,33 +380,48 @@ _gpgme_io_pipe (int filedes[2], int inhe { int new_write; - new_write = _dup (filedes[1]); - _close (filedes[1]); - filedes[1] = new_write; + new_write = _dup (fds[1]); + _close (fds[1]); + fds[1] = new_write; if (new_write < 0) { - _close (filedes[0]); + _close (fds[0]); return TRACE_SYSRES (-1); } } - /* Now we have a pipe with the right end inheritable. The other end - should have a giochannel. */ - chan = find_channel (filedes[1 - inherit_idx], 1); - if (!chan) + /* For _gpgme_io_close. */ + filedes[inherit_idx] = new_dummy_channel_from_fd (fds[inherit_idx]); + if (filedes[inherit_idx] < 0) { int saved_errno = errno; - _close (filedes[0]); - _close (filedes[1]); + + _close (fds[0]); + _close (fds[1]); errno = saved_errno; return TRACE_SYSRES (-1); } + /* Now we have a pipe with the correct end inheritable. The other end + should have a giochannel. */ + filedes[1 - inherit_idx] = new_channel_from_fd (fds[1 - inherit_idx]); + if (filedes[1 - inherit_idx] < 0) + { + int saved_errno = errno; + + _gpgme_io_close (fds[inherit_idx]); + _close (fds[1 - inherit_idx]); + errno = saved_errno; + return TRACE_SYSRES (-1); + } + return TRACE_SUC5 ("read=0x%x/%p, write=0x%x/%p, channel=%p", - filedes[0], (HANDLE) _get_osfhandle (filedes[0]), - filedes[1], (HANDLE) _get_osfhandle (filedes[1]), - chan); + filedes[0], + (HANDLE) _get_osfhandle (giochannel_table[filedes[0]].fd), + filedes[1], + (HANDLE) _get_osfhandle (giochannel_table[filedes[1]].fd), + giochannel_table[1 - inherit_idx].chan); } @@ -310,6 +436,8 @@ _gpgme_io_close (int fd) return TRACE_SYSRES (-1); } + assert (giochannel_table[fd].used); + /* First call the notify handler. */ if (notify_table[fd].handler) { @@ -318,19 +446,26 @@ _gpgme_io_close (int fd) notify_table[fd].value = NULL; } - /* Then do the close. */ + /* Then do the close. */ if (giochannel_table[fd].chan) { if (giochannel_table[fd].primary) g_io_channel_shutdown (giochannel_table[fd].chan, 1, NULL); - else - _close (fd); - + g_io_channel_unref (giochannel_table[fd].chan); - giochannel_table[fd].chan = NULL; } else - _close (fd); + { + /* Dummy entry, just close. */ + assert (giochannel_table[fd].fd != -1); + _close (giochannel_table[fd].fd); + } + + giochannel_table[fd].used = 0; + giochannel_table[fd].fd = -1; + giochannel_table[fd].socket = INVALID_SOCKET; + giochannel_table[fd].chan = NULL; + giochannel_table[fd].primary = 0; TRACE_SUC (); return 0; @@ -365,16 +500,17 @@ _gpgme_io_set_nonblocking (int fd) TRACE_BEG (DEBUG_SYSIO, "_gpgme_io_set_nonblocking", fd); - chan = find_channel (fd, 0); + chan = find_channel (fd); if (!chan) { errno = EIO; return TRACE_SYSRES (-1); } - status = g_io_channel_set_flags (chan, + status = g_io_channel_set_flags (chan, g_io_channel_get_flags (chan) | G_IO_FLAG_NONBLOCK, NULL); + if (status != G_IO_STATUS_NORMAL) { #if 0 @@ -448,7 +584,7 @@ build_commandline (char **argv) int -_gpgme_io_spawn (const char *path, char **argv, +_gpgme_io_spawn (const char *path, char * const argv[], unsigned int flags, struct spawn_fd_item_s *fd_list, pid_t *r_pid) { SECURITY_ATTRIBUTES sec_attr; @@ -460,8 +596,8 @@ _gpgme_io_spawn (const char *path, char 0 /* returns tid */ }; STARTUPINFO si; - int cr_flags = CREATE_DEFAULT_ERROR_MODE - | GetPriorityClass (GetCurrentProcess ()); + int cr_flags = (CREATE_DEFAULT_ERROR_MODE + | GetPriorityClass (GetCurrentProcess ())); int i; char **args; char *arg_string; @@ -543,13 +679,17 @@ _gpgme_io_spawn (const char *path, char free (arg_string); + if (flags & IOSPAWN_FLAG_ALLOW_SET_FG) + _gpgme_allow_set_foreground_window ((pid_t)pi.dwProcessId); + /* Insert the inherited handles. */ for (i = 0; fd_list[i].fd != -1; i++) { HANDLE hd; /* Make it inheritable for the wrapper process. */ - if (!DuplicateHandle (GetCurrentProcess(), _get_osfhandle (fd_list[i].fd), + if (!DuplicateHandle (GetCurrentProcess(), + _get_osfhandle (giochannel_table[fd_list[i].fd].fd), pi.hProcess, &hd, 0, TRUE, DUPLICATE_SAME_ACCESS)) { TRACE_LOG1 ("DuplicateHandle failed: ec=%d", (int) GetLastError ()); @@ -584,8 +724,10 @@ _gpgme_io_spawn (const char *path, char int written; size_t len; - line[0] = '\n'; - line[1] = '\0'; + if ((flags & IOSPAWN_FLAG_ALLOW_SET_FG)) + strcpy (line, "~1 \n"); + else + strcpy (line, "\n"); for (i = 0; fd_list[i].fd != -1; i++) { /* Strip the newline. */ @@ -694,7 +836,7 @@ _gpgme_io_select (struct io_select_fd_s continue; if ((fds[i].for_read || fds[i].for_write) - && !(chan = find_channel (fds[i].fd, 0))) + && !(chan = find_channel (fds[i].fd))) { TRACE_ADD1 (dbg_help, "[BAD0x%x ", fds[i].fd); TRACE_END (dbg_help, "]"); @@ -786,27 +928,147 @@ _gpgme_io_dup (int fd) { int newfd; GIOChannel *chan; - - TRACE_BEG1 (DEBUG_SYSIO, "_gpgme_io_dup", fd, "dup (%d)", fd); - newfd = _dup (fd); - if (newfd == -1) - return TRACE_SYSRES (-1); - if (newfd < 0 || newfd >= MAX_SLAFD) + TRACE_BEG (DEBUG_SYSIO, "_gpgme_io_dup", fd); + + if (fd < 0 || fd >= MAX_SLAFD || !giochannel_table[fd].used) { - /* New FD won't fit into our table. */ - _close (newfd); - errno = EIO; + errno = EINVAL; return TRACE_SYSRES (-1); } - assert (giochannel_table[newfd].chan == NULL); - - chan = find_channel (fd, 0); - assert (chan); + for (newfd = 0; newfd < MAX_SLAFD; newfd++) + if (! giochannel_table[newfd].used) + break; + if (newfd == MAX_SLAFD) + { + errno = EIO; + return TRACE_SYSRES (-1); + } + + chan = giochannel_table[fd].chan; g_io_channel_ref (chan); + giochannel_table[newfd].used = 1; giochannel_table[newfd].chan = chan; + giochannel_table[newfd].fd = -1; + giochannel_table[newfd].socket = INVALID_SOCKET; giochannel_table[newfd].primary = 0; return TRACE_SYSRES (newfd); } + + + + + +static int +wsa2errno (int err) +{ + switch (err) + { + case WSAENOTSOCK: + return EINVAL; + case WSAEWOULDBLOCK: + return EAGAIN; + case ERROR_BROKEN_PIPE: + return EPIPE; + case WSANOTINITIALISED: + return ENOSYS; + default: + return EIO; + } +} + + +int +_gpgme_io_socket (int domain, int type, int proto) +{ + int res; + int fd; + + TRACE_BEG2 (DEBUG_SYSIO, "_gpgme_io_socket", domain, + "type=%i, protp=%i", type, proto); + + res = socket (domain, type, proto); + if (res == INVALID_SOCKET) + { + errno = wsa2errno (WSAGetLastError ()); + return TRACE_SYSRES (-1); + } + + fd = new_channel_from_socket (res); + if (fd < 0) + { + int saved_errno = errno; + closesocket (res); + errno = saved_errno; + return TRACE_SYSRES (-1); + } + + TRACE_SUC2 ("fd=%i, socket=0x%x", fd, res); + + return fd; +} + + +int +_gpgme_io_connect (int fd, struct sockaddr *addr, int addrlen) +{ + GIOChannel *chan; + int sockfd; + int res; + GIOFlags flags; + GIOStatus status; + GError *err = NULL; + + TRACE_BEG2 (DEBUG_SYSIO, "_gpgme_io_connect", fd, + "addr=%p, addrlen=%i", addr, addrlen); + + chan = find_channel (fd); + if (! chan) + { + errno = EINVAL; + return TRACE_SYSRES (-1); + } + + flags = g_io_channel_get_flags (chan); + if (flags & G_IO_FLAG_NONBLOCK) + { + status = g_io_channel_set_flags (chan, flags & ~G_IO_FLAG_NONBLOCK, &err); + if (err) + { + TRACE_LOG1 ("setting flags error: %s", err->message); + g_error_free (err); + err = NULL; + } + if (status != G_IO_STATUS_NORMAL) + { + errno = EIO; + return TRACE_SYSRES (-1); + } + } + + sockfd = giochannel_table[fd].socket; + if (sockfd == INVALID_SOCKET) + { + errno = EINVAL; + return TRACE_SYSRES (-1); + } + + TRACE_LOG1 ("connect sockfd=0x%x", sockfd); + res = connect (sockfd, addr, addrlen); + + /* FIXME: Error ignored here. */ + if (! (flags & G_IO_FLAG_NONBLOCK)) + g_io_channel_set_flags (chan, flags, NULL); + + if (res) + { + TRACE_LOG2 ("connect failed: %i %i", res, WSAGetLastError ()); + + errno = wsa2errno (WSAGetLastError ()); + return TRACE_SYSRES (-1); + } + + return TRACE_SUC (); +} diff -urpNP gpgme-1.1.8/src/w32-io.c gpgme-1.2.0/src/w32-io.c --- gpgme-1.1.8/src/w32-io.c 2008-11-03 16:50:12.000000000 +0000 +++ gpgme-1.2.0/src/w32-io.c 2009-06-18 16:09:23.000000000 +0000 @@ -53,8 +53,8 @@ #define READBUF_SIZE 4096 #define WRITEBUF_SIZE 4096 #define PIPEBUF_SIZE 4096 -#define MAX_READERS 20 -#define MAX_WRITERS 20 +#define MAX_READERS 40 +#define MAX_WRITERS 40 static struct { @@ -389,9 +389,12 @@ find_reader (int fd, int start_it) if (i != reader_table_size) { rd = create_reader (fd_to_handle (fd)); - reader_table[i].fd = fd; - reader_table[i].context = rd; - reader_table[i].used = 1; + if (rd) + { + reader_table[i].fd = fd; + reader_table[i].context = rd; + reader_table[i].used = 1; + } } UNLOCK (reader_table_lock); @@ -692,9 +695,12 @@ find_writer (int fd, int start_it) if (i != writer_table_size) { wt = create_writer (fd_to_handle (fd)); - writer_table[i].fd = fd; - writer_table[i].context = wt; - writer_table[i].used = 1; + if (wt) + { + writer_table[i].fd = fd; + writer_table[i].context = wt; + writer_table[i].used = 1; + } } UNLOCK (writer_table_lock); @@ -733,7 +739,7 @@ _gpgme_io_write (int fd, const void *buf if (count == 0) return TRACE_SYSRES (0); - ctx = find_writer (fd, 1); + ctx = find_writer (fd, 0); if (!ctx) return TRACE_SYSRES (-1); @@ -826,6 +832,7 @@ _gpgme_io_pipe (int filedes[2], int inhe /* Make one end inheritable. */ if (inherit_idx == 0) { + struct writer_context_s *ctx; HANDLE hd; if (!DuplicateHandle (GetCurrentProcess(), rh, GetCurrentProcess(), &hd, 0, @@ -841,9 +848,22 @@ _gpgme_io_pipe (int filedes[2], int inhe } CloseHandle (rh); rh = hd; + + ctx = find_writer (handle_to_fd (wh), 0); + assert (ctx == NULL); + ctx = find_writer (handle_to_fd (wh), 1); + if (!ctx) + { + CloseHandle (rh); + CloseHandle (wh); + /* FIXME: Should translate the error code. */ + errno = EIO; + return TRACE_SYSRES (-1); + } } else if (inherit_idx == 1) { + struct reader_context_s *ctx; HANDLE hd; if (!DuplicateHandle( GetCurrentProcess(), wh, GetCurrentProcess(), &hd, 0, @@ -859,6 +879,18 @@ _gpgme_io_pipe (int filedes[2], int inhe } CloseHandle (wh); wh = hd; + + ctx = find_reader (handle_to_fd (rh), 0); + assert (ctx == NULL); + ctx = find_reader (handle_to_fd (rh), 1); + if (!ctx) + { + CloseHandle (rh); + CloseHandle (wh); + /* FIXME: Should translate the error code. */ + errno = EIO; + return TRACE_SYSRES (-1); + } } filedes[0] = handle_to_fd (rh); @@ -1009,7 +1041,7 @@ build_commandline (char **argv) int -_gpgme_io_spawn (const char *path, char *const argv[], +_gpgme_io_spawn (const char *path, char *const argv[], unsigned int flags, struct spawn_fd_item_s *fd_list, pid_t *r_pid) { SECURITY_ATTRIBUTES sec_attr; @@ -1021,8 +1053,8 @@ _gpgme_io_spawn (const char *path, char 0 /* returns tid */ }; STARTUPINFO si; - int cr_flags = CREATE_DEFAULT_ERROR_MODE - | GetPriorityClass (GetCurrentProcess ()); + int cr_flags = (CREATE_DEFAULT_ERROR_MODE + | GetPriorityClass (GetCurrentProcess ())); int i; char **args; char *arg_string; @@ -1104,6 +1136,9 @@ _gpgme_io_spawn (const char *path, char free (arg_string); + if (flags & IOSPAWN_FLAG_ALLOW_SET_FG) + _gpgme_allow_set_foreground_window ((pid_t)pi.dwProcessId); + /* Insert the inherited handles. */ for (i = 0; fd_list[i].fd != -1; i++) { @@ -1139,14 +1174,16 @@ _gpgme_io_spawn (const char *path, char notation: "0xFEDCBA9876543210" with an extra white space after every quadruplet. 10*(19*4 + 1) - 1 = 769. This plans ahead for a time when a HANDLE is 64 bit. */ -#define BUFFER_MAX 800 +#define BUFFER_MAX 810 char line[BUFFER_MAX + 1]; int res; int written; size_t len; - line[0] = '\n'; - line[1] = '\0'; + if ((flags & IOSPAWN_FLAG_ALLOW_SET_FG)) + strcpy (line, "~1 \n"); + else + strcpy (line, "\n"); for (i = 0; fd_list[i].fd != -1; i++) { /* Strip the newline. */ @@ -1181,6 +1218,7 @@ _gpgme_io_spawn (const char *path, char if (r_pid) *r_pid = (pid_t)pi.dwProcessId; + if (ResumeThread (pi.hThread) < 0) TRACE_LOG1 ("ResumeThread failed: ec=%d", (int) GetLastError ()); @@ -1242,7 +1280,7 @@ _gpgme_io_select (struct io_select_fd_s { if (fds[i].for_read) { - struct reader_context_s *ctx = find_reader (fds[i].fd,1); + struct reader_context_s *ctx = find_reader (fds[i].fd,0); if (!ctx) TRACE_LOG1 ("error: no reader for FD 0x%x (ignored)", @@ -1265,7 +1303,7 @@ _gpgme_io_select (struct io_select_fd_s } else if (fds[i].for_write) { - struct writer_context_s *ctx = find_writer (fds[i].fd,1); + struct writer_context_s *ctx = find_writer (fds[i].fd,0); if (!ctx) TRACE_LOG1 ("error: no writer for FD 0x%x (ignored)", @@ -1411,7 +1449,7 @@ _gpgme_io_dup (int fd) return TRACE_SYSRES (-1); } - rd_ctx = find_reader (fd, 1); + rd_ctx = find_reader (fd, 0); if (rd_ctx) { /* No need for locking, as the only races are against the reader @@ -1430,7 +1468,7 @@ _gpgme_io_dup (int fd) UNLOCK (reader_table_lock); } - wt_ctx = find_writer (fd, 1); + wt_ctx = find_writer (fd, 0); if (wt_ctx) { /* No need for locking, as the only races are against the writer @@ -1469,3 +1507,62 @@ gpgme_get_fdptr (int fd) { return NULL; } + + +static int +wsa2errno (int err) +{ + switch (err) + { + case WSAENOTSOCK: + return EINVAL; + case WSAEWOULDBLOCK: + return EAGAIN; + case ERROR_BROKEN_PIPE: + return EPIPE; + case WSANOTINITIALISED: + return ENOSYS; + default: + return EIO; + } +} + + +int +_gpgme_io_socket (int domain, int type, int proto) +{ + int res; + + TRACE_BEG2 (DEBUG_SYSIO, "_gpgme_io_socket", domain, + "type=%i, protp=%i", type, proto); + + res = socket (domain, type, proto); + if (res == INVALID_SOCKET) + { + errno = wsa2errno (WSAGetLastError ()); + return TRACE_SYSRES (-1); + } + + TRACE_SUC1 ("socket=0x%x", res); + + return res; +} + + +int +_gpgme_io_connect (int fd, struct sockaddr *addr, int addrlen) +{ + int res; + + TRACE_BEG2 (DEBUG_SYSIO, "_gpgme_io_connect", fd, + "addr=%p, addrlen=%i", addr, addrlen); + + res = connect (fd, addr, addrlen); + if (!res) + { + errno = wsa2errno (WSAGetLastError ()); + return TRACE_SYSRES (-1); + } + + return TRACE_SUC (); +} diff -urpNP gpgme-1.1.8/src/w32-qt-io.cpp gpgme-1.2.0/src/w32-qt-io.cpp --- gpgme-1.1.8/src/w32-qt-io.cpp 2008-11-03 16:50:12.000000000 +0000 +++ gpgme-1.2.0/src/w32-qt-io.cpp 2009-06-15 11:59:37.000000000 +0000 @@ -397,7 +397,7 @@ build_commandline (char **argv) int -_gpgme_io_spawn (const char *path, char **argv, +_gpgme_io_spawn (const char *path, char * const argv[], unsigned int flags, struct spawn_fd_item_s *fd_list, pid_t *r_pid) { SECURITY_ATTRIBUTES sec_attr; @@ -492,6 +492,9 @@ _gpgme_io_spawn (const char *path, char free (arg_string); + if (flags & IOSPAWN_FLAG_ALLOW_SET_FG) + _gpgme_allow_set_foreground_window ((pid_t)pi.dwProcessId); + /* Insert the inherited handles. */ for (i = 0; fd_list[i].fd != -1; i++) { @@ -533,8 +536,10 @@ _gpgme_io_spawn (const char *path, char int written; size_t len; - line[0] = '\n'; - line[1] = '\0'; + if ((flags & IOSPAWN_FLAG_ALLOW_SET_FG)) + strcpy (line, "~1 \n"); + else + strcpy (line, "\n"); for (i = 0; fd_list[i].fd != -1; i++) { /* Strip the newline. */ @@ -674,3 +679,20 @@ _gpgme_io_dup (int fd) return fd; } + +extern "C" +int +_gpgme_io_socket (int domain, int type, int proto) +{ + errno = EIO; + return -1; +} + + +extern "C" +int +_gpgme_io_connect (int fd, struct sockaddr *addr, int addrlen) +{ + errno = EIO; + return -1; +} diff -urpNP gpgme-1.1.8/src/w32-util.c gpgme-1.2.0/src/w32-util.c --- gpgme-1.1.8/src/w32-util.c 2008-11-03 16:50:12.000000000 +0000 +++ gpgme-1.2.0/src/w32-util.c 2009-06-15 11:59:37.000000000 +0000 @@ -393,7 +393,7 @@ _gpgme_get_conf_int (const char *key, in void -_gpgme_allow_set_foregound_window (pid_t pid) +_gpgme_allow_set_foreground_window (pid_t pid) { static int initialized; static BOOL (WINAPI * func)(DWORD); @@ -416,9 +416,22 @@ _gpgme_allow_set_foregound_window (pid_t } if (!pid || pid == (pid_t)(-1)) - ; + { + TRACE1 (DEBUG_ENGINE, "gpgme:AllowSetForegroundWindow", 0, + "no action for pid %d", (int)pid); + } else if (func) - func (pid); + { + int rc = func (pid); + TRACE2 (DEBUG_ENGINE, "gpgme:AllowSetForegroundWindow", 0, + "called for pid %d; result=%d", (int)pid, rc); + + } + else + { + TRACE0 (DEBUG_ENGINE, "gpgme:AllowSetForegroundWindow", 0, + "function not available"); + } } diff -urpNP gpgme-1.1.8/tests/ChangeLog gpgme-1.2.0/tests/ChangeLog --- gpgme-1.1.8/tests/ChangeLog 2008-12-03 13:40:18.000000000 +0000 +++ gpgme-1.2.0/tests/ChangeLog 2009-06-17 12:36:08.000000000 +0000 @@ -1,3 +1,47 @@ +2009-06-16 Werner Koch + + * gpg/pgp-import.c: New. + * gpg/t-support.h (print_import_result, nonnull): Factored out + from other tools. + + * gpg/pgp-export.c, gpg/pgp-keylist.c: New. + +2009-06-09 Werner Koch + + * gpg/Makefile.am (./pubring.gpg): Ignore errors in case of + already imported keys. Add --no-permission-warning and remove + obsolete --allow-secret-key-import. + * gpg/mkdemodirs.in (GPG): Add --no-permission-warning. + + * gpg/t-edit.c (edit_fnc): Use gpgme_io_write. + +2009-04-19 Moritz + + * gpg/Makefile.am (EXTRA_DIST): Replaced mkdemodirs with mkdemodirs.in. + (mkdemodirs): New target. + (clean-local): Added command for removing mkdemodirs script. + (./Alpha/Secret.gpg): Added dependency on mkdemodirs. + + * gpg/mkdemodirs: Renamed to ... + * gpg/mkdemodirs.in: ... here. + * gpg/mkdemodirs.in (GPG): Derive value from @GPG@ instead of + hard-coding "gpg". + +2009-02-24 Werner Koch + + * opassuan/t-command.c: Adjust for changed new op_assuan interface. + +2009-02-03 Werner Koch + + * gpg/t-keylist.c (main): Check that new fields is_cardkey and + card_number are not set. + +2009-01-26 Werner Koch + + * opassuan/: New. + * opassuan/Makefile.am: New. + * opassuan/t-command.c: New. + 2008-12-03 Marcus Brinkmann * Makefile.am (INCLUDES): Fix path to include file. diff -urpNP gpgme-1.1.8/tests/Makefile.am gpgme-1.2.0/tests/Makefile.am --- gpgme-1.1.8/tests/Makefile.am 2008-12-03 13:39:21.000000000 +0000 +++ gpgme-1.2.0/tests/Makefile.am 2009-01-26 14:15:26.000000000 +0000 @@ -15,8 +15,7 @@ # Public License for more details. # # You should have received a copy of the GNU Lesser General Public -# License along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA +# License along with this program; if not, see . ## Process this file with automake to produce Makefile.in @@ -40,7 +39,7 @@ gpgtests = endif if RUN_GPGSM_TESTS -gpgsmtests = gpgsm +gpgsmtests = gpgsm opassuan else gpgsmtests = endif diff -urpNP gpgme-1.1.8/tests/Makefile.in gpgme-1.2.0/tests/Makefile.in --- gpgme-1.1.8/tests/Makefile.in 2008-12-08 18:41:52.000000000 +0000 +++ gpgme-1.2.0/tests/Makefile.in 2009-06-18 16:13:40.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -31,8 +31,7 @@ # Public License for more details. # # You should have received a copy of the GNU Lesser General Public -# License along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA +# License along with this program; if not, see . VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ @@ -106,7 +105,7 @@ RECURSIVE_CLEAN_TARGETS = mostlyclean-re distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags -DIST_SUBDIRS = gpg gpgsm +DIST_SUBDIRS = gpg gpgsm opassuan DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -174,6 +173,7 @@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ +NEED__FILE_OFFSET_BITS = @NEED__FILE_OFFSET_BITS@ NETLIBS = @NETLIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -246,6 +246,7 @@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ TESTS_ENVIRONMENT = GNUPGHOME=$(abs_builddir) @@ -256,7 +257,7 @@ LDADD = ../src/libgpgme.la @GPG_ERROR_LI @RUN_GPG_TESTS_FALSE@gpgtests = @RUN_GPG_TESTS_TRUE@gpgtests = gpg @RUN_GPGSM_TESTS_FALSE@gpgsmtests = -@RUN_GPGSM_TESTS_TRUE@gpgsmtests = gpgsm +@RUN_GPGSM_TESTS_TRUE@gpgsmtests = gpgsm opassuan SUBDIRS = ${gpgtests} ${gpgsmtests} all: all-recursive @@ -266,8 +267,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_ @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -420,7 +421,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS @@ -476,7 +477,7 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) - @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \ + @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ if test -n "$$list"; then \ @@ -487,7 +488,7 @@ check-TESTS: $(TESTS) if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ - *$$ws$$tst$$ws*) \ + *[\ \ ]$$tst[\ \ ]*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ echo "XPASS: $$tst"; \ @@ -499,7 +500,7 @@ check-TESTS: $(TESTS) elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ - *$$ws$$tst$$ws*) \ + *[\ \ ]$$tst[\ \ ]*) \ xfail=`expr $$xfail + 1`; \ echo "XFAIL: $$tst"; \ ;; \ @@ -513,23 +514,36 @@ check-TESTS: $(TESTS) echo "SKIP: $$tst"; \ fi; \ done; \ + if test "$$all" -eq 1; then \ + tests="test"; \ + All=""; \ + else \ + tests="tests"; \ + All="All "; \ + fi; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ - banner="All $$all tests passed"; \ + banner="$$All$$all $$tests passed"; \ else \ - banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ + banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ - banner="$$failed of $$all tests failed"; \ + banner="$$failed of $$all $$tests failed"; \ else \ - banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ + banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ - skipped="($$skip tests were not run)"; \ + if test "$$skip" -eq 1; then \ + skipped="($$skip test was not run)"; \ + else \ + skipped="($$skip tests were not run)"; \ + fi; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ diff -urpNP gpgme-1.1.8/tests/gpg/Makefile.am gpgme-1.2.0/tests/gpg/Makefile.am --- gpgme-1.1.8/tests/gpg/Makefile.am 2008-12-03 13:39:37.000000000 +0000 +++ gpgme-1.2.0/tests/gpg/Makefile.am 2009-06-17 12:36:08.000000000 +0000 @@ -1,5 +1,5 @@ # Copyright (C) 2000 Werner Koch (dd9jn) -# Copyright (C) 2001, 2004, 2005 g10 Code GmbH +# Copyright (C) 2001, 2004, 2005, 2009 g10 Code GmbH # # This file is part of GPGME. # @@ -40,7 +40,7 @@ TESTS = t-encrypt t-encrypt-sym t-encryp CLEANFILES = secring.gpg pubring.gpg pubring.kbx trustdb.gpg dirmngr.conf DISTCLEANFILES = pubring.gpg~ pubring.kbx~ random_seed gpg.conf gpg-agent.conf -EXTRA_DIST = mkdemodirs pubdemo.asc secdemo.asc cipher-1.asc cipher-2.asc \ +EXTRA_DIST = mkdemodirs.in pubdemo.asc secdemo.asc cipher-1.asc cipher-2.asc \ geheim.txt pubkey-1.asc seckey-1.asc pinentry INCLUDES = -I$(top_builddir)/src @@ -50,20 +50,27 @@ LDADD = ../../src/libgpgme.la t_thread1_LDADD = ../../src/libgpgme-pthread.la # We don't run t-genkey in the test suite, because it takes too long -noinst_PROGRAMS = $(TESTS) t-genkey +# The other programs are used for debugging. +noinst_PROGRAMS = $(TESTS) t-genkey pgp-keylist pgp-export pgp-import + +mkdemodirs: mkdemodirs.in Makefile + sed -e 's,[@]GPG[@],$(GPG),g' < $(srcdir)/mkdemodirs.in > mkdemodirs + chmod +x mkdemodirs clean-local: - $(srcdir)/mkdemodirs --clean + -./mkdemodirs --clean + -rm -f mkdemodirs all-local: ./pubring.gpg ./gpg.conf ./gpg-agent.conf ./pubring.gpg: $(srcdir)/pubdemo.asc ./Alpha/Secret.gpg - $(GPG) --homedir . --import $(srcdir)/pubdemo.asc - $(GPG) --homedir . --allow-secret-key-import \ + -$(GPG) --homedir . --no-permission-warning \ + --import $(srcdir)/pubdemo.asc + -$(GPG) --homedir . --no-permission-warning \ --import Alpha/Secret.gpg Zulu/Secret.gpg -./Alpha/Secret.gpg: secdemo.asc - srcdir=$(srcdir) $(srcdir)/mkdemodirs +./Alpha/Secret.gpg: mkdemodirs secdemo.asc + srcdir=$(srcdir) ./mkdemodirs ./gpg.conf: # This is required for t-sig-notations. diff -urpNP gpgme-1.1.8/tests/gpg/Makefile.in gpgme-1.2.0/tests/gpg/Makefile.in --- gpgme-1.1.8/tests/gpg/Makefile.in 2008-12-08 18:41:52.000000000 +0000 +++ gpgme-1.2.0/tests/gpg/Makefile.in 2009-06-18 16:13:41.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -15,7 +15,7 @@ @SET_MAKE@ # Copyright (C) 2000 Werner Koch (dd9jn) -# Copyright (C) 2001, 2004, 2005 g10 Code GmbH +# Copyright (C) 2001, 2004, 2005, 2009 g10 Code GmbH # # This file is part of GPGME. # @@ -60,7 +60,8 @@ TESTS = t-encrypt$(EXEEXT) t-encrypt-sym t-keylist-sig$(EXEEXT) t-wait$(EXEEXT) \ t-encrypt-large$(EXEEXT) t-file-name$(EXEEXT) \ t-gpgconf$(EXEEXT) $(am__EXEEXT_1) -noinst_PROGRAMS = $(am__EXEEXT_2) t-genkey$(EXEEXT) +noinst_PROGRAMS = $(am__EXEEXT_2) t-genkey$(EXEEXT) \ + pgp-keylist$(EXEEXT) pgp-export$(EXEEXT) pgp-import$(EXEEXT) subdir = tests/gpg DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in @@ -85,6 +86,18 @@ am__EXEEXT_2 = t-encrypt$(EXEEXT) t-encr t-encrypt-large$(EXEEXT) t-file-name$(EXEEXT) \ t-gpgconf$(EXEEXT) $(am__EXEEXT_1) PROGRAMS = $(noinst_PROGRAMS) +pgp_export_SOURCES = pgp-export.c +pgp_export_OBJECTS = pgp-export.$(OBJEXT) +pgp_export_LDADD = $(LDADD) +pgp_export_DEPENDENCIES = ../../src/libgpgme.la +pgp_import_SOURCES = pgp-import.c +pgp_import_OBJECTS = pgp-import.$(OBJEXT) +pgp_import_LDADD = $(LDADD) +pgp_import_DEPENDENCIES = ../../src/libgpgme.la +pgp_keylist_SOURCES = pgp-keylist.c +pgp_keylist_OBJECTS = pgp-keylist.$(OBJEXT) +pgp_keylist_LDADD = $(LDADD) +pgp_keylist_DEPENDENCIES = ../../src/libgpgme.la t_decrypt_SOURCES = t-decrypt.c t_decrypt_OBJECTS = t-decrypt.$(OBJEXT) t_decrypt_LDADD = $(LDADD) @@ -184,18 +197,18 @@ CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ -SOURCES = t-decrypt.c t-decrypt-verify.c t-edit.c t-encrypt.c \ - t-encrypt-large.c t-encrypt-sign.c t-encrypt-sym.c \ - t-eventloop.c t-export.c t-file-name.c t-genkey.c t-gpgconf.c \ - t-import.c t-keylist.c t-keylist-sig.c t-sig-notation.c \ - t-sign.c t-signers.c t-thread1.c t-trustlist.c t-verify.c \ - t-wait.c -DIST_SOURCES = t-decrypt.c t-decrypt-verify.c t-edit.c t-encrypt.c \ - t-encrypt-large.c t-encrypt-sign.c t-encrypt-sym.c \ - t-eventloop.c t-export.c t-file-name.c t-genkey.c t-gpgconf.c \ - t-import.c t-keylist.c t-keylist-sig.c t-sig-notation.c \ - t-sign.c t-signers.c t-thread1.c t-trustlist.c t-verify.c \ - t-wait.c +SOURCES = pgp-export.c pgp-import.c pgp-keylist.c t-decrypt.c \ + t-decrypt-verify.c t-edit.c t-encrypt.c t-encrypt-large.c \ + t-encrypt-sign.c t-encrypt-sym.c t-eventloop.c t-export.c \ + t-file-name.c t-genkey.c t-gpgconf.c t-import.c t-keylist.c \ + t-keylist-sig.c t-sig-notation.c t-sign.c t-signers.c \ + t-thread1.c t-trustlist.c t-verify.c t-wait.c +DIST_SOURCES = pgp-export.c pgp-import.c pgp-keylist.c t-decrypt.c \ + t-decrypt-verify.c t-edit.c t-encrypt.c t-encrypt-large.c \ + t-encrypt-sign.c t-encrypt-sym.c t-eventloop.c t-export.c \ + t-file-name.c t-genkey.c t-gpgconf.c t-import.c t-keylist.c \ + t-keylist-sig.c t-sig-notation.c t-sign.c t-signers.c \ + t-thread1.c t-trustlist.c t-verify.c t-wait.c HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags @@ -266,6 +279,7 @@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ +NEED__FILE_OFFSET_BITS = @NEED__FILE_OFFSET_BITS@ NETLIBS = @NETLIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -338,6 +352,7 @@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ TESTS_ENVIRONMENT = GNUPGHOME=$(abs_builddir) GPG_AGENT_INFO= @@ -348,7 +363,7 @@ noinst_HEADERS = t-support.h @HAVE_W32_SYSTEM_TRUE@tests_unix = CLEANFILES = secring.gpg pubring.gpg pubring.kbx trustdb.gpg dirmngr.conf DISTCLEANFILES = pubring.gpg~ pubring.kbx~ random_seed gpg.conf gpg-agent.conf -EXTRA_DIST = mkdemodirs pubdemo.asc secdemo.asc cipher-1.asc cipher-2.asc \ +EXTRA_DIST = mkdemodirs.in pubdemo.asc secdemo.asc cipher-1.asc cipher-2.asc \ geheim.txt pubkey-1.asc seckey-1.asc pinentry INCLUDES = -I$(top_builddir)/src @@ -363,8 +378,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_ @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -395,6 +410,15 @@ clean-noinstPROGRAMS: echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done +pgp-export$(EXEEXT): $(pgp_export_OBJECTS) $(pgp_export_DEPENDENCIES) + @rm -f pgp-export$(EXEEXT) + $(LINK) $(pgp_export_OBJECTS) $(pgp_export_LDADD) $(LIBS) +pgp-import$(EXEEXT): $(pgp_import_OBJECTS) $(pgp_import_DEPENDENCIES) + @rm -f pgp-import$(EXEEXT) + $(LINK) $(pgp_import_OBJECTS) $(pgp_import_LDADD) $(LIBS) +pgp-keylist$(EXEEXT): $(pgp_keylist_OBJECTS) $(pgp_keylist_DEPENDENCIES) + @rm -f pgp-keylist$(EXEEXT) + $(LINK) $(pgp_keylist_OBJECTS) $(pgp_keylist_LDADD) $(LIBS) t-decrypt$(EXEEXT): $(t_decrypt_OBJECTS) $(t_decrypt_DEPENDENCIES) @rm -f t-decrypt$(EXEEXT) $(LINK) $(t_decrypt_OBJECTS) $(t_decrypt_LDADD) $(LIBS) @@ -468,6 +492,9 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pgp-export.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pgp-import.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pgp-keylist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-decrypt-verify.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-decrypt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-edit.Po@am__quote@ @@ -523,7 +550,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS @@ -566,7 +593,7 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) - @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \ + @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ if test -n "$$list"; then \ @@ -577,7 +604,7 @@ check-TESTS: $(TESTS) if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ - *$$ws$$tst$$ws*) \ + *[\ \ ]$$tst[\ \ ]*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ echo "XPASS: $$tst"; \ @@ -589,7 +616,7 @@ check-TESTS: $(TESTS) elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ - *$$ws$$tst$$ws*) \ + *[\ \ ]$$tst[\ \ ]*) \ xfail=`expr $$xfail + 1`; \ echo "XFAIL: $$tst"; \ ;; \ @@ -603,23 +630,36 @@ check-TESTS: $(TESTS) echo "SKIP: $$tst"; \ fi; \ done; \ + if test "$$all" -eq 1; then \ + tests="test"; \ + All=""; \ + else \ + tests="tests"; \ + All="All "; \ + fi; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ - banner="All $$all tests passed"; \ + banner="$$All$$all $$tests passed"; \ else \ - banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ + banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ - banner="$$failed of $$all tests failed"; \ + banner="$$failed of $$all $$tests failed"; \ else \ - banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ + banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ - skipped="($$skip tests were not run)"; \ + if test "$$skip" -eq 1; then \ + skipped="($$skip test was not run)"; \ + else \ + skipped="($$skip tests were not run)"; \ + fi; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ @@ -771,18 +811,24 @@ uninstall-am: tags uninstall uninstall-am +mkdemodirs: mkdemodirs.in Makefile + sed -e 's,[@]GPG[@],$(GPG),g' < $(srcdir)/mkdemodirs.in > mkdemodirs + chmod +x mkdemodirs + clean-local: - $(srcdir)/mkdemodirs --clean + -./mkdemodirs --clean + -rm -f mkdemodirs all-local: ./pubring.gpg ./gpg.conf ./gpg-agent.conf ./pubring.gpg: $(srcdir)/pubdemo.asc ./Alpha/Secret.gpg - $(GPG) --homedir . --import $(srcdir)/pubdemo.asc - $(GPG) --homedir . --allow-secret-key-import \ + -$(GPG) --homedir . --no-permission-warning \ + --import $(srcdir)/pubdemo.asc + -$(GPG) --homedir . --no-permission-warning \ --import Alpha/Secret.gpg Zulu/Secret.gpg -./Alpha/Secret.gpg: secdemo.asc - srcdir=$(srcdir) $(srcdir)/mkdemodirs +./Alpha/Secret.gpg: mkdemodirs secdemo.asc + srcdir=$(srcdir) ./mkdemodirs ./gpg.conf: # This is required for t-sig-notations. diff -urpNP gpgme-1.1.8/tests/gpg/mkdemodirs gpgme-1.2.0/tests/gpg/mkdemodirs --- gpgme-1.1.8/tests/gpg/mkdemodirs 2005-09-08 14:42:32.000000000 +0000 +++ gpgme-1.2.0/tests/gpg/mkdemodirs 1970-01-01 00:00:00.000000000 +0000 @@ -1,55 +0,0 @@ -#!/bin/sh -# Copyright (C) 2004 g10 Code GmbH -# -# This file is part of GPGME. -# -# GPGME is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation; either version 2.1 of the -# License, or (at your option) any later version. -# -# GPGME is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -# Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - -set -e - -GPG="gpg --batch --quiet --no-secmem-warning" -NAMES='Alpha Bravo Charlie Delta Echo Foxtrot Golf Hotel India - Juliet Kilo Lima Mike November Oscar Papa Quebec Romeo - Sierra Tango Uniform Victor Whisky XRay Yankee Zulu' - -if [ "$1" = "--clean" ]; then - (for i in $NAMES; do - [ -d $i ] && rm -r $i || true - done) || true - exit 0 -fi - -[ -z "$srcdir" ] && srcdir="../tests" - - -$GPG --dearmor -o secdemo.gpg --yes $srcdir/secdemo.asc -$GPG --dearmor -o pubdemo.gpg --yes $srcdir/pubdemo.asc -[ -f ./tdb.tmp ] && rm ./tdb.tmp -GPGDEMO="$GPG --homedir . --trustdb-name ./tdb.tmp --no-default-keyring - --keyring pubdemo.gpg --secret-keyring secdemo.gpg" -echo -n "Creating:" -for name in $NAMES; do - echo -n " $name" - [ -d $name ] && rm -r $name - mkdir $name - $GPGDEMO --export-secret-key -o - $name > $name/Secret.gpg - $GPG --homedir $name --allow-secret-key-import --import $name/Secret.gpg - $GPGDEMO --export -o - $name > $name/Public.gpg - $GPG --homedir $name --import $name/Public.gpg - [ -f $name/pubring.gpg~ ] && rm $name/pubring.gpg~ -done -echo "." -[ -f ./tdb.tmp ] && rm ./tdb.tmp -rm pubdemo.gpg secdemo.gpg diff -urpNP gpgme-1.1.8/tests/gpg/mkdemodirs.in gpgme-1.2.0/tests/gpg/mkdemodirs.in --- gpgme-1.1.8/tests/gpg/mkdemodirs.in 1970-01-01 00:00:00.000000000 +0000 +++ gpgme-1.2.0/tests/gpg/mkdemodirs.in 2009-06-15 11:59:37.000000000 +0000 @@ -0,0 +1,55 @@ +#!/bin/sh +# Copyright (C) 2004 g10 Code GmbH +# +# This file is part of GPGME. +# +# GPGME is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation; either version 2.1 of the +# License, or (at your option) any later version. +# +# GPGME is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General +# Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + +set -e + +GPG="@GPG@ --batch --quiet --no-secmem-warning --no-permission-warning" +NAMES='Alpha Bravo Charlie Delta Echo Foxtrot Golf Hotel India + Juliet Kilo Lima Mike November Oscar Papa Quebec Romeo + Sierra Tango Uniform Victor Whisky XRay Yankee Zulu' + +if [ "$1" = "--clean" ]; then + (for i in $NAMES; do + [ -d $i ] && rm -r $i || true + done) || true + exit 0 +fi + +[ -z "$srcdir" ] && srcdir="../tests" + + +$GPG --dearmor -o secdemo.gpg --yes $srcdir/secdemo.asc +$GPG --dearmor -o pubdemo.gpg --yes $srcdir/pubdemo.asc +[ -f ./tdb.tmp ] && rm ./tdb.tmp +GPGDEMO="$GPG --homedir . --trustdb-name ./tdb.tmp --no-default-keyring + --keyring pubdemo.gpg --secret-keyring secdemo.gpg" +echo -n "Creating:" +for name in $NAMES; do + echo -n " $name" + [ -d $name ] && rm -r $name + mkdir $name + $GPGDEMO --export-secret-key -o - $name > $name/Secret.gpg + $GPG --homedir $name --import $name/Secret.gpg + $GPGDEMO --export -o - $name > $name/Public.gpg + $GPG --homedir $name --import $name/Public.gpg + [ -f $name/pubring.gpg~ ] && rm $name/pubring.gpg~ +done +echo "." +[ -f ./tdb.tmp ] && rm ./tdb.tmp +rm pubdemo.gpg secdemo.gpg diff -urpNP gpgme-1.1.8/tests/gpg/pgp-export.c gpgme-1.2.0/tests/gpg/pgp-export.c --- gpgme-1.1.8/tests/gpg/pgp-export.c 1970-01-01 00:00:00.000000000 +0000 +++ gpgme-1.2.0/tests/gpg/pgp-export.c 2009-06-17 12:36:08.000000000 +0000 @@ -0,0 +1,161 @@ +/* pgp-export.c - Helper to run an export command + Copyright (C) 2008, 2009 g10 Code GmbH + + This file is part of GPGME. + + GPGME is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2.1 of + the License, or (at your option) any later version. + + GPGME is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this program; if not, see . +*/ + +/* We need to include config.h so that we know whether we are building + with large file system (LFS) support. */ +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +#include + +#define PGM "pgp-export" + +#include "t-support.h" + + +static int verbose; + + +static int +show_usage (int ex) +{ + fputs ("usage: " PGM " [options] USERIDS\n\n" + "Options:\n" + " --verbose run in verbose mode\n" + " --extern send keys to the keyserver (TAKE CARE!)\n" + , stderr); + exit (ex); +} + +int +main (int argc, char **argv) +{ + int last_argc = -1; + gpgme_error_t err; + gpgme_ctx_t ctx; + gpgme_key_t key; + gpgme_keylist_result_t result; + gpgme_key_t keyarray[100]; + int keyidx = 0; + gpgme_data_t out; + gpgme_export_mode_t mode = 0; + + if (argc) + { argc--; argv++; } + + while (argc && last_argc != argc ) + { + last_argc = argc; + if (!strcmp (*argv, "--")) + { + argc--; argv++; + break; + } + else if (!strcmp (*argv, "--help")) + show_usage (0); + else if (!strcmp (*argv, "--verbose")) + { + verbose = 1; + argc--; argv++; + } + else if (!strcmp (*argv, "--extern")) + { + mode |= GPGME_KEYLIST_MODE_EXTERN; + argc--; argv++; + } + else if (!strncmp (*argv, "--", 2)) + show_usage (1); + + } + + if (!argc) + show_usage (1); + + init_gpgme (GPGME_PROTOCOL_OpenPGP); + + err = gpgme_new (&ctx); + fail_if_err (err); + gpgme_set_protocol (ctx, GPGME_PROTOCOL_OpenPGP); + + /* Lookup the keys. */ + err = gpgme_op_keylist_ext_start (ctx, (const char**)argv, 0, 0); + fail_if_err (err); + + while (!(err = gpgme_op_keylist_next (ctx, &key))) + { + printf ("keyid: %s (fpr: %s)\n", + key->subkeys?nonnull (key->subkeys->keyid):"?", + key->subkeys?nonnull (key->subkeys->fpr):"?"); + + if (keyidx < DIM (keyarray)-1) + keyarray[keyidx++] = key; + else + { + fprintf (stderr, PGM": too many keys" + "- skipping this key\n"); + gpgme_key_unref (key); + } + } + if (gpg_err_code (err) != GPG_ERR_EOF) + fail_if_err (err); + err = gpgme_op_keylist_end (ctx); + fail_if_err (err); + keyarray[keyidx] = NULL; + + result = gpgme_op_keylist_result (ctx); + if (result->truncated) + { + fprintf (stderr, PGM ": key listing unexpectedly truncated\n"); + exit (1); + } + + /* Now for the actual export. */ + if ((mode & GPGME_KEYLIST_MODE_EXTERN)) + printf ("sending keys to keyserver\n"); + + err = gpgme_data_new (&out); + fail_if_err (err); + + gpgme_set_armor (ctx, 1); + err = gpgme_op_export_keys (ctx, keyarray, mode, + (mode & GPGME_KEYLIST_MODE_EXTERN)? NULL:out); + fail_if_err (err); + + fflush (NULL); + if (!(mode & GPGME_KEYLIST_MODE_EXTERN)) + { + fputs ("Begin Result:\n", stdout); + print_data (out); + fputs ("End Result.\n", stdout); + } + + /* Cleanup. */ + gpgme_data_release (out); + + for (keyidx=0; keyarray[keyidx]; keyidx++) + gpgme_key_unref (keyarray[keyidx]); + + gpgme_release (ctx); + return 0; +} diff -urpNP gpgme-1.1.8/tests/gpg/pgp-import.c gpgme-1.2.0/tests/gpg/pgp-import.c --- gpgme-1.1.8/tests/gpg/pgp-import.c 1970-01-01 00:00:00.000000000 +0000 +++ gpgme-1.2.0/tests/gpg/pgp-import.c 2009-06-17 12:36:08.000000000 +0000 @@ -0,0 +1,129 @@ +/* pgp-import.c - Helper to run an import command + Copyright (C) 2008, 2009 g10 Code GmbH + + This file is part of GPGME. + + GPGME is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2.1 of + the License, or (at your option) any later version. + + GPGME is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this program; if not, see . +*/ + +/* We need to include config.h so that we know whether we are building + with large file system (LFS) support. */ +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +#include + +#define PGM "pgp-import" + +#include "t-support.h" + + +static int verbose; + + +static int +show_usage (int ex) +{ + fputs ("usage: " PGM " [options] FILENAMEs\n\n" + "Options:\n" + " --verbose run in verbose mode\n" + " --url import from given URLs\n" + " -0 URLs are delimited by a nul\n" + , stderr); + exit (ex); +} + +int +main (int argc, char **argv) +{ + int last_argc = -1; + gpgme_error_t err; + gpgme_ctx_t ctx; + int url_mode = 0; + int nul_mode = 0; + gpgme_import_result_t impres; + gpgme_data_t data; + + if (argc) + { argc--; argv++; } + while (argc && last_argc != argc ) + { + last_argc = argc; + if (!strcmp (*argv, "--")) + { + argc--; argv++; + break; + } + else if (!strcmp (*argv, "--help")) + show_usage (0); + else if (!strcmp (*argv, "--verbose")) + { + verbose = 1; + argc--; argv++; + } + else if (!strcmp (*argv, "--url")) + { + url_mode = 1; + argc--; argv++; + } + else if (!strcmp (*argv, "-0")) + { + nul_mode = 1; + argc--; argv++; + } + else if (!strncmp (*argv, "--", 2)) + show_usage (1); + + } + + if (!argc) + show_usage (1); + + init_gpgme (GPGME_PROTOCOL_OpenPGP); + + err = gpgme_new (&ctx); + fail_if_err (err); + gpgme_set_protocol (ctx, GPGME_PROTOCOL_OpenPGP); + + for (; argc; argc--, argv++) + { + printf ("reading file `%s'\n", *argv); + err = gpgme_data_new_from_file (&data, *argv, 1); + fail_if_err (err); + + if (url_mode) + gpgme_data_set_encoding (data, (nul_mode? GPGME_DATA_ENCODING_URL0 + : GPGME_DATA_ENCODING_URL)); + + err = gpgme_op_import (ctx, data); + fail_if_err (err); + impres = gpgme_op_import_result (ctx); + if (!impres) + { + fprintf (stderr, PGM ": no import result returned\n"); + exit (1); + } + print_import_result (impres); + + gpgme_data_release (data); + } + + gpgme_release (ctx); + return 0; +} diff -urpNP gpgme-1.1.8/tests/gpg/pgp-keylist.c gpgme-1.2.0/tests/gpg/pgp-keylist.c --- gpgme-1.1.8/tests/gpg/pgp-keylist.c 1970-01-01 00:00:00.000000000 +0000 +++ gpgme-1.2.0/tests/gpg/pgp-keylist.c 2009-06-17 12:36:08.000000000 +0000 @@ -0,0 +1,223 @@ +/* pgp-keylist.c - Helper to show a key listing. + Copyright (C) 2008, 2009 g10 Code GmbH + + This file is part of GPGME. + + GPGME is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2.1 of + the License, or (at your option) any later version. + + GPGME is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this program; if not, see . +*/ + +/* We need to include config.h so that we know whether we are building + with large file system (LFS) support. */ +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +#include + +#define PGM "pgp-keylist" + +#include "t-support.h" + + +static int verbose; + + +static int +show_usage (int ex) +{ + fputs ("usage: " PGM " [options] [USERID]\n\n" + "Options:\n" + " --verbose run in verbose mode\n" + " --local use GPGME_KEYLIST_MODE_LOCAL\n" + " --extern use GPGME_KEYLIST_MODE_EXTERN\n" + " --sigs use GPGME_KEYLIST_MODE_SIGS\n" + " --sig-notations use GPGME_KEYLIST_MODE_SIG_NOTATIONS\n" + " --ephemeral use GPGME_KEYLIST_MODE_EPHEMERAL\n" + " --validate use GPGME_KEYLIST_MODE_VALIDATE\n" + " --import import all keys\n" + , stderr); + exit (ex); +} + +int +main (int argc, char **argv) +{ + int last_argc = -1; + gpgme_error_t err; + gpgme_ctx_t ctx; + gpgme_keylist_mode_t mode = 0; + gpgme_key_t key; + gpgme_keylist_result_t result; + int import = 0; + gpgme_key_t keyarray[100]; + int keyidx = 0; + + if (argc) + { argc--; argv++; } + + while (argc && last_argc != argc ) + { + last_argc = argc; + if (!strcmp (*argv, "--")) + { + argc--; argv++; + break; + } + else if (!strcmp (*argv, "--help")) + show_usage (0); + else if (!strcmp (*argv, "--verbose")) + { + verbose = 1; + argc--; argv++; + } + else if (!strcmp (*argv, "--local")) + { + mode |= GPGME_KEYLIST_MODE_LOCAL; + argc--; argv++; + } + else if (!strcmp (*argv, "--extern")) + { + mode |= GPGME_KEYLIST_MODE_EXTERN; + argc--; argv++; + } + else if (!strcmp (*argv, "--sigs")) + { + mode |= GPGME_KEYLIST_MODE_SIGS; + argc--; argv++; + } + else if (!strcmp (*argv, "--sig-notations")) + { + mode |= GPGME_KEYLIST_MODE_SIG_NOTATIONS; + argc--; argv++; + } + else if (!strcmp (*argv, "--ephemeral")) + { + mode |= GPGME_KEYLIST_MODE_EPHEMERAL; + argc--; argv++; + } + else if (!strcmp (*argv, "--validate")) + { + mode |= GPGME_KEYLIST_MODE_VALIDATE; + argc--; argv++; + } + else if (!strcmp (*argv, "--import")) + { + import = 1; + argc--; argv++; + } + else if (!strncmp (*argv, "--", 2)) + show_usage (1); + + } + + if (argc > 1) + show_usage (1); + + init_gpgme (GPGME_PROTOCOL_OpenPGP); + + err = gpgme_new (&ctx); + fail_if_err (err); + gpgme_set_protocol (ctx, GPGME_PROTOCOL_OpenPGP); + + gpgme_set_keylist_mode (ctx, mode); + + err = gpgme_op_keylist_start (ctx, argc? argv[0]:NULL, 0); + fail_if_err (err); + + while (!(err = gpgme_op_keylist_next (ctx, &key))) + { + gpgme_user_id_t uid; + int nuids; + + + printf ("keyid : %s\n", key->subkeys?nonnull (key->subkeys->keyid):"?"); + printf ("fpr : %s\n", key->subkeys?nonnull (key->subkeys->fpr):"?"); + printf ("caps : %s%s%s%s\n", + key->can_encrypt? "e":"", + key->can_sign? "s":"", + key->can_certify? "c":"", + key->can_authenticate? "a":""); + printf ("flags :%s%s%s%s%s%s\n", + key->secret? " secret":"", + key->revoked? " revoked":"", + key->expired? " expired":"", + key->disabled? " disabled":"", + key->invalid? " invalid":"", + key->is_qualified? " qualifid":""); + for (nuids=0, uid=key->uids; uid; uid = uid->next, nuids++) + { + printf ("userid %d: %s\n", nuids, nonnull(uid->uid)); + printf ("valid %d: %s\n", nuids, + uid->validity == GPGME_VALIDITY_UNKNOWN? "unknown": + uid->validity == GPGME_VALIDITY_UNDEFINED? "undefined": + uid->validity == GPGME_VALIDITY_NEVER? "never": + uid->validity == GPGME_VALIDITY_MARGINAL? "marginal": + uid->validity == GPGME_VALIDITY_FULL? "full": + uid->validity == GPGME_VALIDITY_ULTIMATE? "ultimate": "[?]"); + } + + putchar ('\n'); + + if (import) + { + if (keyidx < DIM (keyarray)-1) + keyarray[keyidx++] = key; + else + { + fprintf (stderr, PGM": too many keys in import mode" + "- skipping this key\n"); + gpgme_key_unref (key); + } + } + else + gpgme_key_unref (key); + } + if (gpg_err_code (err) != GPG_ERR_EOF) + fail_if_err (err); + err = gpgme_op_keylist_end (ctx); + fail_if_err (err); + keyarray[keyidx] = NULL; + + result = gpgme_op_keylist_result (ctx); + if (result->truncated) + { + fprintf (stderr, PGM ": key listing unexpectedly truncated\n"); + exit (1); + } + + if (import) + { + gpgme_import_result_t impres; + + err = gpgme_op_import_keys (ctx, keyarray); + fail_if_err (err); + impres = gpgme_op_import_result (ctx); + if (!impres) + { + fprintf (stderr, PGM ": no import result returned\n"); + exit (1); + } + print_import_result (impres); + } + + for (keyidx=0; keyarray[keyidx]; keyidx++) + gpgme_key_unref (keyarray[keyidx]); + + gpgme_release (ctx); + return 0; +} diff -urpNP gpgme-1.1.8/tests/gpg/t-edit.c gpgme-1.2.0/tests/gpg/t-edit.c --- gpgme-1.1.8/tests/gpg/t-edit.c 2005-09-08 14:42:32.000000000 +0000 +++ gpgme-1.2.0/tests/gpg/t-edit.c 2009-06-15 11:59:37.000000000 +0000 @@ -103,8 +103,8 @@ edit_fnc (void *opaque, gpgme_status_cod if (result) { - write (fd, result, strlen (result)); - write (fd, "\n", 1); + gpgme_io_write (fd, result, strlen (result)); + gpgme_io_write (fd, "\n", 1); } return 0; } diff -urpNP gpgme-1.1.8/tests/gpg/t-export.c gpgme-1.2.0/tests/gpg/t-export.c --- gpgme-1.1.8/tests/gpg/t-export.c 2005-09-08 14:42:32.000000000 +0000 +++ gpgme-1.2.0/tests/gpg/t-export.c 2009-06-17 12:36:08.000000000 +0000 @@ -42,6 +42,7 @@ main (int argc, char **argv) gpgme_error_t err; gpgme_data_t out; const char *pattern[] = { "Alpha", "Bob", NULL }; + gpgme_key_t keyarray[3]; init_gpgme (GPGME_PROTOCOL_OpenPGP); @@ -61,6 +62,32 @@ main (int argc, char **argv) fputs ("End Result.\n", stdout); gpgme_data_release (out); + + /* Again. Now using a key array. */ + err = gpgme_data_new (&out); + fail_if_err (err); + + err = gpgme_get_key (ctx, "0x68697734" /* Alpha */, keyarray+0, 0); + fail_if_err (err); + err = gpgme_get_key (ctx, "0xA9E3B0B2" /* Bob */, keyarray+1, 0); + fail_if_err (err); + keyarray[2] = NULL; + + gpgme_set_armor (ctx, 1); + err = gpgme_op_export_keys (ctx, keyarray, 0, out); + fail_if_err (err); + + gpgme_key_unref (keyarray[0]); + gpgme_key_unref (keyarray[1]); + + fflush (NULL); + fputs ("Begin Result:\n", stdout); + print_data (out); + fputs ("End Result.\n", stdout); + + gpgme_data_release (out); + + gpgme_release (ctx); return 0; diff -urpNP gpgme-1.1.8/tests/gpg/t-keylist.c gpgme-1.2.0/tests/gpg/t-keylist.c --- gpgme-1.1.8/tests/gpg/t-keylist.c 2005-12-18 15:18:05.000000000 +0000 +++ gpgme-1.2.0/tests/gpg/t-keylist.c 2009-02-17 18:03:58.000000000 +0000 @@ -270,6 +270,16 @@ main (int argc, char **argv) fprintf (stderr, "Primary key unexpectedly secret\n"); exit (1); } + if (key->subkeys->is_cardkey) + { + fprintf (stderr, "Public key marked as card key\n"); + exit (1); + } + if (key->subkeys->card_number) + { + fprintf (stderr, "Public key with card number set\n"); + exit (1); + } if (key->subkeys->pubkey_algo != GPGME_PK_DSA) { fprintf (stderr, "Primary key has unexpected public key algo: %s\n", @@ -342,6 +352,16 @@ main (int argc, char **argv) fprintf (stderr, "Secondary key unexpectedly secret\n"); exit (1); } + if (key->subkeys->next->is_cardkey) + { + fprintf (stderr, "Secondary public key marked as card key\n"); + exit (1); + } + if (key->subkeys->next->card_number) + { + fprintf (stderr, "Secondary public key with card number set\n"); + exit (1); + } if (key->subkeys->next->pubkey_algo != GPGME_PK_ELG_E) { fprintf (stderr, "Secondary key has unexpected public key algo: %s\n", diff -urpNP gpgme-1.1.8/tests/gpg/t-support.h gpgme-1.2.0/tests/gpg/t-support.h --- gpgme-1.1.8/tests/gpg/t-support.h 2007-09-27 13:00:05.000000000 +0000 +++ gpgme-1.2.0/tests/gpg/t-support.h 2009-06-17 12:36:08.000000000 +0000 @@ -48,6 +48,13 @@ while (0) +static const char * +nonnull (const char *s) +{ + return s? s :"[none]"; +} + + void print_data (gpgme_data_t dh) { @@ -113,3 +120,57 @@ init_gpgme (gpgme_protocol_t proto) err = gpgme_engine_check_version (proto); fail_if_err (err); } + + +void +print_import_result (gpgme_import_result_t r) +{ + gpgme_import_status_t st; + + for (st=r->imports; st; st = st->next) + { + printf (" fpr: %s err: %d (%s) status:", nonnull (st->fpr), + st->result, gpg_strerror (st->result)); + if (st->status & GPGME_IMPORT_NEW) + fputs (" new", stdout); + if (st->status & GPGME_IMPORT_UID) + fputs (" uid", stdout); + if (st->status & GPGME_IMPORT_SIG) + fputs (" sig", stdout); + if (st->status & GPGME_IMPORT_SUBKEY) + fputs (" subkey", stdout); + if (st->status & GPGME_IMPORT_SECRET) + fputs (" secret", stdout); + putchar ('\n'); + } + printf ("key import summary:\n" + " considered: %d\n" + " no user id: %d\n" + " imported: %d\n" + " imported_rsa: %d\n" + " unchanged: %d\n" + " new user ids: %d\n" + " new subkeys: %d\n" + " new signatures: %d\n" + " new revocations: %d\n" + " secret read: %d\n" + " secret imported: %d\n" + " secret unchanged: %d\n" + " skipped new keys: %d\n" + " not imported: %d\n", + r->considered, + r->no_user_id, + r->imported, + r->imported_rsa, + r->unchanged, + r->new_user_ids, + r->new_sub_keys, + r->new_signatures, + r->new_revocations, + r->secret_read, + r->secret_imported, + r->secret_unchanged, + r->skipped_new_keys, + r->not_imported); +} + diff -urpNP gpgme-1.1.8/tests/gpgsm/Makefile.in gpgme-1.2.0/tests/gpgsm/Makefile.in --- gpgme-1.1.8/tests/gpgsm/Makefile.in 2008-12-08 18:41:52.000000000 +0000 +++ gpgme-1.2.0/tests/gpgsm/Makefile.in 2009-06-18 16:13:41.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -202,6 +202,7 @@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ +NEED__FILE_OFFSET_BITS = @NEED__FILE_OFFSET_BITS@ NETLIBS = @NETLIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ @@ -274,6 +275,7 @@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ TESTS_ENVIRONMENT = GNUPGHOME=$(abs_builddir) GPG_AGENT_INFO= @@ -296,8 +298,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_ @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -408,7 +410,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS @@ -451,7 +453,7 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) - @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \ + @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ if test -n "$$list"; then \ @@ -462,7 +464,7 @@ check-TESTS: $(TESTS) if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ - *$$ws$$tst$$ws*) \ + *[\ \ ]$$tst[\ \ ]*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ echo "XPASS: $$tst"; \ @@ -474,7 +476,7 @@ check-TESTS: $(TESTS) elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ - *$$ws$$tst$$ws*) \ + *[\ \ ]$$tst[\ \ ]*) \ xfail=`expr $$xfail + 1`; \ echo "XFAIL: $$tst"; \ ;; \ @@ -488,23 +490,36 @@ check-TESTS: $(TESTS) echo "SKIP: $$tst"; \ fi; \ done; \ + if test "$$all" -eq 1; then \ + tests="test"; \ + All=""; \ + else \ + tests="tests"; \ + All="All "; \ + fi; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ - banner="All $$all tests passed"; \ + banner="$$All$$all $$tests passed"; \ else \ - banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ + banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ - banner="$$failed of $$all tests failed"; \ + banner="$$failed of $$all $$tests failed"; \ else \ - banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ + banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ - skipped="($$skip tests were not run)"; \ + if test "$$skip" -eq 1; then \ + skipped="($$skip test was not run)"; \ + else \ + skipped="($$skip tests were not run)"; \ + fi; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ diff -urpNP gpgme-1.1.8/tests/opassuan/Makefile.am gpgme-1.2.0/tests/opassuan/Makefile.am --- gpgme-1.1.8/tests/opassuan/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ gpgme-1.2.0/tests/opassuan/Makefile.am 2009-01-26 14:15:26.000000000 +0000 @@ -0,0 +1,35 @@ +# Copyright (C) 2009 g10 Code GmbH +# +# This file is part of GPGME. +# +# GPGME is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation; either version 2.1 of the +# License, or (at your option) any later version. +# +# GPGME is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General +# Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, see . + +## Process this file with automake to produce Makefile.in + +TESTS_ENVIRONMENT = GNUPGHOME=$(abs_builddir) GPG_AGENT_INFO= + +noinst_HEADERS = +TESTS = + +EXTRA_DIST = + +INCLUDES = -I$(top_builddir)/src + +AM_CPPFLAGS = @GPG_ERROR_CFLAGS@ +LDADD = ../../src/libgpgme.la + +noinst_PROGRAMS = $(TESTS) t-command + +DISTCLEANFILES = + diff -urpNP gpgme-1.1.8/tests/opassuan/Makefile.in gpgme-1.2.0/tests/opassuan/Makefile.in --- gpgme-1.1.8/tests/opassuan/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ gpgme-1.2.0/tests/opassuan/Makefile.in 2009-06-18 16:13:41.000000000 +0000 @@ -0,0 +1,586 @@ +# Makefile.in generated by automake 1.10.2 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Copyright (C) 2009 g10 Code GmbH +# +# This file is part of GPGME. +# +# GPGME is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation; either version 2.1 of the +# License, or (at your option) any later version. +# +# GPGME is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General +# Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, see . + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +TESTS = +noinst_PROGRAMS = $(am__EXEEXT_1) t-command$(EXEEXT) +subdir = tests/opassuan +DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/glib-2.0.m4 \ + $(top_srcdir)/m4/glibc21.m4 $(top_srcdir)/m4/gpg-error.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/pth.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__EXEEXT_1 = +PROGRAMS = $(noinst_PROGRAMS) +t_command_SOURCES = t-command.c +t_command_OBJECTS = t-command.$(OBJEXT) +t_command_LDADD = $(LDADD) +t_command_DEPENDENCIES = ../../src/libgpgme.la +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = t-command.c +DIST_SOURCES = t-command.c +HEADERS = $(noinst_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILD_FILEVERSION = @BUILD_FILEVERSION@ +BUILD_REVISION = @BUILD_REVISION@ +BUILD_TIMESTAMP = @BUILD_TIMESTAMP@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GLIBC21 = @GLIBC21@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GPG = @GPG@ +GPGCONF = @GPGCONF@ +GPGME_CONFIG_API_VERSION = @GPGME_CONFIG_API_VERSION@ +GPGME_CONFIG_CFLAGS = @GPGME_CONFIG_CFLAGS@ +GPGME_CONFIG_LIBS = @GPGME_CONFIG_LIBS@ +GPGSM = @GPGSM@ +GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@ +GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@ +GPG_ERROR_LIBS = @GPG_ERROR_LIBS@ +GPG_PATH = @GPG_PATH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBGPGME_LT_AGE = @LIBGPGME_LT_AGE@ +LIBGPGME_LT_CURRENT = @LIBGPGME_LT_CURRENT@ +LIBGPGME_LT_REVISION = @LIBGPGME_LT_REVISION@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NEED__FILE_OFFSET_BITS = @NEED__FILE_OFFSET_BITS@ +NETLIBS = @NETLIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PTH_CFLAGS = @PTH_CFLAGS@ +PTH_CPPFLAGS = @PTH_CPPFLAGS@ +PTH_LDFLAGS = @PTH_LDFLAGS@ +PTH_LIBS = @PTH_LIBS@ +QT4_CORE_CFLAGS = @QT4_CORE_CFLAGS@ +QT4_CORE_LIBS = @QT4_CORE_LIBS@ +RANLIB = @RANLIB@ +RC = @RC@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +TESTS_ENVIRONMENT = GNUPGHOME=$(abs_builddir) GPG_AGENT_INFO= +noinst_HEADERS = +EXTRA_DIST = +INCLUDES = -I$(top_builddir)/src +AM_CPPFLAGS = @GPG_ERROR_CFLAGS@ +LDADD = ../../src/libgpgme.la +DISTCLEANFILES = +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/opassuan/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/opassuan/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +t-command$(EXEEXT): $(t_command_OBJECTS) $(t_command_DEPENDENCIES) + @rm -f t-command$(EXEEXT) + $(LINK) $(t_command_OBJECTS) $(t_command_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-command.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; skip=0; \ + srcdir=$(srcdir); export srcdir; \ + list=' $(TESTS) '; \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$tst[\ \ ]*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + echo "XPASS: $$tst"; \ + ;; \ + *) \ + echo "PASS: $$tst"; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$tst[\ \ ]*) \ + xfail=`expr $$xfail + 1`; \ + echo "XFAIL: $$tst"; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + ;; \ + esac; \ + else \ + skip=`expr $$skip + 1`; \ + echo "SKIP: $$tst"; \ + fi; \ + done; \ + if test "$$all" -eq 1; then \ + tests="test"; \ + All=""; \ + else \ + tests="tests"; \ + All="All "; \ + fi; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="$$All$$all $$tests passed"; \ + else \ + if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ + banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all $$tests failed"; \ + else \ + if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ + banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ + fi; \ + fi; \ + dashes="$$banner"; \ + skipped=""; \ + if test "$$skip" -ne 0; then \ + if test "$$skip" -eq 1; then \ + skipped="($$skip test was not run)"; \ + else \ + skipped="($$skip tests were not run)"; \ + fi; \ + test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$skipped"; \ + fi; \ + report=""; \ + if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ + report="Please report to $(PACKAGE_BUGREPORT)"; \ + test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$report"; \ + fi; \ + dashes=`echo "$$dashes" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + test -z "$$skipped" || echo "$$skipped"; \ + test -z "$$report" || echo "$$report"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0; \ + else :; fi + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile $(PROGRAMS) $(HEADERS) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ + clean-generic clean-libtool clean-noinstPROGRAMS ctags \ + distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -urpNP gpgme-1.1.8/tests/opassuan/t-command.c gpgme-1.2.0/tests/opassuan/t-command.c --- gpgme-1.1.8/tests/opassuan/t-command.c 1970-01-01 00:00:00.000000000 +0000 +++ gpgme-1.2.0/tests/opassuan/t-command.c 2009-02-27 14:26:28.000000000 +0000 @@ -0,0 +1,145 @@ +/* t-command.c - Regression test. + Copyright (C) 2009 g10 Code GmbH + + This file is part of GPGME. + + GPGME is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2.1 of + the License, or (at your option) any later version. + + GPGME is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this program; if not, see . + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include + +#include + +#define fail_if_err(err) \ + do \ + { \ + if (err) \ + { \ + fprintf (stderr, "%s:%d: %s: %s (%d.%d)\n", \ + __FILE__, __LINE__, gpg_strsource (err), \ + gpg_strerror (err), \ + gpg_err_source (err), gpg_err_code (err)); \ + exit (1); \ + } \ + } \ + while (0) + + +static gpg_error_t +data_cb (void *opaque, const void *data, size_t datalen) +{ + printf ("DATA_CB: datalen=%d\n", (int)datalen); + return 0; +} + + +static gpg_error_t +inq_cb (void *opaque, const char *name, const char *args, + gpgme_data_t *r_data) +{ + gpgme_data_t data; + gpg_error_t err; + + if (name) + { + printf ("INQ_CB: name=`%s' args=`%s'\n", name, args); + /* There shall be no data object. */ + assert (!*r_data); + + err = gpgme_data_new (&data); + fail_if_err (err); + *r_data = data; + printf (" sending data object %p\n", data); + } + else /* Finished using the formerly returned data object. */ + { + printf ("INQ_CB: data object %p finished\n", *r_data); + /* There shall be a data object so that it can be cleaned up. */ + assert (r_data); + + gpgme_data_release (*r_data); + } + + /* Uncomment the next lines and send a "SCD LEARN" to test sending + cancel from in inquiry. */ + /* if (name && !strcmp (name, "KNOWNCARDP")) */ + /* return gpg_error (GPG_ERR_ASS_CANCELED); */ + + + return 0; +} + + +static gpg_error_t +status_cb (void *opaque, const char *status, const char *args) +{ + printf ("STATUS_CB: status=`%s' args=`%s'\n", status, args); + return 0; +} + + + +int +main (int argc, char **argv) +{ + gpgme_error_t err; + gpgme_ctx_t ctx; + const char *command; + + gpgme_check_version (NULL); +#ifndef HAVE_W32_SYSTEM + setlocale (LC_ALL, ""); + gpgme_set_locale (NULL, LC_CTYPE, setlocale (LC_CTYPE, NULL)); + gpgme_set_locale (NULL, LC_MESSAGES, setlocale (LC_MESSAGES, NULL)); +#endif + + if (argc) + { + argc--; + argv++; + } + command = argc? *argv : "NOP"; + + + err = gpgme_new (&ctx); + fail_if_err (err); + + err = gpgme_set_protocol (ctx, GPGME_PROTOCOL_ASSUAN); + fail_if_err (err); + + err = gpgme_op_assuan_transact (ctx, command, + data_cb, NULL, + inq_cb, NULL, + status_cb, NULL); + fail_if_err (err); + err = gpgme_op_assuan_result (ctx)->err; + if (err) + fprintf (stderr, "assuan command `%s' failed: %s <%s> (%d)\n", + command, gpg_strerror (err), gpg_strsource (err), err); + else + fprintf (stderr, "assuan command `%s' succeeded\n", command); + + + gpgme_release (ctx); + + return 0; +} + -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12-svn5024 (GNU/Linux) iJwEAQECAAYFAko6a84ACgkQ+4hivfzSopMVyQP/YhoYOeopCz1tRhS/qHdF5C5U X7MsWrfOZYaFhZKVWrt9pUEilB0mrfiNpH8X2G3Qv1MafjXUPo49GG5mN4CrPMFB B++Vix66ppkthTj3nfC4DvV+sXr/vCEhcmR4jYKRbAPYGYK4JZx5gg7IiFz1HMm/ FlZ/QfJ81re9xeDmrz8= =l3Hi -----END PGP SIGNATURE-----