Better detection of a missing libassuan

This commit is contained in:
Werner Koch 2010-05-07 23:22:38 +00:00
parent a274f0ea10
commit 441dd8b5d2
4 changed files with 115 additions and 55 deletions

View File

@ -1,3 +1,7 @@
2010-05-07 Werner Koch <wk@g10code.com>
* configure.ac: Change checks to always require libassuan.
2010-05-07 Marcus Brinkmann <marcus@g10code.de>
* autogen.sh: Update the thing.

View File

@ -58,6 +58,9 @@ LIBGPGME_LT_REVISION=0
GPGME_CONFIG_API_VERSION=1
##############################################
NEED_LIBASSUAN_API=2
NEED_LIBASSUAN_VERSION=2.0.0
BUILD_REVISION=svn_revision
PACKAGE=$PACKAGE_NAME
@ -298,10 +301,13 @@ AC_DEFINE(GPG_ERR_SOURCE_DEFAULT, GPG_ERR_SOURCE_GPGME,
[The default error source for GPGME.])
# And for libassuan.
NEED_LIBASSUAN_VERSION=1.1.0
have_libassuan=no
AM_PATH_LIBASSUAN("$NEED_LIBASSUAN_VERSION",
AM_PATH_LIBASSUAN("$NEED_LIBASSUAN_API:$NEED_LIBASSUAN_VERSION",
have_libassuan=yes, have_libassuan=no)
if test "$have_libassuan" = "yes"; then
AC_DEFINE_UNQUOTED(GPGME_LIBASSUAN_VERSION, "$libassuan_version",
[version of the libassuan library])
fi
AM_CONDITIONAL(HAVE_ASSUAN, test "$have_libassuan" = "yes")
if test "$have_libassuan" = "yes"; then
AC_DEFINE(ENABLE_ASSUAN,1,[Whether Assuan support is enabled])
@ -551,15 +557,6 @@ AC_ARG_ENABLE(gpgsm-test,
run_gpgsm_test=$enableval)
AM_CONDITIONAL(RUN_GPGSM_TESTS, test "$run_gpgsm_test" = "yes")
# Require libassuan if GPGSM is here.
require_libassuan=no
if test "$GPGSM" != "no"; then
require_libassuan=yes
fi
if test "$G13" != "no"; then
require_libassuan=yes
fi
NO_OVERRIDE=no
AC_ARG_WITH(gpgconf,
@ -799,6 +796,7 @@ AC_CHECK_MEMBER(struct cmsghdr.cmsg_len,
#include <unistd.h>
])
use_descriptor_passing=no
AC_ARG_ENABLE(fd-passing,
AC_HELP_STRING([--enable-fd-passing], [use FD passing if supported]),
use_descriptor_passing=$enableval)
@ -889,14 +887,14 @@ AC_SUBST(emacs_local_vars_end, ['End:'])
# Last check.
die=no
if test "$require_libassuan" = "no"; then
if test "$have_libassuan" = "no"; then
die=yes
AC_MSG_NOTICE([[
***
*** You need libassuan to build this program with GPGSM support.
*** This library is for example available at
*** ftp://ftp.gnupg.org/pub/gcrypt/alpha/libassuan/
*** (at least version $NEED_LIBASSUAN_VERSION is required).
*** ftp://ftp.gnupg.org/gcrypt/libassuan/
*** (at least version $NEED_LIBASSUAN_VERSION (API $NEED_LIBASSUAN_API) is required).
***]])
fi
@ -925,25 +923,25 @@ AC_CONFIG_FILES([lang/Makefile lang/cl/Makefile lang/cl/gpgme.asd])
AC_OUTPUT
echo "
GPGME v${VERSION} has been configured as follows:
GPGME v${VERSION} has been configured as follows:
GnuPG path: $GPG
GnuPG path: $GPG
GnuPG version: $GPG_VERSION, min. $NEED_GPG_VERSION
GpgSM path: $GPGSM
GpgSM path: $GPGSM
GpgSM version: $GPGSM_VERSION, min. $NEED_GPGSM_VERSION
GpgConf path: $GPGCONF
GpgConf path: $GPGCONF
GpgConf version: $GPGCONF_VERSION, min. $NEED_GPGCONF_VERSION
G13 path: $G13
G13 path: $G13
G13 version: $G13_VERSION, min. $NEED_G13_VERSION
Assuan version: $LIBASSUAN_VERSION
Assuan version: $libassuan_version, min. $NEED_LIBASSUAN_VERSION
UI Server: $uiserver
UI Server: $uiserver
FD Passing: $use_descriptor_passing
GPGME Pthread: $have_pthread
GPGME Pth: $have_pth
GPGME Pthread: $have_pthread
GPGME Pth: $have_pth
"

View File

@ -1,3 +1,7 @@
2010-05-07 Werner Koch <wk@g10code.com>
* libassuan.m4: Update from libassuan svn.
2009-11-10 Marcus Brinkmann <marcus@g10code.de>
* libassuan.m4: Fix LIBASSUAN_VERSION.

View File

@ -9,71 +9,125 @@ dnl This file is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
dnl implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
dnl AM_PATH_LIBASSUAN([MINIMUM-VERSION,
dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
dnl Test for libassuan and define LIBASSUAN_CFLAGS and LIBASSUAN_LIBS
dnl
AC_DEFUN([AM_PATH_LIBASSUAN],
dnl Common code used for libassuan detection [internal]
dnl Returns ok set to yes or no.
dnl
AC_DEFUN([_AM_PATH_LIBASSUAN_COMMON],
[ AC_ARG_WITH(libassuan-prefix,
AC_HELP_STRING([--with-libassuan-prefix=PFX],
[prefix where LIBASSUAN is installed (optional)]),
AC_HELP_STRING([--with-libassuan-prefix=PFX],
[prefix where LIBASSUAN is installed (optional)]),
libassuan_config_prefix="$withval", libassuan_config_prefix="")
if test x$libassuan_config_prefix != x ; then
libassuan_config_args="$libassuan_config_args --prefix=$libassuan_config_prefix"
if test x${LIBASSUAN_CONFIG+set} != xset ; then
LIBASSUAN_CONFIG=$libassuan_config_prefix/bin/libassuan-config
fi
libassuan_config_args="$libassuan_config_args --prefix=$libassuan_config_prefix"
if test x${LIBASSUAN_CONFIG+set} != xset ; then
LIBASSUAN_CONFIG=$libassuan_config_prefix/bin/libassuan-config
fi
fi
AC_PATH_PROG(LIBASSUAN_CONFIG, libassuan-config, no)
tmp=ifelse([$1], ,1:0.9.2,$1)
if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
req_libassuan_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'`
min_libassuan_version=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\2/'`
else
req_libassuan_api=0
min_libassuan_version="$tmp"
fi
AC_PATH_PROG(LIBASSUAN_CONFIG, libassuan-config, no)
min_libassuan_version=ifelse([$1], ,0.0.1,$1)
AC_MSG_CHECKING(for LIBASSUAN - version >= $min_libassuan_version)
if test "$LIBASSUAN_CONFIG" != "no" ; then
libassuan_version=`$LIBASSUAN_CONFIG --version`
fi
libassuan_version_major=`echo $libassuan_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
libassuan_version_minor=`echo $libassuan_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
libassuan_version_micro=`echo $libassuan_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
AC_MSG_CHECKING(for LIBASSUAN ifelse([$2], ,,[$2 ])- version >= $min_libassuan_version)
ok=no
if test "$LIBASSUAN_CONFIG" != "no" ; then
ifelse([$2], ,,[if `$LIBASSUAN_CONFIG --thread=$2 2> /dev/null` ; then])
req_major=`echo $min_libassuan_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
req_minor=`echo $min_libassuan_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
req_micro=`echo $min_libassuan_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
libassuan_config_version=`$LIBASSUAN_CONFIG $libassuan_config_args --version`
major=`echo $libassuan_config_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
minor=`echo $libassuan_config_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
micro=`echo $libassuan_config_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
if test "$major" -gt "$req_major"; then
if test "$libassuan_version_major" -gt "$req_major"; then
ok=yes
else
if test "$major" -eq "$req_major"; then
if test "$minor" -gt "$req_minor"; then
if test "$libassuan_version_major" -eq "$req_major"; then
if test "$libassuan_version_minor" -gt "$req_minor"; then
ok=yes
else
if test "$minor" -eq "$req_minor"; then
if test "$micro" -ge "$req_micro"; then
if test "$libassuan_version_minor" -eq "$req_minor"; then
if test "$libassuan_version_micro" -ge "$req_micro"; then
ok=yes
fi
fi
fi
fi
fi
ifelse([$2], ,,[fi])
fi
if test $ok = yes; then
AC_MSG_RESULT([yes ($libassuan_version)])
else
AC_MSG_RESULT(no)
fi
if test $ok = yes; then
if test "$req_libassuan_api" -gt 0 ; then
tmp=`$LIBASSUAN_CONFIG --api-version 2>/dev/null || echo 0`
if test "$tmp" -gt 0 ; then
AC_MSG_CHECKING([LIBASSUAN ifelse([$2], ,,[$2 ])API version])
if test "$req_libassuan_api" -eq "$tmp" ; then
AC_MSG_RESULT(okay)
else
ok=no
AC_MSG_RESULT([does not match. want=$req_libassuan_api got=$tmp.])
fi
fi
fi
fi
])
dnl AM_CHECK_LIBASSUAN([MINIMUM-VERSION,
dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
dnl Test whether libassuan has at least MINIMUM-VERSION. This is
dnl used to test for features only available in newer versions.
dnl
AC_DEFUN([AM_CHECK_LIBASSUAN],
[ _AM_PATH_LIBASSUAN_COMMON($1)
if test $ok = yes; then
ifelse([$2], , :, [$2])
else
ifelse([$3], , :, [$3])
fi
])
dnl AM_PATH_LIBASSUAN([MINIMUM-VERSION,
dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
dnl Test for libassuan and define LIBASSUAN_CFLAGS and LIBASSUAN_LIBS
dnl
AC_DEFUN([AM_PATH_LIBASSUAN],
[ _AM_PATH_LIBASSUAN_COMMON($1)
if test $ok = yes; then
LIBASSUAN_CFLAGS=`$LIBASSUAN_CONFIG $libassuan_config_args --cflags`
LIBASSUAN_LIBS=`$LIBASSUAN_CONFIG $libassuan_config_args --libs`
LIBASSUAN_VERSION="$libassuan_config_version"
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
else
LIBASSUAN_CFLAGS=""
LIBASSUAN_LIBS=""
LIBASSUAN_VERSION=""
AC_MSG_RESULT(no)
ifelse([$3], , :, [$3])
fi
AC_SUBST(LIBASSUAN_CFLAGS)
AC_SUBST(LIBASSUAN_LIBS)
AC_SUBST(LIBASSUAN_VERSION)
])