From 8e846542406535741c8aad4b7eb7c9c8fbc83321 Mon Sep 17 00:00:00 2001 From: Andrew G Morgan Date: Tue, 24 Dec 2013 09:17:11 -0800 Subject: Add a .pc file to the library. This patch was generated by Bryan Kadzban, and most recently supported by Thomas H.P. Anderson. For more info on what this file is used for, read: http://en.wikipedia.org/wiki/Pkg-config Signed-off-by: Andrew G Morgan --- libcap/Makefile | 16 ++++++++++++++-- libcap/libcap.pc.in | 11 +++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 libcap/libcap.pc.in (limited to 'libcap') diff --git a/libcap/Makefile b/libcap/Makefile index 5e92596..6aa1055 100644 --- a/libcap/Makefile +++ b/libcap/Makefile @@ -17,6 +17,7 @@ FILES=cap_alloc cap_proc cap_extint cap_flag cap_text ifeq ($(LIBATTR),yes) FILES += cap_file LDFLAGS += -lattr +DEPS = -lattr endif INCLS=libcap.h cap_names.h $(INCS) @@ -25,13 +26,22 @@ MAJLIBNAME=$(LIBNAME).$(VERSION) MINLIBNAME=$(MAJLIBNAME).$(MINOR) GPERF_OUTPUT = _caps_output.gperf -all: $(MINLIBNAME) $(STALIBNAME) +all: $(MINLIBNAME) $(STALIBNAME) libcap.pc ifeq ($(shell gperf --version > /dev/null 2>&1 && echo yes),yes) USE_GPERF_OUTPUT = $(GPERF_OUTPUT) INCLUDE_GPERF_OUTPUT = -include $(GPERF_OUTPUT) endif +libcap.pc: libcap.pc.in + sed -e 's,@prefix@,$(prefix),' \ + -e 's,@exec_prefix@,$(exec_prefix),' \ + -e 's,@libdir@,$(lib_prefix)/$(lib),' \ + -e 's,@includedir@,$(inc_prefix)/include,' \ + -e 's,@VERSION@,$(VERSION).$(MINOR),' \ + -e 's,@deps@,$(DEPS),' \ + $< >$@ + _makenames: _makenames.c cap_names.list.h $(BUILD_CC) $(BUILD_CFLAGS) $< -o $@ @@ -71,9 +81,11 @@ install: all ifeq ($(FAKEROOT),) -/sbin/ldconfig endif + mkdir -p -m 0755 $(PKGCONFIGDIR) + install -m 0644 libcap.pc $(PKGCONFIGDIR)/libcap.pc clean: $(LOCALCLEAN) - rm -f $(OBJS) $(LIBNAME)* $(STALIBNAME) + rm -f $(OBJS) $(LIBNAME)* $(STALIBNAME) libcap.pc rm -f cap_names.h cap_names.list.h _makenames $(GPERF_OUTPUT) cd include/sys && $(LOCALCLEAN) diff --git a/libcap/libcap.pc.in b/libcap/libcap.pc.in new file mode 100644 index 0000000..a28e3e4 --- /dev/null +++ b/libcap/libcap.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libcap +Description: libcap +Version: @VERSION@ +Libs: -L${libdir} -lcap +Libs.private: @deps@ +Cflags: -I${includedir} -- cgit v1.2.3