summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Brinkmann <mb@g10code.com>2004-09-30 01:06:19 +0000
committerMarcus Brinkmann <mb@g10code.com>2004-09-30 01:06:19 +0000
commit5c4008a1766e8ca06b0e78faa508d73229fc7e98 (patch)
treee2b9f134257c9accb98f51da8e9970e4b6d1e7c0
parent1819293208e3a2eaf01303b539a2d091626cbe5e (diff)
downloadgpgme-5c4008a1766e8ca06b0e78faa508d73229fc7e98.tar.gz
2004-09-30 Marcus Brinkmann <marcus@g10code.de>
* gpgme.m4: Implement the --api-version check.
-rw-r--r--gpgme/ChangeLog2
-rw-r--r--gpgme/gpgme.m467
2 files changed, 66 insertions, 3 deletions
diff --git a/gpgme/ChangeLog b/gpgme/ChangeLog
index 099faa9e..ea8efb46 100644
--- a/gpgme/ChangeLog
+++ b/gpgme/ChangeLog
@@ -1,5 +1,7 @@
2004-09-30 Marcus Brinkmann <marcus@g10code.de>
+ * gpgme.m4: Implement the --api-version check.
+
* rungpg.c (read_status): Move the polling of the output data pipe
to just before removing the command fd, from just before adding
it. This avoids buffering problems.
diff --git a/gpgme/gpgme.m4 b/gpgme/gpgme.m4
index 5e3793f7..1915f550 100644
--- a/gpgme/gpgme.m4
+++ b/gpgme/gpgme.m4
@@ -9,6 +9,7 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
AC_DEFUN([_AM_PATH_GPGME_CONFIG],
[ AC_ARG_WITH(gpgme-prefix,
AC_HELP_STRING([--with-gpgme-prefix=PFX],
@@ -34,7 +35,15 @@ dnl Test for libgpgme and define GPGME_CFLAGS and GPGME_LIBS.
dnl
AC_DEFUN([AM_PATH_GPGME],
[ AC_REQUIRE([_AM_PATH_GPGME_CONFIG])dnl
- min_gpgme_version=ifelse([$1], ,0.4.2,$1)
+ tmp=ifelse([$1], ,1:0.4.2,$1)
+ if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
+ req_gpgme_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'`
+ min_gpgme_version=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\2/'`
+ else
+ req_gpgme_api=0
+ min_gpgme_version="$tmp"
+ fi
+
AC_MSG_CHECKING(for GPGME - version >= $min_gpgme_version)
ok=no
if test "$GPGME_CONFIG" != "no" ; then
@@ -61,6 +70,18 @@ AC_DEFUN([AM_PATH_GPGME],
fi
fi
if test $ok = yes; then
+ # If we have a recent GPGME, we should also check that the
+ # API is compatible.
+ if test "$req_gpgme_api" -gt 0 ; then
+ tmp=`$GPGME_CONFIG --api-version 2>/dev/null || echo 0`
+ if test "$tmp" -gt 0 ; then
+ if test "$req_gpgme_api" -ne "$tmp" ; then
+ ok=no
+ fi
+ fi
+ fi
+ fi
+ if test $ok = yes; then
GPGME_CFLAGS=`$GPGME_CONFIG --cflags`
GPGME_LIBS=`$GPGME_CONFIG --libs`
AC_MSG_RESULT(yes)
@@ -81,7 +102,15 @@ dnl Test for libgpgme and define GPGME_PTH_CFLAGS and GPGME_PTH_LIBS.
dnl
AC_DEFUN([AM_PATH_GPGME_PTH],
[ AC_REQUIRE([_AM_PATH_GPGME_CONFIG])dnl
- min_gpgme_version=ifelse([$1], ,0.4.2,$1)
+ tmp=ifelse([$1], ,1:0.4.2,$1)
+ if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
+ req_gpgme_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'`
+ min_gpgme_version=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\2/'`
+ else
+ req_gpgme_api=0
+ min_gpgme_version="$tmp"
+ fi
+
AC_MSG_CHECKING(for GPGME Pth - version >= $min_gpgme_version)
ok=no
if test "$GPGME_CONFIG" != "no" ; then
@@ -110,6 +139,18 @@ AC_DEFUN([AM_PATH_GPGME_PTH],
fi
fi
if test $ok = yes; then
+ # If we have a recent GPGME, we should also check that the
+ # API is compatible.
+ if test "$req_gpgme_api" -gt 0 ; then
+ tmp=`$GPGME_CONFIG --api-version 2>/dev/null || echo 0`
+ if test "$tmp" -gt 0 ; then
+ if test "$req_gpgme_api" -ne "$tmp" ; then
+ ok=no
+ fi
+ fi
+ fi
+ fi
+ if test $ok = yes; then
GPGME_PTH_CFLAGS=`$GPGME_CONFIG --thread=pth --cflags`
GPGME_PTH_LIBS=`$GPGME_CONFIG --thread=pth --libs`
AC_MSG_RESULT(yes)
@@ -131,7 +172,15 @@ dnl and GPGME_PTHREAD_LIBS.
dnl
AC_DEFUN([AM_PATH_GPGME_PTHREAD],
[ AC_REQUIRE([_AM_PATH_GPGME_CONFIG])dnl
- min_gpgme_version=ifelse([$1], ,0.4.2,$1)
+ tmp=ifelse([$1], ,1:0.4.2,$1)
+ if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
+ req_gpgme_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'`
+ min_gpgme_version=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\2/'`
+ else
+ req_gpgme_api=0
+ min_gpgme_version="$tmp"
+ fi
+
AC_MSG_CHECKING(for GPGME pthread - version >= $min_gpgme_version)
ok=no
if test "$GPGME_CONFIG" != "no" ; then
@@ -160,6 +209,18 @@ AC_DEFUN([AM_PATH_GPGME_PTHREAD],
fi
fi
if test $ok = yes; then
+ # If we have a recent GPGME, we should also check that the
+ # API is compatible.
+ if test "$req_gpgme_api" -gt 0 ; then
+ tmp=`$GPGME_CONFIG --api-version 2>/dev/null || echo 0`
+ if test "$tmp" -gt 0 ; then
+ if test "$req_gpgme_api" -ne "$tmp" ; then
+ ok=no
+ fi
+ fi
+ fi
+ fi
+ if test $ok = yes; then
GPGME_PTHREAD_CFLAGS=`$GPGME_CONFIG --thread=pthread --cflags`
GPGME_PTHREAD_LIBS=`$GPGME_CONFIG --thread=pthread --libs`
AC_MSG_RESULT(yes)