libgcrypt: detect libgpg-error with pkg-config

Andreas Metzler ametzler at bebt.de
Sun May 3 13:13:44 CEST 2026


On 2026-05-03 Niibe Yutaka <gniibe at fsij.org> wrote:
> Vincent Torri wrote:
> > and about using pkg-config instead to detect libgpg-error ?

> The configure script of libgcrypt is written for use of gpgrt-config.
> It's same for other libraries of GnuPG, and GnuPG itself.

> gpgrt-config is developed to replace many *-config for GnuPG
> (gpg-error-config, libgcrypt-config, libassuan-config, libksba-config,
> and npth-config, etc.).  gpgrt-config is a minimum subset of pkg-config.
> "Minimum" means that, it should have enough but no other features to
> support GnuPG build.

> The intention is to allow building GnuPG without pkg-config.  GnuPG
> build could be done in an early stage of OS porting, so, we pursue
> less dependency other than GNU toolchain.

> True, technically, it is possible to modify those configure scripts
> to use pkg-config instead of gpgrt-config.  But our intention is
> use of gpgrt-config here.

> We (GnuPG team) don't have any plan to modify those configure scripts
> with pkg-config

Hello,

well nowadays everybody is using pkgconf instead of the original
pkg-config implementation. pkg-config depended on glib but pkgconf
basically only needs a C-compiler and is therefore very easy to
bootstrap.

>From a user's point of view the biggest downside of the 
gpgrt-config-using autoconf tests is their lack of speed:

Compare running minimal configure.ac with
 PKG_CHECK_MODULES([GPGERROR], [gpg-error >= 1.0] ) ...

(sid)ametzler at argenau:/tmp/HELLO$ time ./configure
[...]
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for gpg-error >= 1.0 ... yes
configure: creating ./config.status

real    0m0.372s
user    0m0.276s
sys     0m0.107s

... OTOH with AM_PATH_GPG_ERROR([1.0])
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for gpg-error-config... no
checking for gpgrt-config... /usr/bin/gpgrt-config
configure: Use gpgrt-config with /usr/lib/x86_64-linux-gnu as gpg-error-config
checking for GPG Error - version >= 1.0... yes (1.59)
configure: creating ./config.status

real    0m2.236s
user    0m1.671s
sys     0m0.737s

cu Andreas

-- 
"You people are noisy," Nia said.
I made the gesture of agreement.



More information about the Gcrypt-devel mailing list