summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2022-11-15 13:36:13 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2022-11-15 13:36:13 +0900
commit788f63347eda2d35ba5d9dad5e339743343d2f66 (patch)
treef72dceb43aad2d46762a757470fc8288974fa42d
parentc580094dbe97249caebdedbf0f584e604fd20240 (diff)
downloadlibgpg-error-788f63347eda2d35ba5d9dad5e339743343d2f66.tar.gz
gpg-error.m4: Factor out _AM_PATH_GPGRT_CONFIG.
* src/gpg-error.m4 (_AM_PATH_POSSIBLE_GPG_ERROR_CONFIG): New. (_AM_PATH_GPGRT_CONFIG): New. (AM_PATH_GPG_ERROR): Use _AM_PATH_POSSIBLE_GPG_ERROR_CONFIG and _AM_PATH_GPGRT_CONFIG. -- GnuPG-bug-id: 6273 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
-rw-r--r--src/gpg-error.m449
1 files changed, 32 insertions, 17 deletions
diff --git a/src/gpg-error.m4 b/src/gpg-error.m4
index a975e53..908e604 100644
--- a/src/gpg-error.m4
+++ b/src/gpg-error.m4
@@ -1,5 +1,5 @@
# gpg-error.m4 - autoconf macro to detect libgpg-error.
-# Copyright (C) 2002, 2003, 2004, 2011, 2014, 2018, 2020, 2021
+# Copyright (C) 2002, 2003, 2004, 2011, 2014, 2018, 2020, 2021, 2022
# g10 Code GmbH
#
# This file is free software; as a special exception the author gives
@@ -10,23 +10,13 @@
# 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-09-21
+# Last-changed: 2022-11-15
-
-dnl AM_PATH_GPG_ERROR([MINIMUM-VERSION,
-dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
-dnl
-dnl Test for libgpg-error and define GPG_ERROR_CFLAGS, GPG_ERROR_LIBS,
-dnl GPG_ERROR_MT_CFLAGS, and GPG_ERROR_MT_LIBS. The _MT_ variants are
-dnl used for programs requireing real multi thread support.
dnl
-dnl If a prefix option is not used, the config script is first
-dnl searched in $SYSROOT/bin and then along $PATH. If the used
-dnl config script does not match the host specification the script
-dnl is added to the gpg_config_script_warn variable.
+dnl Find gpg-error-config, for backward compatibility
dnl
-AC_DEFUN([AM_PATH_GPG_ERROR],
-[ AC_REQUIRE([AC_CANONICAL_HOST])
+dnl _AM_PATH_POSSIBLE_GPG_ERROR_CONFIG
+AC_DEFUN([_AM_PATH_POSSIBLE_GPG_ERROR_CONFIG],[dnl
gpg_error_config_prefix=""
dnl --with-libgpg-error-prefix=PFX is the preferred name for this option,
dnl since that is consistent with how our three siblings use the directory/
@@ -62,9 +52,14 @@ AC_DEFUN([AM_PATH_GPG_ERROR],
fi
AC_PATH_PROG(GPG_ERROR_CONFIG, gpg-error-config, no)
- min_gpg_error_version=ifelse([$1], ,1.33,$1)
- ok=no
+])
+dnl
+dnl Find gpgrt-config, which uses .pc file
+dnl (minimum pkg-config functionality, supporting cross build)
+dnl
+dnl _AM_PATH_GPGRT_CONFIG
+AC_DEFUN([_AM_PATH_GPGRT_CONFIG],[dnl
AC_PATH_PROG(GPGRT_CONFIG, gpgrt-config, no, [$prefix/bin:$PATH])
if test "$GPGRT_CONFIG" != "no"; then
# Determine gpgrt_libdir
@@ -145,6 +140,26 @@ AC_DEFUN([AM_PATH_GPG_ERROR],
gpg_error_config_version=`$GPG_ERROR_CONFIG --version`
unset GPGRT_CONFIG
fi
+])
+
+dnl AM_PATH_GPG_ERROR([MINIMUM-VERSION,
+dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
+dnl
+dnl Test for libgpg-error and define GPG_ERROR_CFLAGS, GPG_ERROR_LIBS,
+dnl GPG_ERROR_MT_CFLAGS, and GPG_ERROR_MT_LIBS. The _MT_ variants are
+dnl used for programs requireing real multi thread support.
+dnl
+dnl If a prefix option is not used, the config script is first
+dnl searched in $SYSROOT/bin and then along $PATH. If the used
+dnl config script does not match the host specification the script
+dnl is added to the gpg_config_script_warn variable.
+dnl
+AC_DEFUN([AM_PATH_GPG_ERROR],[dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([_AM_PATH_POSSIBLE_GPG_ERROR_CONFIG])dnl
+AC_REQUIRE([_AM_PATH_GPGRT_CONFIG])dnl
+ min_gpg_error_version=ifelse([$1], ,1.33,$1)
+ ok=no
if test "$GPG_ERROR_CONFIG" != "no"; then
req_major=`echo $min_gpg_error_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`