[git] GPGME - branch, master, updated. gpgme-1.3.2-22-gc97d067

by Werner Koch cvs at cvs.gnupg.org
Wed Oct 24 18:18:43 CEST 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG Made Easy".

The branch, master has been updated
       via  c97d067f27899d890a99036fcbed9263f4f68875 (commit)
       via  12a0c93433a0b1d7e8019fc35a63476db39327fa (commit)
       via  cc59b75b21516198b39a56950afbcec140d8ba48 (commit)
      from  bd24feaa86f8154e550107990392ac9ac05e60d4 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit c97d067f27899d890a99036fcbed9263f4f68875
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Oct 24 16:51:47 2012 +0200

    Make local variables configure hack more robust
    
    * configure.ac (emacs_local_vars_begin): Use extra m4 quoting so that
    newer Emscasen won't take it up as Local Variables for this file.

diff --git a/configure.ac b/configure.ac
index 8f6505e..c5300e3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -925,7 +925,7 @@ AC_CHECK_TYPES([error_t], [],
 
 
 # A substitution to set generated files in a Emacs buffer to read-only.
-AC_SUBST(emacs_local_vars_begin, ['Local Variables:'])
+AC_SUBST(emacs_local_vars_begin, [['Local][ ][Variables:']])
 AC_SUBST(emacs_local_vars_read_only, ['buffer-read-only: t'])
 AC_SUBST(emacs_local_vars_end, ['End:'])
 

commit 12a0c93433a0b1d7e8019fc35a63476db39327fa
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Oct 24 16:44:34 2012 +0200

    Fix ttyname problem on Android.
    
    * configure.ac: Define macro and conditional HAVE_ANDROID_SYSTEM.
    * m4/gnupg-ttyname.m4: Force use of replacement on Android.
    * src/ttyname_r.c: Ditto.
    --
    
    Android's bionic lib has no working ttyname_r() nor ttyname().  Using
    them anyway will print
    
      FIX ME! implement ttyname_r() bionic/libc/bionic/stubs.c:466
    
    Thus we force the use of our replacement code which simply return
    "/dev/tty".

diff --git a/configure.ac b/configure.ac
index 3cac826..8f6505e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -131,6 +131,7 @@ GPGCONF_DEFAULT=no
 G13_DEFAULT=no
 component_system=None
 have_dosish_system=no
+have_android_system=no
 have_w32_system=no
 have_w64_system=no
 build_w32_glib=no
@@ -142,6 +143,9 @@ case "${host}" in
     *-mingw32ce*)
         have_w32ce_system=yes
 	;;
+    *-linux-androideabi)
+        have_android_system=yes
+        ;;
 esac
 case "${host}" in
     *-mingw32ce*|*-mingw32*)
@@ -210,6 +214,11 @@ if test "$have_w32ce_system" = yes; then
 fi
 AM_CONDITIONAL(HAVE_W32CE_SYSTEM, test "$have_w32ce_system" = yes)
 
+if test "$have_android_system" = yes; then
+   AC_DEFINE(HAVE_ANDROID_SYSTEM,1, [Defined if we build for an Android system])
+fi
+AM_CONDITIONAL(HAVE_ANDROID_SYSTEM, test "$have_android_system" = yes)
+
 AM_CONDITIONAL(BUILD_W32_GLIB, test "$build_w32_glib" = yes)
 AM_CONDITIONAL(BUILD_W32_QT, test "$build_w32_qt" = yes)
 
diff --git a/m4/gnupg-ttyname.m4 b/m4/gnupg-ttyname.m4
index d9a0e2e..c76115a 100644
--- a/m4/gnupg-ttyname.m4
+++ b/m4/gnupg-ttyname.m4
@@ -27,6 +27,9 @@
 # The macro REPLACE_TTYNAME_R is defined if ttyname_r is a replacement
 # function.  This macro is useful for the definition of the prototype.
 #
+# If the macro "have_android_system" has a value of "yes", ttyname_r
+# will also be replaced by our own function.
+#
 AC_DEFUN([gnupg_REPLACE_TTYNAME_R],
 [
   AC_CHECK_HEADERS([unistd.h])
@@ -60,6 +63,12 @@ AC_DEFUN([gnupg_REPLACE_TTYNAME_R],
     if test $gnupg_cv_func_ttyname_r_posix = no; then
       AC_LIBOBJ([ttyname_r])
       AC_DEFINE([REPLACE_TTYNAME_R],[1])
+    elif test "$have_android_system" = yes; then
+      # Android has ttyname and ttyname_r but they are only stubs and
+      # print an annoying warning message.  Thus we need to replace
+      # ttyname_r with our own dummy function.
+      AC_LIBOBJ([ttyname_r])
+      AC_DEFINE([REPLACE_TTYNAME_R],[1])
     else
       AC_DEFINE([HAVE_POSIXDECL_TTYNAME_R], [1],
         [Define if the ttyname_r function has a POSIX compliant declaration.])
diff --git a/src/ttyname_r.c b/src/ttyname_r.c
index 105e0af..eed28bd 100644
--- a/src/ttyname_r.c
+++ b/src/ttyname_r.c
@@ -32,6 +32,12 @@
 # warning ttyname is not thread-safe, and ttyname_r is missing
 #endif
 
+/* For Android we force the use of our replacement code.  */
+#if HAVE_ANDROID_SYSTEM
+# undef HAVE_TTYNAME_R
+#endif
+
+
 int
 _gpgme_ttyname_r (int fd, char *buf, size_t buflen)
 {
@@ -110,12 +116,11 @@ _gpgme_ttyname_r (int fd, char *buf, size_t buflen)
 #else /*!HAVE_TTYNAME_R*/
   char *tty;
 
-# if HAVE_W32_SYSTEM
+# if HAVE_W32_SYSTEM || HAVE_ANDROID_SYSTEM
   /* We use this default one for now.  AFAICS we only need it to be
      passed to gpg and in turn to pinentry.  Providing a replacement
-     is needed because elsewhere we bail out on error.  If we
-     eventually implement a pinentry for Windows it is inlikely that
-     we need a real tty at all.  */
+     is needed because elsewhere we bail out on error or Android
+     provided ttyname_r prints an error message if used. */
   tty = "/dev/tty";
 # else
   tty = ttyname (fd);

commit cc59b75b21516198b39a56950afbcec140d8ba48
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Oct 24 16:07:31 2012 +0200

    tests: Adhere to the docs and call gpgme_check_version.
    
    * tests/t-engine-info.c: Call gpgme_check_version.

diff --git a/tests/t-engine-info.c b/tests/t-engine-info.c
index beb4992..ec2e1e8 100644
--- a/tests/t-engine-info.c
+++ b/tests/t-engine-info.c
@@ -73,6 +73,7 @@ main (int argc, char **argv )
   gpgme_engine_info_t info;
   gpgme_error_t err;
 
+  gpgme_check_version (NULL);
   err = gpgme_get_engine_info (&info);
   fail_if_err (err);
 

-----------------------------------------------------------------------

Summary of changes:
 configure.ac          |   11 ++++++++++-
 m4/gnupg-ttyname.m4   |    9 +++++++++
 src/ttyname_r.c       |   13 +++++++++----
 tests/t-engine-info.c |    1 +
 4 files changed, 29 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
GnuPG Made Easy
http://git.gnupg.org




More information about the Gnupg-commits mailing list