2009-11-08 02:04:16 +00:00
|
|
|
program="libkqueue"
|
2011-02-12 22:15:46 +00:00
|
|
|
version="2.0a"
|
2010-04-03 16:18:42 +00:00
|
|
|
abi_major="0"
|
|
|
|
abi_minor="0"
|
|
|
|
abi_version="$abi_major.$abi_minor"
|
2011-05-22 00:28:35 +00:00
|
|
|
cflags="-Wall -Wextra -Wno-missing-field-initializers -Werror -g -O2 -std=c99 -D_XOPEN_SOURCE=600"
|
2010-04-03 16:18:42 +00:00
|
|
|
ldflags=""
|
2011-02-03 04:45:40 +00:00
|
|
|
sources="src/common/filter.c src/common/knote.c src/common/map.c
|
2009-11-25 00:28:12 +00:00
|
|
|
src/common/kevent.c src/common/kqueue.c"
|
2009-11-09 01:24:49 +00:00
|
|
|
libdepends=""
|
2011-03-07 04:46:46 +00:00
|
|
|
deps="src/common/private.h src/common/debug.h"
|
2009-11-08 02:04:16 +00:00
|
|
|
mans="kqueue.2"
|
2009-11-11 02:41:45 +00:00
|
|
|
headers="src/common/private.h"
|
|
|
|
extra_dist="*.in"
|
2009-11-08 02:04:16 +00:00
|
|
|
subdirs="src include test"
|
|
|
|
|
2009-11-16 03:54:47 +00:00
|
|
|
# Package metadata
|
|
|
|
pkg_summary="Emulates the kqueue and kevent system calls"
|
|
|
|
pkg_description="Emulates the kqueue and kevent system calls"
|
|
|
|
license="BSD"
|
|
|
|
author="Mark Heily"
|
|
|
|
|
2009-11-08 02:04:16 +00:00
|
|
|
pre_configure_hook() {
|
|
|
|
if [ "$debug" = "yes" ] ; then
|
2010-08-04 02:18:41 +00:00
|
|
|
cflags="$cflags -g3 -O0 -rdynamic"
|
2009-11-08 02:04:16 +00:00
|
|
|
fi
|
|
|
|
|
2011-04-23 18:27:10 +00:00
|
|
|
if [ "$target" != "windows" ] ; then
|
|
|
|
cflags="$cflags -fpic"
|
|
|
|
fi
|
|
|
|
|
2009-11-24 03:32:59 +00:00
|
|
|
optional_headers="err.h"
|
|
|
|
|
2009-11-18 01:22:29 +00:00
|
|
|
libdepends=" -L$libdir"
|
2009-11-08 02:04:16 +00:00
|
|
|
if [ $target = "linux" ] ; then
|
2010-09-15 02:37:42 +00:00
|
|
|
|
|
|
|
check_symbol sys/epoll.h EPOLLRDHUP
|
|
|
|
|
2011-04-23 18:27:10 +00:00
|
|
|
# TODO - note this as a GCC 4.X dependency
|
2010-07-27 01:18:41 +00:00
|
|
|
cflags="$cflags -fvisibility=hidden"
|
|
|
|
|
2009-11-09 01:24:49 +00:00
|
|
|
libdepends="$libdepends -lpthread -lrt"
|
2010-02-10 03:50:44 +00:00
|
|
|
required_headers="sys/epoll.h sys/inotify.h"
|
2010-02-11 04:13:04 +00:00
|
|
|
optional_headers="sys/signalfd.h sys/timerfd.h sys/eventfd.h"
|
2009-11-08 02:04:16 +00:00
|
|
|
fi
|
2010-07-28 00:18:12 +00:00
|
|
|
|
|
|
|
if [ $target = "solaris" ] ; then
|
|
|
|
cflags="$cflags -m64"
|
2010-08-11 11:42:04 +00:00
|
|
|
ldflags="$ldflags -m64"
|
2010-07-28 00:18:12 +00:00
|
|
|
libdepends="$libdepends -lsocket -lnsl"
|
|
|
|
fi
|
2009-11-08 02:04:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
post_configure_hook() {
|
|
|
|
finalize target "$target"
|
2009-11-19 03:38:32 +00:00
|
|
|
|
2011-01-17 19:23:30 +00:00
|
|
|
platform="src/posix/platform.c"
|
2010-09-15 02:27:57 +00:00
|
|
|
evfilt_signal="src/posix/signal.c"
|
2009-11-19 03:38:32 +00:00
|
|
|
evfilt_proc="src/$target/proc.c"
|
|
|
|
evfilt_socket="src/$target/socket.c"
|
2010-09-15 02:37:42 +00:00
|
|
|
evfilt_timer="src/posix/timer.c"
|
2010-07-27 01:40:32 +00:00
|
|
|
evfilt_user="src/posix/user.c"
|
2009-11-19 03:38:32 +00:00
|
|
|
evfilt_vnode="src/$target/vnode.c"
|
|
|
|
|
|
|
|
if [ $target = "linux" ] ; then
|
2011-02-01 02:40:59 +00:00
|
|
|
evfilt_user="src/linux/user.c"
|
2011-04-05 22:22:48 +00:00
|
|
|
evfilt_socket="src/linux/read.c src/linux/write.c"
|
2011-02-01 02:40:59 +00:00
|
|
|
|
|
|
|
#XXX-FIXME disabled
|
|
|
|
evfilt_proc=""
|
|
|
|
|
|
|
|
if [ "$have_sys_signalfd_h" = "yes" ] ; then
|
|
|
|
evfilt_signal="src/linux/signal.c"
|
|
|
|
fi
|
2010-09-15 02:37:42 +00:00
|
|
|
if [ "$have_sys_timerfd_h" = "yes" ] ; then
|
|
|
|
evfilt_timer="src/linux/timer.c"
|
2009-11-19 03:38:32 +00:00
|
|
|
fi
|
2011-01-17 19:23:30 +00:00
|
|
|
platform="$platform src/linux/platform.c"
|
2009-11-19 03:38:32 +00:00
|
|
|
fi
|
|
|
|
|
2010-07-27 01:18:41 +00:00
|
|
|
if [ $target = "solaris" ] ; then
|
|
|
|
cflags="$cflags -D__EXTENSIONS__"
|
2011-01-17 19:23:30 +00:00
|
|
|
platform="$platform src/solaris/platform.c"
|
2010-08-26 02:43:21 +00:00
|
|
|
evfilt_timer="src/solaris/timer.c"
|
2010-09-09 02:22:17 +00:00
|
|
|
evfilt_user="src/solaris/user.c"
|
2011-02-13 17:33:25 +00:00
|
|
|
evfilt_signal="src/solaris/signal.c"
|
2010-09-15 00:56:52 +00:00
|
|
|
evfilt_proc=""
|
|
|
|
evfilt_vnode=""
|
2010-07-27 01:18:41 +00:00
|
|
|
fi
|
|
|
|
|
2010-08-08 00:23:19 +00:00
|
|
|
# FIXME: This will compile but not actually work
|
|
|
|
if [ $target = "freebsd" ] ; then
|
|
|
|
evfilt_signal="src/posix/signal.c"
|
|
|
|
evfilt_proc=""
|
|
|
|
evfilt_socket=""
|
|
|
|
evfilt_timer=""
|
|
|
|
evfilt_vnode=""
|
|
|
|
fi
|
|
|
|
|
2011-04-23 18:27:10 +00:00
|
|
|
if [ $target = "windows" ] ; then
|
2011-05-10 01:30:02 +00:00
|
|
|
platform="src/windows/platform.c"
|
2011-04-25 02:50:54 +00:00
|
|
|
cflags="$cflags -march=i686 -lws2_32"
|
2011-04-23 18:27:10 +00:00
|
|
|
ldflags="$ldflags -march=i686"
|
2011-04-25 02:50:54 +00:00
|
|
|
ldadd="-lws2_32"
|
2011-04-23 18:27:10 +00:00
|
|
|
evfilt_proc=""
|
|
|
|
evfilt_signal=""
|
2011-04-25 02:50:54 +00:00
|
|
|
#evfilt_socket="src/windows/read.c src/linux/write.c"
|
|
|
|
evfilt_socket="src/windows/read.c"
|
2011-04-23 18:27:10 +00:00
|
|
|
evfilt_timer="src/windows/timer.c"
|
2011-04-29 23:47:51 +00:00
|
|
|
evfilt_user="src/windows/user.c"
|
2011-04-23 18:27:10 +00:00
|
|
|
evfilt_vnode=""
|
|
|
|
fi
|
|
|
|
|
2011-02-01 02:40:59 +00:00
|
|
|
sources="$sources $platform
|
2011-01-17 19:23:30 +00:00
|
|
|
$evfilt_signal $evfilt_proc
|
2009-11-24 03:32:59 +00:00
|
|
|
$evfilt_socket $evfilt_timer $evfilt_user $evfilt_vnode"
|
2009-11-08 02:04:16 +00:00
|
|
|
}
|