File: config.inc

package info (click to toggle)
libkqueue 0.9.2-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 508 kB
  • ctags: 614
  • sloc: ansic: 5,418; sh: 258; makefile: 202; perl: 22
file content (80 lines) | stat: -rw-r--r-- 2,302 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
program="libkqueue"
version="0.9.2"
abi_major="0"
abi_minor="0"
abi_version="$abi_major.$abi_minor"
cflags="-fpic -Wall -Werror -g -O2 -std=c99 -D_XOPEN_SOURCE=600"
ldflags=""
sources="src/common/filter.c src/common/knote.c 
         src/common/kevent.c src/common/kqueue.c" 
libdepends=""
deps="src/common/private.h"
mans="kqueue.2"
headers="src/common/private.h"
extra_dist="*.in"
subdirs="src include test"

# 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"

pre_configure_hook() {
  if [ "$debug" = "yes" ] ; then
      cflags="$cflags -g3 -O0 -rdynamic"
  fi

  optional_headers="err.h"

  libdepends=" -L$libdir"
  if [ $target = "linux" ] ; then
      # Actually a GCC 4.X dependency
      cflags="$cflags -fvisibility=hidden"

      libdepends="$libdepends -lpthread -lrt"
      required_headers="sys/epoll.h sys/inotify.h"
      optional_headers="sys/signalfd.h sys/timerfd.h sys/eventfd.h"
  fi

  if [ $target = "solaris" ] ; then
      cflags="$cflags -m64"
      libdepends="$libdepends -lsocket -lnsl"
  fi
}

post_configure_hook() {
    finalize target "$target"

    evfilt_signal="src/$target/signal.c"
    evfilt_proc="src/$target/proc.c"
    evfilt_socket="src/$target/socket.c"
    evfilt_timer="src/$target/timer.c"
    evfilt_user="src/posix/user.c"
    evfilt_vnode="src/$target/vnode.c"

    if [ $target = "linux" ] ; then
      if [ "$have_sys_signalfd_h" != "yes" ] ; then
          evfilt_signal="src/posix/signal.c"
      fi
          evfilt_signal="src/posix/signal.c" #XXX-FIXME TESTING
      if [ "$have_sys_timerfd_h" != "yes" ] ; then
          evfilt_timer="src/posix/timer.c"
      fi
      if [ "$have_sys_eventfd_h" != "yes" ] ; then
          sources="$sources src/posix/eventfd.c"
      else
          sources="$sources src/linux/eventfd.c"
      fi
    fi      

    if [ $target = "solaris" ] ; then
          cflags="$cflags -D__EXTENSIONS__"
          evfilt_signal="src/posix/signal.c"
          evfilt_timer="src/posix/timer.c"
          sources="$sources src/posix/eventfd.c"
    fi      

    sources="$sources src/posix/kevent.c $evfilt_signal $evfilt_proc 
             $evfilt_socket $evfilt_timer $evfilt_user $evfilt_vnode"
}