2 # Copyright (C) Igor Sysoev
5 cat << END >> $NGX_AUTO_HEADERS_H
14 CORE_INCS="$UNIX_INCS"
15 CORE_DEPS="$UNIX_DEPS $FREEBSD_DEPS"
16 CORE_SRCS="$UNIX_SRCS $FREEBSD_SRCS"
22 # __FreeBSD_version and sysctl kern.osreldate are the best ways
23 # to determine whether some capability exists and is safe to use.
24 # __FreeBSD_version is used for the testing of the build enviroment.
25 # sysctl kern.osreldate is used for the testing of the kernel capabilities.
27 version=`grep "#define __FreeBSD_version" /usr/include/osreldate.h \
28 | sed -e 's/^.* \(.*\)$/\1/'`
30 osreldate=`/sbin/sysctl -n kern.osreldate`
33 # setproctitle() in libutil
35 if [ \( $version -ge 500000 -a $version -lt 500012 \) \
36 -o $version -lt 410002 ]
38 echo " + setproctitle() in libutil"
40 CORE_LIBS="$CORE_LIBS -lutil"
45 if [ $osreldate -gt 300007 ]; then
46 echo " + using sendfile()"
48 have=NGX_HAVE_SENDFILE . auto/have
49 CORE_SRCS="$CORE_SRCS $FREEBSD_SENDFILE_SRCS"
55 if [ \( $osreldate -lt 500000 -a $osreldate -ge 410000 \) \
56 -o $osreldate -ge 500011 ]
58 echo " + using kqueue"
60 have=NGX_HAVE_KQUEUE . auto/have
61 have=NGX_HAVE_CLEAR_EVENT . auto/have
62 EVENT_MODULES="$EVENT_MODULES $KQUEUE_MODULE"
63 CORE_SRCS="$CORE_SRCS $KQUEUE_SRCS"
68 NGX_KQUEUE_CHECKED=YES
73 if [ \( $version -lt 500000 -a $version -ge 430000 \) \
74 -o $version -ge 500018 ]
76 echo " + using kqueue's NOTE_LOWAT"
77 have=NGX_HAVE_LOWAT_EVENT . auto/have
81 if [ $USE_THREADS = "rfork" ]; then
83 echo " + using rfork()"
85 # # kqueue's EVFILT_SIGNAL is safe
87 # if [ $version -gt 460101 ]; then
88 # echo " + kqueue's EVFILT_SIGNAL is safe"
89 # have=NGX_HAVE_SAFE_EVFILT_SIGNAL . auto/have
91 # echo "$0: error: the kqueue's EVFILT_SIGNAL is unsafe on this"
92 # echo "FreeBSD version, so --with-threads=rfork could not be used"
100 if [ $EVENT_AIO = YES ]; then
101 if [ \( $version -lt 500000 -a $version -ge 430000 \) \
102 -o $version -ge 500014 ]
104 have=NGX_HAVE_AIO . auto/have
105 EVENT_MODULES="$EVENT_MODULES $AIO_MODULE"
106 CORE_SRCS="$CORE_SRCS $AIO_SRCS"
111 $0: error: the kqueue does not support AIO on this FreeBSD version