Page MenuHome GnuPG

Should gpgrt-config have default LIBDIR definition in the script?
Closed, ResolvedPublic

Description

New gpgrt-config now have --libdir option to find relevant .pc file when PKG_CONFIG_PATH (or PKG_CONFIG_LIBDIR) is not supplied.

With this feature and updated *.m4 files, it works well for major use cases of building GnuPG and its related libraries for system (GNU standard, /usr/local, with prefix, cross build for multiarch environment, cross build with prefix like mingw, cross build for Gentoo/Fedora/Arch-style multilib, etc.).

However, there is one (possibly important) case, where it doesn't work well:

  • Using system installed libraries (e.g., libgpg-error, libassuan, and so on), build gnupg with prefix, like /home/myuser, or /usr/gpg22.

In this case, gpgrt-config cannot find .pc file under the --libdir specified with the prefix, because library is not intended there.
To handle this situation, it is needed for gpgrt-config to have information of system LIBDIR.

And, this particular use case is assumed for automake/autoconf configuration target of "make distcheck". It always fails to detect gpgrt-config, because there is no .pc file under prefixed dir, in this case.

Drawback is obvious. When we have LIBDIR definition, gpgrt-config will be no longer a single one, but it needs multiple one by different LIBDIR each. For multiarch environment, we can do some automatic detection, but cross-multilib situation, things are difficult.

Revisions and Commits

Event Timeline

To avoid the drawback, we can put the logic of locating possible libdir in gpg-error.m4, instead of putting in the script.

gniibe changed the task status from Open to Testing.Nov 8 2018, 3:00 AM

So far, so good.

I tested Debian build for x86_64, multiarch cross build i686, and cross build mingw.
Native build for OpenSuSE: https://build.opensuse.org/project/show/home:gniibe:branches:openSUSE:Factory
Also, "make distcheck".