Tizen 2.1 base
[platform/upstream/gcd.git] / kqueue-1.0.4 / config.inc
1 program="libkqueue"
2 version="1.0.4"
3 abi_major="0"
4 abi_minor="0"
5 abi_version="$abi_major.$abi_minor"
6 cflags="-g -O2"
7 ldflags=""
8 sources="src/common/filter.c src/common/knote.c 
9          src/common/kevent.c src/common/kqueue.c" 
10 libdepends=""
11 deps="src/common/private.h"
12 mans="kqueue.2"
13 headers="src/common/private.h"
14 extra_dist="*.in"
15 subdirs="src include test"
16
17 # Package metadata
18 pkg_summary="Emulates the kqueue and kevent system calls"
19 pkg_description="Emulates the kqueue and kevent system calls"
20 license="BSD"
21 author="Mark Heily"
22
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"
27   fi
28
29   optional_headers="err.h"
30
31   libdepends=" -L$libdir"
32   if [ $target = "linux" ] ; then
33
34       check_symbol sys/epoll.h EPOLLRDHUP
35
36       # Actually a GCC 4.X dependency
37       cflags="$cflags -fvisibility=hidden"
38
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"
42   fi
43
44   if [ $target = "solaris" ] ; then
45       cflags="$cflags -m64"
46       ldflags="$ldflags -m64"
47       libdepends="$libdepends -lsocket -lnsl"
48   fi
49 }
50
51 post_configure_hook() {
52     finalize target "$target"
53
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"
62
63     if [ $target = "linux" ] ; then
64       # FIXME: not tested
65       #if [ "$have_sys_signalfd_h" = "yes" ] ; then
66       #    evfilt_signal="src/linux/signal.c"
67       #fi
68       if [ "$have_sys_timerfd_h" = "yes" ] ; then
69           evfilt_timer="src/linux/timer.c"
70       fi
71       if [ "$have_sys_eventfd_h" = "yes" ] ; then
72           eventfd="src/linux/eventfd.c"
73       fi
74     fi      
75
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"
81           evfilt_proc=""
82           evfilt_vnode=""
83           eventfd=""
84     fi      
85
86     # FIXME: This will compile but not actually work
87     if [ $target = "freebsd" ] ; then
88           evfilt_signal="src/posix/signal.c"
89           evfilt_proc=""
90           evfilt_socket=""
91           evfilt_timer=""
92           evfilt_vnode=""
93     fi
94
95     sources="$sources $kevent $eventfd $evfilt_signal $evfilt_proc 
96              $evfilt_socket $evfilt_timer $evfilt_user $evfilt_vnode"
97 }