summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels Provos <provos@gmail.com>2009-04-17 00:24:58 +0000
committerNiels Provos <provos@gmail.com>2009-04-17 00:24:58 +0000
commitedfc28caef29a203deaef4c0b808ad8caa7fa012 (patch)
treec04d4273d5020a52bbfbe03519cb5b53728bdc73
parent0b987813537b74835a5c3990de756d35ea9b4fbc (diff)
downloadlibevent-edfc28caef29a203deaef4c0b808ad8caa7fa012.tar.gz
pkgconfig support from Ted Bullock
svn:r1177
-rw-r--r--Makefile.am6
-rw-r--r--configure.in9
-rw-r--r--libevent.pc.in15
3 files changed, 25 insertions, 5 deletions
diff --git a/Makefile.am b/Makefile.am
index 2f0357b4..394bc9cf 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -29,9 +29,13 @@ VERSION_INFO = 2:0:0
bin_SCRIPTS = event_rpcgen.py
+pkgconfigdir=$(libdir)/pkgconfig
+pkgconfig_DATA=libevent.pc
+
EXTRA_DIST = \
autogen.sh evdns.3 \
event.3 \
+ libevent.pc \
Doxyfile \
kqueue.c epoll_sub.c epoll.c select.c poll.c signal.c \
evport.c devpoll.c event_rpcgen.py \
@@ -131,4 +135,4 @@ doxygen: FORCE
doxygen $(srcdir)/Doxyfile
FORCE:
-DISTCLEANFILES = *~ event-config.h
+DISTCLEANFILES = *~ event-config.h libevent.pc
diff --git a/configure.in b/configure.in
index 6b084582..c5b7c671 100644
--- a/configure.in
+++ b/configure.in
@@ -40,10 +40,10 @@ dnl AC_DISABLE_SHARED
AC_SUBST(LIBTOOL_DEPS)
dnl Checks for libraries.
-AC_CHECK_LIB(socket, socket)
-AC_CHECK_LIB(resolv, inet_aton)
-AC_CHECK_LIB(rt, clock_gettime)
-AC_CHECK_LIB(nsl, inet_ntoa)
+AC_CHECK_LIB(socket, socket, [AC_SUBST( [LIBSOCKET], ["-lsocket"] )] )
+AC_CHECK_LIB(resolv, inet_aton, [AC_SUBST( [LIBRESOLV], ["-lresolv"] )] )
+AC_CHECK_LIB(rt, clock_gettime, [AC_SUBST( [LIBRT], ["-lrt"] )] )
+AC_CHECK_LIB(nsl, inet_ntoa, [AC_SUBST( [LIBNSL], ["-lnsl"] )] )
dnl Determine if we have zlib for regression tests
ZLIB_LIBS=""
@@ -453,4 +453,5 @@ if test x$enable_gcc_warnings = xyes; then
fi
+AC_CONFIG_FILES( [libevent.pc] )
AC_OUTPUT(Makefile include/Makefile test/Makefile sample/Makefile)
diff --git a/libevent.pc.in b/libevent.pc.in
new file mode 100644
index 00000000..79c38b19
--- /dev/null
+++ b/libevent.pc.in
@@ -0,0 +1,15 @@
+#libevent pkg-config source file
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: libevent
+Description: libevent is an asynchronous notification event loop library
+Version: @VERSION@
+Requires:
+Conflicts:
+Libs: -L${libdir} -levent @LIBSOCKET@ @LIBRESOLV@ @LIBRT@ @LIBNSL@ @ZLIB_LIBS@
+Cflags: -I${includedir}
+