[PATCH] Add support for pkg-config

Julien Danjou julien at danjou.info
Thu Jan 8 15:25:25 CET 2009


Signed-off-by: Julien Danjou <julien at danjou.info>
---
 Makefile.am  |    3 ++-
 configure.ac |    5 ++++-
 ev.pc.in     |   13 +++++++++++++
 3 files changed, 19 insertions(+), 2 deletions(-)
 create mode 100644 ev.pc.in

diff --git a/Makefile.am b/Makefile.am
index 9a8239e..f9cf750 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,7 +5,7 @@ VERSION_INFO = 3:0
 EXTRA_DIST = LICENSE Changes libev.m4 autogen.sh \
 	     ev_vars.h ev_wrap.h \
 	     ev_epoll.c ev_select.c ev_poll.c ev_kqueue.c ev_port.c ev_win32.c \
-	     ev.3 ev.pod
+	     ev.3 ev.pod ev.pc.in
 
 man_MANS = ev.3
 
@@ -16,3 +16,4 @@ lib_LTLIBRARIES = libev.la
 libev_la_SOURCES = ev.c event.c
 libev_la_LDFLAGS = -version-info $(VERSION_INFO)
 
+pkgconfig_DATA = ev.pc
diff --git a/configure.ac b/configure.ac
index 9ca3759..8b45be8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12,7 +12,10 @@ if test "x$GCC" = xyes ; then
   CFLAGS="$CFLAGS -O3"
 fi
 
+pkgconfigdir='${libdir}/pkgconfig'
+AC_SUBST(pkgconfigdir)
+
 m4_include([libev.m4])
 
-AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([Makefile ev.pc])
 AC_OUTPUT
diff --git a/ev.pc.in b/ev.pc.in
new file mode 100644
index 0000000..5219091
--- /dev/null
+++ b/ev.pc.in
@@ -0,0 +1,13 @@
+prefix=@prefix@
+version=@VERSION@
+
+lib_name=ev
+libdir=${prefix}/lib
+includedir=${prefix}/include
+
+Name: Libev
+Description: high-performance event loop/event model
+Version: ${version}
+Requires:
+Libs: -L${libdir} -l${lib_name}
+Cflags: -I${includedir}/${lib_name}
-- 
1.6.0.6




More information about the libev mailing list