[CRIU] [PATCH 3/6] lib: Generate pkgconfig file

Tycho Andersen tycho.andersen at canonical.com
Thu Jul 31 10:18:17 PDT 2014


On Wed, Jul 30, 2014 at 03:37:18PM +0000, Serge Hallyn wrote:
> Quoting Tycho Andersen (tycho.andersen at canonical.com):
> >
> > Yes, so it is essentially that. Perhaps I don't understand what the
> > purpose of $DESTDIR is, then. I guess you don't want it in the
> > pkgconfig because the pkgconfig is supposed to be relative to --prefix
> > only?
> 
> Right.  $prefix is where relative to / you want the binaries installed.
> $DESTDIR is where to do the make install, for the sake of creating a
> tarfile or copying later.  The .pc file should -iiuc - have the paths
> relative to the final install location of binaries, which is just
> $prefix.

Ah ha, makes sense. In that case, the updated patch is below.

> > (The confusion here is that users can't really set PREFIX, so you have
> 
> can't they specify prefix through configure --prefix=?

No, because criu doesn't have a ./configure.

Tycho




Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
---
 .gitignore     | 1 +
 Makefile       | 6 ++++++
 lib/criu.pc.in | 8 ++++++++
 3 files changed, 15 insertions(+)
 create mode 100644 lib/criu.pc.in

diff --git a/.gitignore b/.gitignore
index 3cb97c4..48ccf81 100644
--- a/.gitignore
+++ b/.gitignore
@@ -25,3 +25,4 @@ arch/x86/syscalls.S
 pie/pie.lds.S
 include/config.h
 protobuf-desc-gen.h
+criu.pc
diff --git a/Makefile b/Makefile
index a422614..42c6de9 100644
--- a/Makefile
+++ b/Makefile
@@ -266,6 +266,12 @@ install: $(PROGRAM) install-man
 	$(Q) install -m 644 scripts/sd/criu.service $(DESTDIR)$(SYSTEMDUNITDIR)
 	$(Q) mkdir -p $(DESTDIR)$(LOGROTATEDIR)
 	$(Q) install -m 644 scripts/logrotate.d/criu-service $(DESTDIR)$(LOGROTATEDIR)
+	$(Q) sed -e 's, at version@,$(GITID),' \
+		-e 's, at libdir@,$(LIBDIR),' \
+		-e 's, at includedir@,$(dir $(INCLUDEDIR)),' \
+		lib/criu.pc.in > criu.pc
+	$(Q) mkdir -p $(DESTDIR)$(LIBDIR)/pkgconfig
+	$(Q) install -m 644 criu.pc $(DESTDIR)$(LIBDIR)/pkgconfig
 
 install-man:
 	$(Q) $(MAKE) -C Documentation install
diff --git a/lib/criu.pc.in b/lib/criu.pc.in
new file mode 100644
index 0000000..33986d1
--- /dev/null
+++ b/lib/criu.pc.in
@@ -0,0 +1,8 @@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: CRIU
+Description: RPC library for userspace checkpoint and restore
+Version: @version@
+Libs: -L${libdir} -lcriu
+Cflags: -I${includedir}
-- 
1.9.1


More information about the CRIU mailing list