nginx/auto/os/freebsd

118 lines
2.4 KiB
Plaintext
Raw Normal View History

2003-11-26 04:44:56 +08:00
# Copyright (C) Igor Sysoev
cat << END >> $NGX_AUTO_HEADERS_H
#ifndef NGX_FREEBSD
#define NGX_FREEBSD 1
#endif
END
2003-11-26 04:44:56 +08:00
CORE_INCS="$UNIX_INCS"
CORE_DEPS="$UNIX_DEPS $FREEBSD_DEPS"
2004-01-23 17:26:18 +08:00
CORE_SRCS="$UNIX_SRCS $FREEBSD_SRCS"
2003-11-26 04:44:56 +08:00
ngx_spacer='
'
2004-03-11 01:55:19 +08:00
2003-11-26 04:44:56 +08:00
# __FreeBSD_version and sysctl kern.osreldate are the best ways
# to determine whether some capability exists and is safe to use.
# __FreeBSD_version is used for the testing of the build enviroment.
# sysctl kern.osreldate is used for the testing of the kernel capabilities.
2004-02-18 01:53:12 +08:00
2003-11-26 04:44:56 +08:00
version=`grep "#define __FreeBSD_version" /usr/include/osreldate.h \
| sed -e 's/^.* \(.*\)$/\1/'`
osreldate=`/sbin/sysctl -n kern.osreldate`
2003-11-26 04:44:56 +08:00
2004-02-25 01:31:46 +08:00
# setproctitle() in libutil
if [ \( $version -ge 500000 -a $version -lt 500012 \) \
-o $version -lt 410002 ]
then
echo " + setproctitle() in libutil"
CORE_LIBS="$CORE_LIBS -lutil"
fi
2003-11-26 04:44:56 +08:00
# sendfile
if [ $osreldate -gt 300007 ]; then
2004-03-01 05:03:02 +08:00
echo " + using sendfile()"
2004-02-25 01:31:46 +08:00
have=NGX_HAVE_SENDFILE . auto/have
2003-11-26 04:44:56 +08:00
CORE_SRCS="$CORE_SRCS $FREEBSD_SENDFILE_SRCS"
fi
# kqueue
if [ \( $osreldate -lt 500000 -a $osreldate -ge 410000 \) \
-o $osreldate -ge 500011 ]
2003-11-26 04:44:56 +08:00
then
2004-03-01 05:03:02 +08:00
echo " + using kqueue"
2004-02-25 01:31:46 +08:00
have=NGX_HAVE_KQUEUE . auto/have
have=NGX_HAVE_CLEAR_EVENT . auto/have
2003-11-26 04:44:56 +08:00
EVENT_MODULES="$EVENT_MODULES $KQUEUE_MODULE"
2004-03-30 14:27:36 +08:00
CORE_SRCS="$CORE_SRCS $KQUEUE_SRCS"
2004-02-03 05:19:52 +08:00
EVENT_FOUND=YES
2003-11-26 04:44:56 +08:00
fi
NGX_KQUEUE_CHECKED=YES
2003-11-26 04:44:56 +08:00
# kqueue's NOTE_LAWAT
if [ \( $version -lt 500000 -a $version -ge 430000 \) \
-o $version -ge 500018 ]
then
2004-03-16 21:35:20 +08:00
echo " + using kqueue's NOTE_LOWAT"
have=NGX_HAVE_LOWAT_EVENT . auto/have
2004-02-03 05:19:52 +08:00
fi
2004-07-05 14:55:54 +08:00
if [ $USE_THREADS = "rfork" ]; then
echo " + using rfork()"
# # kqueue's EVFILT_SIGNAL is safe
#
# if [ $version -gt 460101 ]; then
# echo " + kqueue's EVFILT_SIGNAL is safe"
# have=NGX_HAVE_SAFE_EVFILT_SIGNAL . auto/have
# else
# echo "$0: error: the kqueue's EVFILT_SIGNAL is unsafe on this"
# echo "FreeBSD version, so --with-threads=rfork could not be used"
# echo
#
# exit 1
# fi
2004-07-05 14:55:54 +08:00
fi
2004-02-03 05:19:52 +08:00
if [ $EVENT_AIO = YES ]; then
if [ \( $version -lt 500000 -a $version -ge 430000 \) \
-o $version -ge 500014 ]
then
have=NGX_HAVE_AIO . auto/have
EVENT_MODULES="$EVENT_MODULES $AIO_MODULE"
CORE_SRCS="$CORE_SRCS $AIO_SRCS"
else
cat << END
$0: error: the kqueue does not support AIO on this FreeBSD version
END
exit 1
fi
2003-11-26 04:44:56 +08:00
fi