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


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.

gniibe created this task.Nov 1 2018, 5:15 AM
gniibe added a comment.Nov 2 2018, 1:57 AM

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

gniibe updated the task description. (Show Details)Nov 2 2018, 1:58 AM
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:
Also, "make distcheck".

gniibe closed this task as Resolved.Mon, Dec 10, 3:02 AM