From 6b0729690287d6223269fc4cd8fa084c36ca1f01 Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Wed, 22 Aug 2012 17:10:24 -0700 Subject: Install pkg-config link with $host- prefix If pkg-config is used in a multiarch or cross-compiling scenario it's likely pkg-config needs to behave differently for each of them. It's possible to handle this through environment variables with one pkg-config, but another option is to have one pkg-config per platform, each with the host alias prefixed to the program. PKG_PROG_PKG_CONFIG supports this type of installation, and this is also how autoconf/libtool handle other build tools like compilers and linkers. The host-prefixed tool is installed as a hardlink where supported and a copy otherwise. This is how gcc handles it's host-prefixed versions. This feature can be turned off by passing --disable-host-tool to configure. Freedesktop #130 --- Makefile.am | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Makefile.am') diff --git a/Makefile.am b/Makefile.am index 9c224ac..d3e3c61 100644 --- a/Makefile.am +++ b/Makefile.am @@ -36,6 +36,12 @@ pkg_config_SOURCES= \ parse.c \ main.c +if HOST_TOOL +host_tool = $(host)-pkg-config$(EXEEXT) +install-exec-hook: + cd $(DESTDIR)$(bindir) && $(LN) pkg-config$(EXEEXT) $(host_tool) +endif + # Various data files m4dir = $(datadir)/aclocal dist_m4_DATA = pkg.m4 -- cgit v1.2.1