aboutsummaryrefslogtreecommitdiff
blob: a870a5b70c763c9a0dc925871303d288fe7e3318 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
--- configure.in
+++ configure.in
@@ -22,6 +22,18 @@
     fi
 fi
 
+dnl Additional arguments (and substitutions)
+dnl Allow the pkg-config directory to be set
+AC_ARG_WITH(pkgconfigdir,
+        AC_HELP_STRING([--with-pkgconfigdir],
+        [Use the specified pkgconfig dir (default is libdir/pkgconfig)]),
+        [pkgconfigdir=${withval}],
+        [pkgconfigdir='${libdir}/pkgconfig'])
+
+AC_SUBST([pkgconfigdir])
+AC_MSG_NOTICE([pkgconfig directory is ${pkgconfigdir}])
+
+
 dnl Checks for programs
 AC_PROG_CC
 AC_PROG_LN_S
@@ -66,5 +78,5 @@
     AC_DEFINE([HAVE_SYMVER_SUPPORT], 1, [assembler has .symver support])
 fi
 
-AC_CONFIG_FILES([Makefile libibverbs.spec])
+AC_CONFIG_FILES([Makefile libibverbs.spec ibverbs.pc:ibverbs.pc.in])
 AC_OUTPUT
--- Makefile.am
+++ Makefile.am
@@ -1,5 +1,8 @@
 INCLUDES = -I$(srcdir)/include
 
+pkgconfigdir = @pkgconfigdir@
+pkgconfig_DATA = ibverbs.pc
+
 lib_LTLIBRARIES = src/libibverbs.la
 
 AM_CFLAGS = -g -Wall -D_GNU_SOURCE
--- /dev/null
+++ ibverbs.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: @PACKAGE_NAME@
+Version: @PACKAGE_VERSION@
+Description: @PACKAGE_STRING@
+Requires:
+Libs: -L${libdir} -libverbs
+Cflags: -I${includedir}