+2005-03-09 Werner Koch <wk@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@g10code.com>
Released 1.0.2.
* 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
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
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, ...)
{
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
])
}
+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
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";
# 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.
#
NEED_GPG_VERSION=1.2.2
NEED_GPGSM_VERSION=1.9.6
##############################################
-AC_PREREQ(2.52)
-AC_REVISION($Revision$)
+
PACKAGE=$PACKAGE_NAME
VERSION=$PACKAGE_VERSION
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
# 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
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'
# 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")
+2005-03-09 Werner Koch <wk@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@g10code.de>
* gpgme.h: [_WIN32] Removed ssize_t typedef.
#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"
#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
# endif
# include <sys/types.h>
# include <sys/socket.h>
-#endif
+
+#endif /*!HAVE_W32_SYSTEM*/
\f
#include "data.h"
#include "util.h"
+#if defined(HAVE_W32_SYSTEM) && !defined(EOPNOTSUPP)
+#define EOPNOTSUPP VALUE_FOR_EOPNOTSUPP
+#endif
+
+
\f
/* Create a new data buffer filled with LENGTH bytes starting from
OFFSET within the file FNAME or stream STREAM (exactly one must be
#include "ops.h"
#include "io.h"
+#if defined(HAVE_W32_SYSTEM) && !defined(EOPNOTSUPP)
+#define EOPNOTSUPP VALUE_FOR_EOPNOTSUPP
+#endif
+
+
\f
gpgme_error_t
_gpgme_data_new (gpgme_data_t *r_dh, struct _gpgme_data_cbs *cbs)
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>
gpgsm_io_event,
gpgsm_cancel
};
-#endif
+
+#endif /*!HAVE_W32_SYSTEM*/
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;
SET_ONE_LOCALE (messages, MESSAGES);
if (!ctx)
UNLOCK (def_lc_lock);
-#endif
+
+#endif /*!HAVE_W32_SYSTEM*/
return 0;
}
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"
+
\f
/* Some opaque data types used by GPGME. */
#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. */
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"))
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;
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;