# $Id$ # # common rules for installing a pkgconfig .pc file # # This script substitues the following placeholders in .pc.tmpl # using sed: # # @_prefix_@ ... installation prefix # @_ARTIFACT_@ ... The artifact name # @_VERSION_@ ... The debian version of the artifact. # @_EXTPKGS_@ ... The external pkg-config packages used by this package. # @_LIBS_@ ... Other references external libraries (-l -l ...) # @_LIBSUBDIR_@ ... The subdirectory in , where libraries are installed. # # Variables: # # srcdir ... source directory. # top_srcdir ... optionally, top source directory. # prefix ... install prefix # EXTPKGS ... list of external pkg-config packages. # LIBS ... optional list of additional libraries # BUILDTYPE ... lib,so,dll,exe,bin # ARTIFACT ... The name of the build artifact # NODEVRULES ... If non-empty don't generate install-dev rules. # LIBSUBDIR ... subdirectory where executable should be installed. # Will be set to $(ARCHLIBSUBDIR) or as a last fallback to'lib' if empty. # (Sometimes may be 'lib/foo' or 'lib64') ifeq ($(VERSION),) VERSION=$(shell /usr/share/pba-cbs/sh/get_deb_version.sh $(srcdir) $(top_srcdir)) endif ifeq ($(LIBSUBDIR),) ifeq ($(ARCHLIBSUBDIR),) LIBSUBDIR=lib else LIBSUBDIR=$(ARCHLIBSUBDIR) endif endif ifeq ($(NODEVRULES),) install-dev:: mkdir -p $(DESTDIR)$(prefix)/$(LIBSUBDIR)/pkgconfig sed -e 's%@_prefix_@%$(prefix)%g' -e 's%@_ARTIFACT_@%$(ARTIFACT)%g' -e 's%@_VERSION_@%$(VERSION)%g' -e 's%@_EXTPKGS_@%$(subst $(space),$(comma)$(space),$(EXTPKGS))%g' -e 's%@_LIBS_@%$(LIBS)%g' -e 's%@_LIBSUBDIR_@%$(LIBSUBDIR)%g' < $(srcdir)/$(ARTIFACT).pc.tmpl > $(DESTDIR)$(prefix)/$(LIBSUBDIR)/pkgconfig/$(ARTIFACT).pc endif