Page MenuHome GnuPG

Without gpg-error-config installed (libgpg-error-1.46) libgcrypt-1.10.1 does not configure
Open, NormalPublic

Description

% ./configure
.
.
.
checking for gpg-error-config... no
checking for gpgrt-config... /usr/local/bin/gpgrt-config
checking for GPG Error - version >= 1.27... no
configure: error: libgpg-error is needed.
                See ftp://ftp.gnupg.org/gcrypt/libgpg-error/ .

Event Timeline

debohman created this object in space S1 Public.

Manually installing gpg-error-config in /usr/local/bin allows libgcrypt to configure and build.

Contents of /usr/local/lib/pkgconfig/gpg-error.pc:

prefix=/usr/local
exec_prefix=${prefix}
includedir=${prefix}/include
libdir=${exec_prefix}/lib
host=x86_64-apple-darwin16.7.0
mtcflags=
mtlibs=-lpthread

Name: gpg-error
Description: GPG Runtime
Version: 1.46
Cflags: -I${includedir}
Libs: -L${libdir} -lgpg-error
Libs.private: 
URL: https://www.gnupg.org/software/libgpg-error/index.html
gniibe added projects: gpgrt, libgcrypt, MacOS.
gniibe added a subscriber: gniibe.

From the information in gpg-error.pc, I think it's on macOS.

In the configure script, it tries to check/locate gpg-error-config or gpgrt-config. When gpgrt-config is available, it emulates gpg-error-config.

It seems that gpgrt-config fails in your environment, for some reasons.

Could you show us the first line of gpgrt-config? It specifies the shell interpreter (usually, #!/bin/sh).

Also, please show us how it works on your environment:

$ /usr/local/bin/gpgrt-config --libdir=/usr/local/lib gpg-error --libs
$ /usr/local/bin/gpgrt-config --libdir=/usr/local/lib gpg-error --modversion

If it fails, how about following?

$ bash /usr/local/bin/gpgrt-config --libdir=/usr/local/lib gpg-error --modversion

Yes, it is on macOS.

% /usr/local/bin/gpgrt-config --libdir=/usr/local/lib gpg-error --libs
-L/usr/local/lib -lgpg-error
% /usr/local/bin/gpgrt-config --libdir=/usr/local/lib gpg-error --modversion
1.46

Thank you for your quick reply.

IIUC, we should apply the fix of gpg-error.m4 rE628cb1a786bd: m4: Fix detection of gpgrt's libdir.

Actually, it looks as if libgpg-error-1.46 already has that fix.

Note: I am using clang, which based on the issue in rE628cb1a786bd: m4: Fix detection of gpgrt's libdir. outputs the following:

% cc -print-search-dirs
programs: =/usr/local/bin
libraries: =/usr/local/lib/clang/15.0.3

Thank you for the information.

I meant the fix should go into libgcrypt/m4/gpg-error.m4 too, so that the libgcrypt's configure script (generated using gpg-error.m4) can locate /usr/local/lib/pkgconfig/gpg-error.pc.

Okay. So, I removed gpg-error-config, updated libgcrypt/m4/gpg-error.m4, and then rebuilt configure. And, gcrypt configures and builds.

Will this be in the next release of libgcrypt?

Will this be in the next release of libgcrypt?

Yes. It's in rCe2c0920fd7de: build: Update gpg-error.m4. for libgcrypt 1.10 branch.

gniibe triaged this task as Normal priority.Oct 24 2022, 6:37 AM

Thank you. I am glad that it is already resolved.