From e7c2a0e98b6ddb91ba109b53644aed4b9b89123d Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Tue, 31 Mar 2009 15:07:40 +0000 Subject: Allow required packages to be constructed based upon the build configuration svn path=/trunk/tools/buildsystem/; revision=7014 --- makefiles/Makefile.top | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'makefiles/Makefile.top') diff --git a/makefiles/Makefile.top b/makefiles/Makefile.top index 34f79ad..4b4b291 100644 --- a/makefiles/Makefile.top +++ b/makefiles/Makefile.top @@ -24,6 +24,7 @@ # HOST Host platform identifier # PREFIX Absolute installation path prefix # (defaults to /usr/local) +# REQUIRED_PKGS List of required pkg-config packages # # The client may also override all toolchain settings, including: # @@ -216,9 +217,18 @@ distclean: clean # # We also permit a trailing ';' in the file list. +__comma := , +__empty := +__space := $(empty) $(empty) +__required = $(subst $(__space),$(__comma) ,$(strip $(REQUIRED_PKGS))) + # Install a pkg-config control file ($1) to the specified location ($2) define install_pkgconfig $(Q)$(SED) -e 's#PREFIX#$(PREFIX)#' $1 >$(BUILDDIR)/$(1:.in=) + $(if $(REQUIRED_PKGS), \ + $(Q)$(SED) -i -e 's#REQUIRED#Requires: $(__required)#' \ + $(BUILDDIR)/$(1:.in=), \ + $(Q)$(SED) -i -e 's#REQUIRED##' $(BUILDDIR)/$(1:.in=)) $(INSTALL) $(INSTALLFLAGS) -m 644 $(BUILDDIR)/$(1:.in=) $2 endef -- cgit v1.2.3