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", 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.