gpgme (16 files)

cvs user wk cvs at cvs.gnupg.org
Wed Mar 9 16:50:21 CET 2005


    Date: Wednesday, March 9, 2005 @ 17:03:05
  Author: wk
    Path: /cvs/gpgme/gpgme

Modified: ChangeLog Makefile.am acinclude.m4 autogen.sh complus/gpgcom.c
          configure.ac gpgme/ChangeLog gpgme/ath-compat.c gpgme/ath.h
          gpgme/data-compat.c gpgme/data.c gpgme/engine-gpgsm.c
          gpgme/gpgme.c gpgme/gpgme.h gpgme/io.h gpgme/w32-util.c

* acinclude.m4 (GNUPG_CHECK_VA_COPY): Assume no when cross-compiling.

* Makefile.am (EXTRA_DIST): Include autogen.sh

* autogen.sh: Added the usual code to build for W32 (--build-w32).

* configure.ac: Fixed the mingw32 host string, removed OS/2 stuff.
(HAVE_DRIVE_LETTERS): Removed.
(HAVE_W32_SYSTEM): Added.
(AC_GNU_SOURCE): New to replace the identical AH_VERBATIM.
(AH_BOTTOM): Added.

* w32-util.c (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path): Do not
cast away type checks.

* io.h [W32]: Do not include stdio.h.  If it is needed do it at
the right place.

* data.h [W32]: Removed kludge for EOPNOTSUP.
* data.c, data-compat.c [W32]: Explicitly test for it here.


----------------------+
 ChangeLog            |   16 +++++++++++++-
 Makefile.am          |    2 -
 acinclude.m4         |   16 ++++++++++----
 autogen.sh           |   56 +++++++++++++++++++++++++++++++++++++++++++++++++
 complus/gpgcom.c     |    2 -
 configure.ac         |   50 ++++++++++++++++++++++++++++---------------
 gpgme/ChangeLog      |   14 ++++++++++++
 gpgme/ath-compat.c   |    7 +++---
 gpgme/ath.h          |   14 +++++++-----
 gpgme/data-compat.c  |    5 ++++
 gpgme/data.c         |    5 ++++
 gpgme/engine-gpgsm.c |    6 +++--
 gpgme/gpgme.c        |    5 ++--
 gpgme/gpgme.h        |    3 +-
 gpgme/io.h           |    3 --
 gpgme/w32-util.c     |    8 +++++--
 16 files changed, 170 insertions(+), 42 deletions(-)


Index: gpgme/ChangeLog
diff -u gpgme/ChangeLog:1.111 gpgme/ChangeLog:1.112
--- gpgme/ChangeLog:1.111	Wed Jan 12 11:28:42 2005
+++ gpgme/ChangeLog	Wed Mar  9 17:03:05 2005
@@ -1,3 +1,17 @@
+2005-03-09  Werner Koch  <wk at g10code.com>
+
+	* acinclude.m4 (GNUPG_CHECK_VA_COPY): Assume no when cross-compiling.
+
+	* Makefile.am (EXTRA_DIST): Include autogen.sh
+
+	* autogen.sh: Added the usual code to build for W32 (--build-w32).
+
+	* configure.ac: Fixed the mingw32 host string, removed OS/2 stuff.
+	(HAVE_DRIVE_LETTERS): Removed.
+	(HAVE_W32_SYSTEM): Added.
+	(AC_GNU_SOURCE): New to replace the identical AH_VERBATIM.
+	(AH_BOTTOM): Added.
+
 2004-12-28  Werner Koch  <wk at g10code.com>
 
 	Released 1.0.2.
@@ -564,7 +578,7 @@
 	* autogen.sh: Added option --build-w32.
 
 
- Copyright 2001, 2002, 2003, 2004 g10 Code GmbH
+ Copyright 2001, 2002, 2003, 2004, 2005 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
Index: gpgme/Makefile.am
diff -u gpgme/Makefile.am:1.19 gpgme/Makefile.am:1.20
--- gpgme/Makefile.am:1.19	Wed Jan 12 11:28:42 2005
+++ gpgme/Makefile.am	Wed Mar  9 17:03:05 2005
@@ -23,7 +23,7 @@
 ACLOCAL_AMFLAGS = -I m4
 AUTOMAKE_OPTIONS = dist-bzip2
 
-EXTRA_DIST = gpgme.spec.in
+EXTRA_DIST = gpgme.spec.in autogen.sh 
 
 if BUILD_ASSUAN
 assuan = assuan
Index: gpgme/acinclude.m4
diff -u gpgme/acinclude.m4:1.14 gpgme/acinclude.m4:1.15
--- gpgme/acinclude.m4:1.14	Wed Jan 12 11:28:42 2005
+++ gpgme/acinclude.m4	Wed Mar  9 17:03:05 2005
@@ -50,8 +50,11 @@
 AC_DEFUN([GNUPG_CHECK_VA_COPY],
 [ AC_MSG_CHECKING(whether va_lists must be copied by value)
   AC_CACHE_VAL(gnupg_cv_must_copy_va_byval,[
-    gnupg_cv_must_copy_va_byval=no
-    AC_TRY_RUN([
+    if test "$cross_compiling" = yes; then
+      gnupg_cv_must_copy_va_byval=no
+    else
+      gnupg_cv_must_copy_va_byval=no
+      AC_TRY_RUN([
        #include <stdarg.h>
        void f (int i, ...)
        {
@@ -69,10 +72,15 @@
           f (0, 42);
             return 0;
        }
-    ],gnupg_cv_must_copy_va_byval=yes)
+      ],gnupg_cv_must_copy_va_byval=yes)
+    fi
   ])
   if test "$gnupg_cv_must_copy_va_byval" = yes; then
      AC_DEFINE(MUST_COPY_VA_BYVAL,1,[used to implement the va_copy macro])
   fi
-  AC_MSG_RESULT($gnupg_cv_must_copy_va_byval)
+  if test "$cross_compiling" = yes; then
+    AC_MSG_RESULT(assuming $gnupg_cv_must_copy_va_byval)
+  else
+    AC_MSG_RESULT($gnupg_cv_must_copy_va_byval)
+  fi
 ])
Index: gpgme/autogen.sh
diff -u gpgme/autogen.sh:1.14 gpgme/autogen.sh:1.15
--- gpgme/autogen.sh:1.14	Mon Apr 19 16:09:29 2004
+++ gpgme/autogen.sh	Wed Mar  9 17:03:05 2005
@@ -29,6 +29,62 @@
 }
 
 
+DIE=no
+
+# Used to cross-compile for Windows.
+if test "$1" = "--build-w32"; then
+    tmp=`dirname $0`
+    tsdir=`cd "$tmp"; pwd`
+    shift
+    if [ ! -f $tsdir/config.guess ]; then
+        echo "$tsdir/config.guess not found" >&2
+        exit 1
+    fi
+    build=`$tsdir/config.guess`
+
+    [ -z "$w32root" ] && w32root="$HOME/w32root"
+    echo "Using $w32root as standard install directory" >&2
+    
+    # See whether we have the Debian cross compiler package or the
+    # old mingw32/cpd system
+    if i586-mingw32msvc-gcc --version >/dev/null 2>&1 ; then
+        host=i586-mingw32msvc
+        crossbindir=/usr/$host/bin
+    else
+       host=i386--mingw32
+       if ! mingw32 --version >/dev/null; then
+          echo "We need at least version 0.3 of MingW32/CPD" >&2
+          exit 1
+       fi
+       crossbindir=`mingw32 --install-dir`/bin
+       # Old autoconf version required us to setup the environment
+       # with the proper tool names.
+       CC=`mingw32 --get-path gcc`
+       CPP=`mingw32 --get-path cpp`
+       AR=`mingw32 --get-path ar`
+       RANLIB=`mingw32 --get-path ranlib`
+       export CC CPP AR RANLIB 
+    fi
+   
+    if [ -f "$tsdir/config.log" ]; then
+        if ! head $tsdir/config.log | grep "$host" >/dev/null; then
+            echo "Pease run a 'make distclean' first" >&2
+            exit 1
+        fi
+    fi
+
+    ./configure --enable-maintainer-mode  --prefix=${w32root}  \
+            --host=i586-mingw32msvc --build=${build} \
+            --with-gpg-error-prefix=${w32root}  \
+            --disable-shared --with-gpgsm=c:/gnupg/gpgsm.exe
+
+    exit $?
+fi
+
+
+
+
+
 # Grep the required versions from configure.ac
 autoconf_vers=`sed -n '/^AC_PREREQ(/ { 
 s/^.*(\(.*\))/\1/p
Index: gpgme/complus/gpgcom.c
diff -u gpgme/complus/gpgcom.c:1.2 gpgme/complus/gpgcom.c:1.3
--- gpgme/complus/gpgcom.c:1.2	Tue Jul 31 11:44:22 2001
+++ gpgme/complus/gpgcom.c	Wed Mar  9 17:03:04 2005
@@ -123,7 +123,7 @@
 
     opt.homedir = getenv("GNUPGHOME");
     if( !opt.homedir || !*opt.homedir ) {
-      #ifdef HAVE_DRIVE_LETTERS
+      #ifdef HAVE_DOSISH_SYSTEM
 	opt.homedir = "c:/gnupg";
       #else
 	opt.homedir = "~/.gnupg";
Index: gpgme/configure.ac
diff -u gpgme/configure.ac:1.96 gpgme/configure.ac:1.97
--- gpgme/configure.ac:1.96	Wed Jan 12 11:28:42 2005
+++ gpgme/configure.ac	Wed Mar  9 17:03:05 2005
@@ -1,6 +1,6 @@
 # configure.ac for GPGME
 # Copyright (C) 2000 Werner Koch (dd9jn)
-# Copyright (C) 2001, 2002, 2003, 2004 g10 Code GmbH
+# Copyright (C) 2001, 2002, 2003, 2004, 2005 g10 Code GmbH
 # 
 # This file is part of GPGME.
 # 
@@ -43,8 +43,7 @@
 NEED_GPG_VERSION=1.2.2
 NEED_GPGSM_VERSION=1.9.6
 ##############################################
-AC_PREREQ(2.52)
-AC_REVISION($Revision: 1.96 $)
+
 
 PACKAGE=$PACKAGE_NAME
 VERSION=$PACKAGE_VERSION
@@ -57,11 +56,8 @@
 AM_MAINTAINER_MODE
 AC_CANONICAL_HOST
 
-AH_VERBATIM([_GNU_SOURCE],
-[/* Enable GNU extensions on systems that have them.  */
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE
-#endif])
+# Enable GNU extensions on systems that have them.
+AC_GNU_SOURCE
 
 AH_VERBATIM([_REENTRANT],
 [/* To allow the use of GPGME in multithreaded programs we have to use
@@ -72,6 +68,16 @@
 # define _REENTRANT 1
 #endif])
 
+AH_BOTTOM([
+/* Some environments miss the definition for EOPNOTSUPP.  We provide
+   the error code here and test where neded whether it should be
+   defined.  Can't do the test here due to the order of includes.  */
+#ifdef HAVE_W32_SYSTEM
+#define VALUE_FOR_EOPNOTSUPP 95
+#endif /*!HAVE_W32_SYSTEM*/
+
+])
+
 
 AC_PROG_CC
 
@@ -109,17 +115,13 @@
 GPG_DEFAULT=no
 GPGSM_DEFAULT=no
 component_system=None
+have_dosish_system=no
+have_w32_system=no
 case "${host}" in
-    *-*-mingw32* | i?86-emx-os2 | i?86-*-os2*emx | i?86-*-msdosdjgpp* )
+    *-mingw32*)
         # special stuff for Windoze NT
-        # OS/2 with the EMX environment
-        # DOS with the DJGPP environment
-        AC_DEFINE(HAVE_DRIVE_LETTERS, ,
-		  [Defined if we run on some of the PCDOS like systems (DOS,
-		   Windoze, OS/2) with special properties like no file modes.])
-        AC_DEFINE(HAVE_DOSISH_SYSTEM, ,
-		  [Defined if the filesystem uses driver letters.])
 	have_dosish_system=yes
+        have_w32_system=yes
         GPG_DEFAULT='c:\\gnupg\\gpg.exe'
 	# XXX Assuan is not supported in this configuration.
 	#GPGSM_DEFAULT='c:\\gnupg\\gpgsm.exe'
@@ -141,7 +143,21 @@
 #	GPGSM_DEFAULT='/usr/bin/gpgsm'
 	;;
 esac
-AM_CONDITIONAL(HAVE_DOSISH_SYSTEM, test "$have_dosish_system" = "yes")
+
+if test "$have_dosish_system" = yes; then
+   AC_DEFINE(HAVE_DOSISH_SYSTEM,1,
+             [Defined if we run on some of the PCDOS like systems 
+              (DOS, Windoze. OS/2) with special properties like
+              no file modes])
+fi
+AM_CONDITIONAL(HAVE_DOSISH_SYSTEM, test "$have_dosish_system" = yes)
+
+if test "$have_w32_system" = yes; then
+   AC_DEFINE(HAVE_W32_SYSTEM,1, [Defined if we run on a W32 API based system])
+fi
+AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes)
+
+
 AM_CONDITIONAL(HAVE_PTH, test "$have_pth" = "yes")
 AM_CONDITIONAL(HAVE_PTHREAD, test "$have_pthread" = "yes")
 
Index: gpgme/gpgme/ChangeLog
diff -u gpgme/gpgme/ChangeLog:1.391 gpgme/gpgme/ChangeLog:1.392
--- gpgme/gpgme/ChangeLog:1.391	Wed Mar  9 12:47:20 2005
+++ gpgme/gpgme/ChangeLog	Wed Mar  9 17:03:04 2005
@@ -1,3 +1,17 @@
+2005-03-09  Werner Koch  <wk at g10code.com>
+
+	* w32-util.c (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path): Do not
+	cast away type checks.
+
+	* io.h [W32]: Do not include stdio.h.  If it is needed do it at
+	the right place.
+
+	* data.h [W32]: Removed kludge for EOPNOTSUP.
+	* data.c, data-compat.c [W32]: Explicitly test for it here.
+
+	Replaced use of _WIN32 by HAVE_W32_SYSTEM except for public header
+	files.
+
 2005-03-07  Timo Schulz  <twoaday at g10code.de>
  
         * gpgme.h: [_WIN32] Removed ssize_t typedef.
Index: gpgme/gpgme/ath-compat.c
diff -u gpgme/gpgme/ath-compat.c:1.5 gpgme/gpgme/ath-compat.c:1.6
--- gpgme/gpgme/ath-compat.c:1.5	Wed Mar  9 12:47:21 2005
+++ gpgme/gpgme/ath-compat.c	Wed Mar  9 17:03:04 2005
@@ -22,17 +22,18 @@
 #include <config.h>
 #endif
 
-#include <unistd.h>
 #include <stdio.h>
+#include <unistd.h>
 #ifdef HAVE_SYS_SELECT_H
 # include <sys/select.h>
 #else
 # include <sys/time.h>
 #endif
 #include <sys/types.h>
-#ifndef _WIN32
+#ifndef HAVE_W32_SYSTEM
 #include <sys/wait.h>
-#endif
+#endif /*!HAVE_W32_SYSTEM*/
+
 
 #include "ath.h"
 
Index: gpgme/gpgme/ath.h
diff -u gpgme/gpgme/ath.h:1.8 gpgme/gpgme/ath.h:1.9
--- gpgme/gpgme/ath.h:1.8	Wed Mar  9 12:47:21 2005
+++ gpgme/gpgme/ath.h	Wed Mar  9 17:03:04 2005
@@ -21,12 +21,15 @@
 #ifndef ATH_H
 #define ATH_H
 
-#ifdef _WIN32
-struct msghdr { int dummy; };
-typedef int socklen_t;
+#ifdef HAVE_W32_SYSTEM
+  /* fixme: Check how we did it in libgcrypt.  */
+  struct msghdr { int dummy; };
+  typedef int socklen_t;
 # include <windows.h>
 # include <io.h>
-#else
+
+#else /*!HAVE_W32_SYSTEM*/
+
 # ifdef HAVE_SYS_SELECT_H
 #  include <sys/select.h>
 # else
@@ -34,7 +37,8 @@
 # endif
 # include <sys/types.h>
 # include <sys/socket.h>
-#endif
+
+#endif  /*!HAVE_W32_SYSTEM*/
 
 
 
Index: gpgme/gpgme/data-compat.c
diff -u gpgme/gpgme/data-compat.c:1.9 gpgme/gpgme/data-compat.c:1.10
--- gpgme/gpgme/data-compat.c:1.9	Tue Dec  7 22:13:36 2004
+++ gpgme/gpgme/data-compat.c	Wed Mar  9 17:03:04 2005
@@ -30,6 +30,11 @@
 #include "data.h"
 #include "util.h"
 
+#if defined(HAVE_W32_SYSTEM) && !defined(EOPNOTSUPP)
+#define EOPNOTSUPP VALUE_FOR_EOPNOTSUPP
+#endif
+
+
 
 /* Create a new data buffer filled with LENGTH bytes starting from
    OFFSET within the file FNAME or stream STREAM (exactly one must be
Index: gpgme/gpgme/data.c
diff -u gpgme/gpgme/data.c:1.42 gpgme/gpgme/data.c:1.43
--- gpgme/gpgme/data.c:1.42	Tue Dec  7 22:13:36 2004
+++ gpgme/gpgme/data.c	Wed Mar  9 17:03:04 2005
@@ -33,6 +33,11 @@
 #include "ops.h"
 #include "io.h"
 
+#if defined(HAVE_W32_SYSTEM) && !defined(EOPNOTSUPP)
+#define EOPNOTSUPP VALUE_FOR_EOPNOTSUPP
+#endif
+
+
 
 gpgme_error_t
 _gpgme_data_new (gpgme_data_t *r_dh, struct _gpgme_data_cbs *cbs)
Index: gpgme/gpgme/engine-gpgsm.c
diff -u gpgme/gpgme/engine-gpgsm.c:1.103 gpgme/gpgme/engine-gpgsm.c:1.104
--- gpgme/gpgme/engine-gpgsm.c:1.103	Wed Mar  9 12:47:21 2005
+++ gpgme/gpgme/engine-gpgsm.c	Wed Mar  9 17:03:04 2005
@@ -19,11 +19,12 @@
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
    02111-1307, USA.  */
 
-#ifndef _WIN32
 #if HAVE_CONFIG_H
 #include <config.h>
 #endif
 
+#ifndef HAVE_W32_SYSTEM
+
 #include <stdlib.h>
 #include <string.h>
 #include <sys/types.h>
@@ -1597,4 +1598,5 @@
     gpgsm_io_event,
     gpgsm_cancel
   };
-#endif
+
+#endif /*!HAVE_W32_SYSTEM*/
Index: gpgme/gpgme/gpgme.c
diff -u gpgme/gpgme/gpgme.c:1.79 gpgme/gpgme/gpgme.c:1.80
--- gpgme/gpgme/gpgme.c:1.79	Wed Mar  9 12:47:21 2005
+++ gpgme/gpgme/gpgme.c	Wed Mar  9 17:03:04 2005
@@ -344,7 +344,7 @@
 gpgme_error_t
 gpgme_set_locale (gpgme_ctx_t ctx, int category, const char *value)
 {
-#ifndef _WIN32
+#ifndef HAVE_W32_SYSTEM
   int failed = 0;
   char *new_lc_ctype;
   char *new_lc_messages;
@@ -398,7 +398,8 @@
   SET_ONE_LOCALE (messages, MESSAGES);
   if (!ctx)
     UNLOCK (def_lc_lock);
-#endif
+
+#endif /*!HAVE_W32_SYSTEM*/
   
   return 0;
 }
Index: gpgme/gpgme/gpgme.h
diff -u gpgme/gpgme/gpgme.h:1.152 gpgme/gpgme/gpgme.h:1.153
--- gpgme/gpgme/gpgme.h:1.152	Wed Mar  9 12:47:21 2005
+++ gpgme/gpgme/gpgme.h	Wed Mar  9 17:03:04 2005
@@ -72,7 +72,8 @@
    AM_PATH_GPGME macro) check that this header matches the installed
    library.  Warning: Do not edit the next line.  configure will do
    that for you!  */
-#define GPGME_VERSION "1.0.1"
+#define GPGME_VERSION "1.1.0-cvs"
+
 
 
 /* Some opaque data types used by GPGME.  */
Index: gpgme/gpgme/io.h
diff -u gpgme/gpgme/io.h:1.13 gpgme/gpgme/io.h:1.14
--- gpgme/gpgme/io.h:1.13	Wed Mar  9 12:47:21 2005
+++ gpgme/gpgme/io.h	Wed Mar  9 17:03:04 2005
@@ -22,9 +22,6 @@
 #ifndef IO_H
 #define IO_H
 
-#ifdef _WIN32
-#include <stdio.h>
-#endif
 
 /* A single file descriptor passed to spawn.  For child fds, dup_to
    specifies the fd it should become in the child.  */
Index: gpgme/gpgme/w32-util.c
diff -u gpgme/gpgme/w32-util.c:1.12 gpgme/gpgme/w32-util.c:1.13
--- gpgme/gpgme/w32-util.c:1.12	Wed Mar  9 12:47:21 2005
+++ gpgme/gpgme/w32-util.c	Wed Mar  9 17:03:04 2005
@@ -51,6 +51,10 @@
   DWORD n1, nbytes;
   char *result = NULL;
 
+#ifdef HAVE_W32_SYSTEM
+#warning Check that this code matches the one used by gnupg
+#endif
+
   if (!root)
     root_key = HKEY_CURRENT_USER;
   else if (!strcmp (root, "HKEY_CLASSES_ROOT"))
@@ -120,7 +124,7 @@
 
   LOCK (get_path_lock);
   if (!gpg_program)
-    gpg_program = (char*)find_program_in_registry ("gpgProgram");
+    gpg_program = find_program_in_registry ("gpgProgram");
 #ifdef GPG_PATH
   if (!gpg_program)
     gpg_program = GPG_PATH;
@@ -136,7 +140,7 @@
 
   LOCK (get_path_lock);
   if (!gpgsm_program)
-    gpgsm_program = (char*)find_program_in_registry ("gpgsmProgram");
+    gpgsm_program = find_program_in_registry ("gpgsmProgram");
 #ifdef GPGSM_PATH
   if (!gpgsm_program)
     gpgsm_program = GPGSM_PATH;




More information about the Gnupg-commits mailing list