From f9cbf2c8a839d2c3df20157cfe65b67a4b0bcb5a Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Fri, 25 Nov 2022 15:37:23 +0900 Subject: [PATCH] gpgme.m4: Fix AM_PATH_GPGME_PTHREAD. * src/gpgme.m4 (AM_PATH_GPGME_PTHREAD): It's deprecated, since gpgme supports threads and GNU C library has integrated pthread features. -- GnuPG-bug-id: 6285 Signed-off-by: NIIBE Yutaka --- src/gpgme.m4 | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/src/gpgme.m4 b/src/gpgme.m4 index 363a84f3..f2906c16 100644 --- a/src/gpgme.m4 +++ b/src/gpgme.m4 @@ -9,7 +9,7 @@ # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # -# Last-changed: 2022-11-15 +# Last-changed: 2022-11-25 dnl @@ -258,8 +258,9 @@ dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) dnl Test for libgpgme and define GPGME_PTHREAD_CFLAGS dnl and GPGME_PTHREAD_LIBS. dnl -AC_DEFUN([AM_PATH_GPGME_PTHREAD], -[ AC_REQUIRE([_AM_PATH_GPGME_CONFIG])dnl +AC_DEFUN([AM_PATH_GPGME_PTHREAD],[ + AC_OBSOLETE([$0], [; use AM_PATH_GPGME instead to use GPGME_CFLAGS and GPGME_LIBS])dnl + AC_REQUIRE([_AM_PATH_GPGME_CONFIG])dnl 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/'` @@ -272,35 +273,37 @@ AC_DEFUN([AM_PATH_GPGME_PTHREAD], AC_MSG_CHECKING(for GPGME pthread - version >= $min_gpgme_version) ok=no if test "$GPGME_CONFIG" != "no" ; then - if `$GPGME_CONFIG --thread=pthread 2> /dev/null` ; then - req_major=`echo $min_gpgme_version | \ + req_major=`echo $min_gpgme_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` - req_minor=`echo $min_gpgme_version | \ + req_minor=`echo $min_gpgme_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` - req_micro=`echo $min_gpgme_version | \ + req_micro=`echo $min_gpgme_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` - if test "$gpgme_version_major" -gt "$req_major"; then + if test "$gpgme_version_major" -gt "$req_major"; then ok=yes - else + else if test "$gpgme_version_major" -eq "$req_major"; then - if test "$gpgme_version_minor" -gt "$req_minor"; then - ok=yes - else - if test "$gpgme_version_minor" -eq "$req_minor"; then - if test "$gpgme_version_micro" -ge "$req_micro"; then - ok=yes - fi + if test "$gpgme_version_minor" -gt "$req_minor"; then + ok=yes + else + if test "$gpgme_version_minor" -eq "$req_minor"; then + if test "$gpgme_version_micro" -ge "$req_micro"; then + ok=yes + fi + fi fi - fi fi - fi 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 -z "$use_gpgrt_config"; then + tmp=`$GPGME_CONFIG --api-version 2>/dev/null || echo 0` + else + tmp=`$GPGME_CONFIG --variable=api_version 2>/dev/null || echo 0` + fi if test "$tmp" -gt 0 ; then if test "$req_gpgme_api" -ne "$tmp" ; then ok=no @@ -309,8 +312,8 @@ AC_DEFUN([AM_PATH_GPGME_PTHREAD], fi fi if test $ok = yes; then - GPGME_PTHREAD_CFLAGS=`$GPGME_CONFIG --thread=pthread --cflags` - GPGME_PTHREAD_LIBS=`$GPGME_CONFIG --thread=pthread --libs` + GPGME_PTHREAD_CFLAGS=`$GPGME_CONFIG --cflags` + GPGME_PTHREAD_LIBS=`$GPGME_CONFIG --libs` AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) _AM_PATH_GPGME_CONFIG_HOST_CHECK