From 5191379da3ad653fcf08ab1babb486ca952d1643 Mon Sep 17 00:00:00 2001
From: NIIBE Yutaka <gniibe@fsij.org>
Date: Tue, 1 Nov 2022 13:47:34 +0900
Subject: [PATCH] build: Prefer gpgrt-config when available.

* src/libgcrypt.m4: Overriding the decision by
--with-libgcrypt-prefix, use gpgrt-config libgcrypt when gpgrt-config
is available.

--

Backport the master commit of:
	0dcb7e05c9e1c9c2a23abe0a0390680741b61414

This may offer better migration.

GnuPG-bug-id: 5034
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
---
 src/libgcrypt.m4 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/libgcrypt.m4 b/src/libgcrypt.m4
index 19d514fd..cd4249e8 100644
--- a/src/libgcrypt.m4
+++ b/src/libgcrypt.m4
@@ -5,15 +5,15 @@
 # unlimited permission to copy and/or distribute it, with or without
 # modifications, as long as this notice is preserved.
 #
 # This file is distributed in the hope that it will be useful, but
 # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 #
-# Last-changed: 2020-09-27
+# Last-changed: 2022-11-01
 
 
 dnl AM_PATH_LIBGCRYPT([MINIMUM-VERSION,
 dnl                   [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
 dnl Test for libgcrypt and define LIBGCRYPT_CFLAGS and LIBGCRYPT_LIBS.
 dnl MINIMUM-VERSION is a string with the version number optionally prefixed
 dnl with the API version to also check the API compatibility. Example:
@@ -36,15 +36,15 @@ AC_DEFUN([AM_PATH_LIBGCRYPT],
   if test x"${LIBGCRYPT_CONFIG}" = x ; then
      if test x"${libgcrypt_config_prefix}" != x ; then
         LIBGCRYPT_CONFIG="${libgcrypt_config_prefix}/bin/libgcrypt-config"
      fi
   fi
 
   use_gpgrt_config=""
-  if test x"${LIBGCRYPT_CONFIG}" = x -a x"$GPGRT_CONFIG" != x -a "$GPGRT_CONFIG" != "no"; then
+  if test x"$GPGRT_CONFIG" != x -a "$GPGRT_CONFIG" != "no"; then
     if $GPGRT_CONFIG libgcrypt --exists; then
       LIBGCRYPT_CONFIG="$GPGRT_CONFIG libgcrypt"
       AC_MSG_NOTICE([Use gpgrt-config as libgcrypt-config])
       use_gpgrt_config=yes
     fi
   fi
   if test -z "$use_gpgrt_config"; then
-- 
2.35.1

