# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../libev/libev-4.04-pkgconfig-support.patch
# Copyright (C) 2011 - 2012 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---

From f8e5c8e988f78132ebcd1991c4936295ed998b50 Mon Sep 17 00:00:00 2001
From: Christian Wiese <chris@opensde.org>
Date: Tue, 16 Aug 2011 23:04:53 +0200
Subject: [PATCH] add pkgconfig support

---
 Makefile.am  |    3 ++-
 configure.ac |    5 ++++-
 libev.pc.in  |   11 +++++++++++
 3 files changed, 17 insertions(+), 2 deletions(-)
 create mode 100644 libev.pc.in

diff --git a/Makefile.am b/Makefile.am
index 058c2cb..fd14536 100644
--- a/Makefile.am
+++ a/Makefile.am
@@ -5,7 +5,7 @@
 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 Symbols.ev Symbols.event
+	     ev.3 ev.pod Symbols.ev Symbols.event libev.pc.in
 
 man_MANS = ev.3
 
@@ -16,5 +16,7 @@
 libev_la_SOURCES = ev.c event.c
 libev_la_LDFLAGS = -version-info $(VERSION_INFO)
 
+pkgconfig_DATA = libev.pc
+
 ev.3: ev.pod
 	pod2man -n LIBEV -r "libev-$(VERSION)" -c "libev - high performance full featured event loop" -s3 <$< >$@
diff --git a/configure.ac b/configure.ac
index 03a784f..6958226 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12,7 +12,10 @@ if test "x$GCC" = xyes ; then
   CFLAGS="-O3 $CFLAGS"
 fi
 
+pkgconfigdir='${libdir}/pkgconfig'
+AC_SUBST(pkgconfigdir)
+
 m4_include([libev.m4])
 
-AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([Makefile libev.pc])
 AC_OUTPUT
diff --git a/libev.pc.in b/libev.pc.in
new file mode 100644
index 0000000..333d8dd
--- /dev/null
+++ b/libev.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@prefix@
+libdir=${prefix}/lib
+includedir=${prefix}/include
+
+Name: libev
+Description: High-performance event loop/event model
+Version: @VERSION@
+Libs: -L${libdir} -lev
+Libs.private:
+Cflags: -I${includedir}
-- 
1.7.4.1