[PATCH Libgpg-error] gpg-error.m4: support pkg-config

NIIBE Yutaka gniibe at fsij.org
Fri Dec 7 01:56:38 CET 2018


Hello,

Dirk Gottschalk <dirk.gottschalk1980 at googlemail.com> wrote:
> On my fedora machine there are, for example, some
> wrapper scripts if you want to cross compile for mingw which set up the
> environment for configure, cmake and various other build systems.

Right.

The questions are: how such a setup can be maintained, possibly cleanly.

Released versions of (old) GnuPG and GnuPG libraries require tweaks
which is GnuPG specific, by --with-<library-specific>-config options or
SYSROOT environment variable.  From viewpoint of the current best
practice of cross build, I think, both could be considered not ideal,
because it is application specific, and the method uses command for
cross-target under cross-target directory, only works in a specific
use case, etc.

And... cross build is common these days.  That's because mainly, it's
common that a system supports both of 32-bit and 64-bit environments.
Speaking about GNU systems, there are two different flavors, multiarch
support and multilib support.  For example, the former uses
/lib/i386-linux-gnu and /lib/x86_64-linux-gnu, the latter uses /lib and
/lib64.

New version of GnuPG and GnuPG libraries, which is currently in master
branch, introduces new method, by a single script named gpgrt-config.
By this script, for building GnuPG, we don't need any application
specific tweaks any more.  We can just supply --host=${HOST} to
configure invocation, which perfectly follows the current best practice
of cross build, I suppose.

It is unfortunate that we can't use pkg-config directly to achieve this
(yet).  It still has an application specific script, that is,
gpgrt-config.  But, no special tweak is required, because it is a script
which can be shared for all cross-targets, and it follows pkg-config
methodology (of using .pc files and its environment vars).

Perhaps, our changes are somewhat confusing.  While we introduce new
method, we keep old method as well.  So, old tweaks can still be valid
for both of old GnuPG and new GnuPG.  And old tweaks by existing
software which use GnuPG libraries are still valid with new GnuPG
libraries.

I'm sorry to say that we don't accept further changes for old method in
GnuPG libraries.  They keep staying there to keep supporting existing
software.  Please use new method instead, for improving cross-build,
or use pkg-config directly.

I'm sorry if our .pc files brought an illusion like... the perfect
victory of pkg-config for GnuPG build.  No, it's never our purpose, at
all.

I wish that our improvement makes cross-build easier for others, just
like it makes easier for us.


Happy Hacking,
-- 



More information about the Gnupg-devel mailing list