Make gpg-error-config compatible to pkg-config.
* configure.ac (AC_CONFIG_FILES): Generate src/gpg-error.pc, as well as src/gpg-error-config-old and src/gpg-error-config-new. * src/Makefile.am (pkgconfigdir, pkgconfig_DATA): New. (EXTRA_DIST): Add gpg-error-config-new.in, gpg-error-config-test.sh, and gpg-error.pc.in. (CLEANFILES): Add gpg-error-config gpg-error-config-test.log. (TESTS): New. (gpg-error-config): New target. * src/gpg-error-config-new.in: New. * src/gpg-error-config-test.sh: New. * src/gpg-error.pc.in: New. * src/gpg-error.m4 (GPG_ERROR_MT_CFLAGS): Use --variable. (GPG_ERROR_MT_LIBS, gpg_error_config_host): Likewise.
This change is to privide gpg-error.pc for pkg-config, so that
developers can use pkg-config to configure their applications. The
gpg-error-config script is also kept supported for applications which
want to avoid dependency of pkg-config.
Note that new gpg-error-config script uses gpg-error.pc as master
data, so that it can keep compatibility to pkg-config easily. In the
new gpg-error-config script, features are added to increase
compatibility to pkg-config, like --variable option and multiple
module support. However, it is not meant to oriented to be a
full-fledged version of pkg-config, only a small set of features is
supported.
To be conservative, new gpg-error-config is checked at build time
against old gpg-error-config. On the host which fails, old
gpg-error-config will be installed with a warning.
- GnuPG-bug-id: T4085
- Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>