From 78b679a778ddf37b8952f1808fd8c52cc8163f17 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Tue, 11 Sep 2018 08:57:23 +0900 Subject: 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: 4085 Signed-off-by: NIIBE Yutaka --- src/Makefile.am | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/Makefile.am') diff --git a/src/Makefile.am b/src/Makefile.am index fcfbb83..380ea7c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -88,6 +88,9 @@ nodist_bin_SCRIPTS = gpgrt-config m4datadir = $(datadir)/aclocal m4data_DATA = gpg-error.m4 gpgrt.m4 +pkgconfigdir = $(datadir)/pkgconfig +pkgconfig_DATA = gpg-error.pc + EXTRA_DIST = mkstrtable.awk err-sources.h.in err-codes.h.in \ mkerrnos.awk errnos.in README \ mkerrcodes.awk mkerrcodes1.awk mkerrcodes2.awk mkerrcodes.c \ @@ -95,6 +98,7 @@ EXTRA_DIST = mkstrtable.awk err-sources.h.in err-codes.h.in \ err-sources.h err-codes.h gpg-error-config.in gpg-error.m4 gpgrt.m4 \ gpg-error.vers gpg-error.def.in \ versioninfo.rc.in gpg-error.w32-manifest.in \ + gpg-error-config-new.in gpg-error-config-test.sh gpg-error.pc.in \ $(lock_obj_pub) BUILT_SOURCES = err-sources.h err-codes.h code-to-errno.h code-from-errno.h \ @@ -107,8 +111,11 @@ CLEANFILES = err-sources.h err-codes.h code-to-errno.h code-from-errno.h \ gpg-error.h gpgrt.h gpgrt-config \ mkerrcodes$(EXEEXT_FOR_BUILD) mkerrcodes.h gpg-error.def mkw32errmap.tab.h \ mkw32errmap.map.c err-sources-sym.h err-codes-sym.h errnos-sym.h \ - gpg-extra/errno.h mkheader$(EXEEXT_FOR_BUILD) $(tmp_files) lock-obj-pub.native.h + gpg-extra/errno.h mkheader$(EXEEXT_FOR_BUILD) \ + gpg-error-config gpg-error-config-test.log \ + $(tmp_files) lock-obj-pub.native.h +TESTS = gpg-error-config-test.sh # # {{{ Begin Windows part @@ -324,6 +331,17 @@ gpgrt.h: gpg-error.h gpgrt-config: gpg-error-config cp gpg-error-config gpgrt-config +gpg-error-config: gpg-error-config-new gpg-error-config-old + @echo -n "Confirm gpg-error-config works... " + @if $(srcdir)/gpg-error-config-test.sh --old-new; then \ + echo "good"; \ + cp gpg-error-config-new $@; \ + else \ + echo "no"; \ + echo "*** Please report to with gpg-error-config-test.log"; \ + cp gpg-error-config-old $@; \ + fi + install-data-local: if HAVE_W32CE_SYSTEM -$(MKDIR_P) "$(DESTDIR)$(includedir)/gpg-extra" -- cgit v1.2.1