Subject: kqueue/kevent support glue for pkgsrc
To: None <>
From: Jaromir Dolecek <>
List: tech-pkg
Date: 11/09/2002 18:40:06
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII

I'd like to add some 'generic' support for checking whether
system supports kqueue/kevent to pkgsrc. This would be used by
packages which have optional kqueue support and lack autoconf.
One of examples would be future py-kqueue module. A 'generic'
mechanism would IMHO be better than each kqueue-using pkg doing
their own support check.
I was thinking about introducing a new PKG_ variable, which could
be set by if the interface is supported by the current
OS version.

I realize that it might be eventual goal to just use libevent,
which uses kqueue automatically if it's available. But I still
would like to have an easy way to check if specifically kqueue
is available.

The (short) patch to add proposed variable is appended to this e-mail.


Jaromir Dolecek <>  
-=- We should be mindful of the potential goal, but as the tantric    -=-
-=- Buddhist masters say, ``You may notice during meditation that you -=-
-=- sometimes levitate or glow.   Do not let this distract you.''     -=-

Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=ISO-8859-2
Content-Disposition: attachment; filename=pkgkq.diff

RCS file: /cvsroot/pkgsrc/mk/,v
retrieving revision 1.31
diff -u -p -r1.31
---	2002/10/23 12:21:30	1.31
+++	2002/11/09 17:39:04
@@ -135,3 +135,8 @@ CFLAGS+=	-mieee
 FFLAGS+=	-mieee
 .  endif    # MACHINE_PLATFORM
 .endfor     # __tmp__
+# check for kqueue(2) support, added in NetBSD-1.6J
+.if exists(/usr/include/sys/event.h)
+PKG_HAVE_KQUEUE=	# defined