5 abi_version="$abi_major.$abi_minor"
8 sources="src/common/filter.c src/common/knote.c
9 src/common/kevent.c src/common/kqueue.c"
11 deps="src/common/private.h"
13 headers="src/common/private.h"
15 subdirs="src include test"
18 pkg_summary="Emulates the kqueue and kevent system calls"
19 pkg_description="Emulates the kqueue and kevent system calls"
23 pre_configure_hook() {
24 cflags="-fpic -Wall -std=c99 -D_XOPEN_SOURCE=600 -D_BSD_SOURCE $cflags"
25 if [ "$debug" = "yes" ] ; then
26 cflags="$cflags -g3 -O0 -rdynamic"
29 optional_headers="err.h"
31 libdepends=" -L$libdir"
32 if [ $target = "linux" ] ; then
34 check_symbol sys/epoll.h EPOLLRDHUP
36 # Actually a GCC 4.X dependency
37 cflags="$cflags -fvisibility=hidden"
39 libdepends="$libdepends -lpthread -lrt"
40 required_headers="sys/epoll.h sys/inotify.h"
41 optional_headers="sys/signalfd.h sys/timerfd.h sys/eventfd.h"
44 if [ $target = "solaris" ] ; then
46 ldflags="$ldflags -m64"
47 libdepends="$libdepends -lsocket -lnsl"
51 post_configure_hook() {
52 finalize target "$target"
54 kevent="src/posix/kevent.c"
55 evfilt_signal="src/posix/signal.c"
56 evfilt_proc="src/$target/proc.c"
57 evfilt_socket="src/$target/socket.c"
58 evfilt_timer="src/posix/timer.c"
59 evfilt_user="src/posix/user.c"
60 evfilt_vnode="src/$target/vnode.c"
61 eventfd="src/posix/eventfd.c"
63 if [ $target = "linux" ] ; then
65 #if [ "$have_sys_signalfd_h" = "yes" ] ; then
66 # evfilt_signal="src/linux/signal.c"
68 if [ "$have_sys_timerfd_h" = "yes" ] ; then
69 evfilt_timer="src/linux/timer.c"
71 if [ "$have_sys_eventfd_h" = "yes" ] ; then
72 eventfd="src/linux/eventfd.c"
76 if [ $target = "solaris" ] ; then
77 cflags="$cflags -D__EXTENSIONS__"
78 kevent="src/solaris/kevent.c"
79 evfilt_timer="src/solaris/timer.c"
80 evfilt_user="src/solaris/user.c"
86 # FIXME: This will compile but not actually work
87 if [ $target = "freebsd" ] ; then
88 evfilt_signal="src/posix/signal.c"
95 sources="$sources $kevent $eventfd $evfilt_signal $evfilt_proc
96 $evfilt_socket $evfilt_timer $evfilt_user $evfilt_vnode"