AM_PATH_LIBGCRYPT does not use gpgrt-config without AM_PATH_GPG_ERROR
Closed, ResolvedPublic

Assigned To
Authored By
ametzler1
May 11 2024, 1:19 PM

Description

Hello,

AM_PATH_LIBGCRYPT uses gpgrt-config iff AM_PATH_GPG_ERROR is invoked first and sets $GPGRT_CONFIG. Otherwise it tries to use libgcrypt-config.

However libgcrypt-config is not installed by default anymore in master (as is already the case for the respective scripts for libksba et.al.) which will leave AM_PATH_LIBGCRYPT broken for projects using libgcrypt but not libgpg-error.

Is there some kind official guidance, should consumers of AM_PATH_LIBGCRYPT move to pkgconf or must AM_PATH_GPG_ERROR be used before AM_PATH_LIBGCRYPT?

Curently the AM_PATH macros of the gnupg projects behave differently, ksba, libassuan and libgcrypt require an explicit AM_PATH_GPG_ERROR while gpgme does not.
cu Andreas

Event Timeline

• werner added a subscriber: • werner.

I noticed this recently too on some boxes. Thanks for the good decription. This support for pkg-config style .pc files for our config scripts seems to be a never ending story. The alternative name for libgpg-error-config does not make it easier.

Just to clarify: I personally think it would be perfectly fine to say that AM_PATH_* is only supported when AM_PATH_GPG_ERROR is also used. Adding an invocation AM_PATH_GPG_ERROR is not a great hassle and alternatively pkg-config/pkgconf exists and works perfectly fine (and is a lot faster).

I just did not want to start checking 70-100 packages in Debian and submitting patches for the broken ones only to find out that my patches were made superfluous by an upstream change.
cu Andreas

• gniibe triaged this task as Normal priority.

In general, asking an application change is not good. Migrating to pkg-config should be an option (not requirement).
However, it's usually recommended to use libgpg-error when an application is used with libgcrypt/libksba/libassuan.

I'm going to apply changes of:

  • Updating m4 just like in T6273 (of gpgme), so that AM_PATH_GPG_ERROR is not needed for existing applications.
  • Updating documentation for use of PKG_CONFIG_MODULES.

I'll do that for libksba and libassuan, too.

The gcrypt change works for me. Thanks!

• gniibe changed the task status from Open to Testing.May 15 2024, 4:22 AM

Ditto for ksba and assuan.

Minor nitpick regarding gpgme: It uses $host without AC_CANONICAL_HOST andf therefore throws a warning if used alone:

*** The config script "/usr/bin/gpgrt-config --libdir=/usr/lib/x86_64-linux-gnu gpgme" was
*** built for x86_64-pc-linux-gnu and thus may not match the
*** used host .
*** You may want to use the configure option --with-gpgme-prefix
*** to specify a matching config script or use $SYSROOT.

(The other m4 snippets have AC_REQUIRE([AC_CANONICAL_HOST]). This would work:

diff
--- a/src/gpgme.m4
+++ b/src/gpgme.m4
@@ -184,7 +184,8 @@ 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_GPGME],
-[ AC_REQUIRE([_AM_PATH_GPGME_CONFIG])dnl
+[ AC_REQUIRE([AC_CANONICAL_HOST])dnl
+  AC_REQUIRE([_AM_PATH_GPGME_CONFIG])dnl
   tmp=ifelse([$1], ,1:0.4.2,$1)

Fixed in 1.11.0 for libgcrypt.
libksba 1.6.7.
libassuan 3.0.0.
gpgme 1.24.0.