The attached patch adds support for pkgconfig to the ibverbs library.

Cloned from Roland's kernel.org git tree.

Regards
-steve
>From 6885d0e889789ae17235f05d3055968c377416b3 Mon Sep 17 00:00:00 2001
From: Steven Dake <[email protected]>
Date: Mon, 20 Jul 2009 11:11:25 -0700
Subject: [PATCH] Add pkgconfig support to ibverbs library.

---
 Makefile.am             |    2 ++
 configure.in            |    3 ++-
 libibverbs.spec.in      |    4 ++++
 pkgconfig/Makefile.am   |   25 +++++++++++++++++++++++++
 pkgconfig/ibverbs.pc.in |   11 +++++++++++
 5 files changed, 44 insertions(+), 1 deletions(-)
 create mode 100644 pkgconfig/Makefile.am
 create mode 100644 pkgconfig/ibverbs.pc.in

diff --git a/Makefile.am b/Makefile.am
index 9b05306..b5ccb32 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -66,6 +66,8 @@ EXTRA_DIST = include/infiniband/driver.h include/infiniband/kern-abi.h \
     src/ibverbs.h examples/pingpong.h \
     src/libibverbs.map libibverbs.spec.in $(man_MANS)
 
+SUBDIRS = pkgconfig
+
 dist-hook: libibverbs.spec
 	cp libibverbs.spec $(distdir)
 
diff --git a/configure.in b/configure.in
index 374aae7..c54ca4b 100644
--- a/configure.in
+++ b/configure.in
@@ -6,6 +6,7 @@ AC_CONFIG_SRCDIR([src/ibverbs.h])
 AC_CONFIG_AUX_DIR(config)
 AM_CONFIG_HEADER(config.h)
 AM_INIT_AUTOMAKE(libibverbs, 1.1.2)
+AC_CHECK_PROGS([PKGCONFIG], [pkg-config])
 
 AM_PROG_LIBTOOL
 
@@ -67,5 +68,5 @@ if test $ac_cv_asm_symver_support = yes; then
 fi
 
 SHAVE_INIT([], [enable])
-AC_CONFIG_FILES([Makefile libibverbs.spec shave shave-libtool])
+AC_CONFIG_FILES([Makefile pkgconfig/Makefile libibverbs.spec shave shave-libtool])
 AC_OUTPUT
diff --git a/libibverbs.spec.in b/libibverbs.spec.in
index 6bd8c8e..91d487e 100644
--- a/libibverbs.spec.in
+++ b/libibverbs.spec.in
@@ -72,6 +72,7 @@ rm -rf $RPM_BUILD_ROOT
 %files devel
 %defattr(-,root,root,-)
 %{_libdir}/lib*.so
+%{_libdir}/pkgconfig/*.pc
 %{_includedir}/*
 %{_mandir}/man3/*
 
@@ -85,6 +86,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_mandir}/man1/*
 
 %changelog
+* Mon Jul 20 2008 Steven Dake <[email protected]> - 1.1.2-2
+- Add support for pkgconfig infrastructure.
+
 * Wed Apr 16 2008 Roland Dreier <[email protected]> - 1.1.2-1
 - New upstream release
 - Update description to mention RDMA and iWARP, not just InfiniBand
diff --git a/pkgconfig/Makefile.am b/pkgconfig/Makefile.am
new file mode 100644
index 0000000..de7e769
--- /dev/null
+++ b/pkgconfig/Makefile.am
@@ -0,0 +1,25 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+EXTRA_DIST		= ibverbs.pc.in
+
+target_LIBS = ibverbs.pc
+
+%.pc: ibverbs.pc.in Makefile
+	rm -f $...@-t $@
+	sed \
+		-e 's#@''pre...@#$(exec_prefix)#g' \
+		-e 's#@''lib...@#$(libdir)#g' \
+		-e 's#@''libvers...@#$(VERSION)#g' \
+		-e 's#@''l...@#'$(*:lib%=%)'#g' \
+	    $< > $...@-t
+	chmod a-w $...@-t
+	mv $...@-t $@
+
+all-local: $(target_LIBS)
+
+install-exec-local: $(target_LIBS)
+	$(INSTALL) -d $(DESTDIR)/$(libdir)/pkgconfig
+	$(INSTALL) -m 644 $(target_LIBS) $(DESTDIR)/$(libdir)/pkgconfig
+
+clean-local:
+	rm -f *.pc
diff --git a/pkgconfig/ibverbs.pc.in b/pkgconfig/ibverbs.pc.in
new file mode 100644
index 0000000..4a8a7e0
--- /dev/null
+++ b/pkgconfig/ibverbs.pc.in
@@ -0,0 +1,11 @@
+pref...@prefix@
+exec_prefix=${prefix}
+libd...@libdir@
+includedir=${prefix}/include
+
+Name: @LIB@
+Version: @LIBVERSION@
+Description: @LIB@
+Requires:
+Libs: -L${libdir} -...@lib@
+Cflags: -I${includedir}
-- 
1.6.2.2

_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to