It's easy, here is :)

--
Daniel

2008/4/23 Nick Mathewson <[EMAIL PROTECTED]>:

> On Tue, Apr 22, 2008 at 11:00:29PM -0300, Daniel Morales wrote:
> > Hi all,
> >
> > Since libevent doesn't have a *.pc file to use with pkg-config, i need to
> > add some manual check to a configure.in.
>
> Hm!  pkg-config!  Yes, that's a good idea; we should support that in
> libevent 2.0 and later.  Would you like to write a patch to
> libevent to add pkg-config support?
>
> > Any example for libevent to share? :)
>
> You could just search for a header called event.h that defines
> event_init, and flags like -levent-core that defines event_init.
>
> If you want to abuse autoconf and look in a bunch of likely places for
> the headers and libraries, you could try to see what Tor does, but I'm
> afraid it's a little baroque.  Look in
>  https://www.torproject.org/svn/trunk/configure.in
> for mention of libevent, and in
>  https://www.torproject.org/svn/trunk/acinclude.m4
> for a definition of the TOR_SEARCH_LIBRARY macro.
>
> (Yes, this is an ugly and underdocumented hack.  Sorry.  All of it
> seemed important at the time.)
>
--- configure.in	2008-04-05 18:03:51.000000000 -0300
+++ configure.in	2008-05-09 09:45:20.000000000 -0300
@@ -382,4 +382,4 @@
 
 fi
 
-AC_OUTPUT(Makefile test/Makefile sample/Makefile)
+AC_OUTPUT(Makefile test/Makefile sample/Makefile libevent-1.0.pc)

--- libevent-1.0.pc.in
+++ libevent-1.0.pc.in	2008-05-09 09:30:59.000000000 -0300
@@ -0,0 +1,11 @@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
+
+Name: libevent
+Description: An asynchronous event notification library
+Version: @VERSION@
+Requires:
+Libs: -L${libdir} -levent
+Cflags: -I${includedir}

--- Makefile.am	2008-02-16 23:16:12.000000000 -0200
+++ Makefile.am	2008-05-09 09:46:49.000000000 -0300
@@ -32,6 +32,9 @@
 
 bin_SCRIPTS = event_rpcgen.py
 
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = libevent-1.0.pc
+
 EXTRA_DIST = autogen.sh event.h event-internal.h log.h evsignal.h evdns.3 \
 	evrpc.h evrpc-internal.h min_heap.h \
 	event.3 \
_______________________________________________
Libevent-users mailing list
Libevent-users@monkey.org
http://monkeymail.org/mailman/listinfo/libevent-users

Reply via email to