2003-11-25 14:44:56 -06:00
|
|
|
|
2004-09-29 11:00:49 -05:00
|
|
|
# Copyright (C) Igor Sysoev
|
2012-01-18 09:07:43 -06:00
|
|
|
# Copyright (C) Nginx, Inc.
|
2004-09-29 11:00:49 -05:00
|
|
|
|
|
|
|
|
2011-05-31 03:25:10 -05:00
|
|
|
NGX_USER=${NGX_USER:-nobody}
|
|
|
|
|
|
|
|
if [ -z "$NGX_GROUP" ]; then
|
|
|
|
if [ $NGX_USER = nobody ]; then
|
|
|
|
if grep nobody /etc/group 2>&1 >/dev/null; then
|
|
|
|
echo "checking for nobody group ... found"
|
|
|
|
NGX_GROUP=nobody
|
|
|
|
else
|
|
|
|
echo "checking for nobody group ... not found"
|
|
|
|
|
|
|
|
if grep nogroup /etc/group 2>&1 >/dev/null; then
|
|
|
|
echo "checking for nogroup group ... found"
|
|
|
|
NGX_GROUP=nogroup
|
|
|
|
else
|
|
|
|
echo "checking for nogroup group ... not found"
|
|
|
|
NGX_GROUP=nobody
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
NGX_GROUP=$NGX_USER
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
ngx_feature="poll()"
|
|
|
|
ngx_feature_name=
|
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <poll.h>"
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
2012-03-27 11:44:52 -05:00
|
|
|
ngx_feature_test="int n; struct pollfd pl;
|
2011-05-31 03:25:10 -05:00
|
|
|
pl.fd = 0;
|
|
|
|
pl.events = 0;
|
|
|
|
pl.revents = 0;
|
2012-03-27 11:44:52 -05:00
|
|
|
n = poll(&pl, 1, 0);
|
|
|
|
if (n == -1) return 1"
|
2011-05-31 03:25:10 -05:00
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
if [ $ngx_found = no ]; then
|
|
|
|
EVENT_POLL=NONE
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
ngx_feature="/dev/poll"
|
|
|
|
ngx_feature_name="NGX_HAVE_DEVPOLL"
|
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <sys/devpoll.h>"
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test="int n, dp; struct dvpoll dvp;
|
|
|
|
dp = 0;
|
|
|
|
dvp.dp_fds = NULL;
|
|
|
|
dvp.dp_nfds = 0;
|
|
|
|
dvp.dp_timeout = 0;
|
2012-03-27 11:44:52 -05:00
|
|
|
n = ioctl(dp, DP_POLL, &dvp);
|
|
|
|
if (n == -1) return 1"
|
2011-05-31 03:25:10 -05:00
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
if [ $ngx_found = yes ]; then
|
|
|
|
CORE_SRCS="$CORE_SRCS $DEVPOLL_SRCS"
|
|
|
|
EVENT_MODULES="$EVENT_MODULES $DEVPOLL_MODULE"
|
|
|
|
EVENT_FOUND=YES
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
if test -z "$NGX_KQUEUE_CHECKED"; then
|
|
|
|
ngx_feature="kqueue"
|
|
|
|
ngx_feature_name="NGX_HAVE_KQUEUE"
|
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <sys/event.h>"
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
2016-06-27 17:00:03 -05:00
|
|
|
ngx_feature_test="(void) kqueue()"
|
2011-05-31 03:25:10 -05:00
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
if [ $ngx_found = yes ]; then
|
|
|
|
|
|
|
|
have=NGX_HAVE_CLEAR_EVENT . auto/have
|
|
|
|
EVENT_MODULES="$EVENT_MODULES $KQUEUE_MODULE"
|
|
|
|
CORE_SRCS="$CORE_SRCS $KQUEUE_SRCS"
|
|
|
|
EVENT_FOUND=YES
|
|
|
|
|
|
|
|
ngx_feature="kqueue's NOTE_LOWAT"
|
|
|
|
ngx_feature_name="NGX_HAVE_LOWAT_EVENT"
|
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <sys/event.h>"
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test="struct kevent kev;
|
2016-06-27 17:00:03 -05:00
|
|
|
kev.fflags = NOTE_LOWAT;
|
|
|
|
(void) kev"
|
2011-05-31 03:25:10 -05:00
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
|
|
|
ngx_feature="kqueue's EVFILT_TIMER"
|
|
|
|
ngx_feature_name="NGX_HAVE_TIMER_EVENT"
|
|
|
|
ngx_feature_run=yes
|
|
|
|
ngx_feature_incs="#include <sys/event.h>
|
|
|
|
#include <sys/time.h>"
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test="int kq;
|
|
|
|
struct kevent kev;
|
|
|
|
struct timespec ts;
|
|
|
|
|
|
|
|
if ((kq = kqueue()) == -1) return 1;
|
|
|
|
|
|
|
|
kev.ident = 0;
|
|
|
|
kev.filter = EVFILT_TIMER;
|
|
|
|
kev.flags = EV_ADD|EV_ENABLE;
|
|
|
|
kev.fflags = 0;
|
|
|
|
kev.data = 1000;
|
|
|
|
kev.udata = 0;
|
|
|
|
|
|
|
|
ts.tv_sec = 0;
|
|
|
|
ts.tv_nsec = 0;
|
|
|
|
|
|
|
|
if (kevent(kq, &kev, 1, &kev, 1, &ts) == -1) return 1;
|
|
|
|
|
|
|
|
if (kev.flags & EV_ERROR) return 1;"
|
|
|
|
|
|
|
|
. auto/feature
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
if [ "$NGX_SYSTEM" = "NetBSD" ]; then
|
|
|
|
|
|
|
|
# NetBSD 2.0 incompatibly defines kevent.udata as "intptr_t"
|
|
|
|
|
|
|
|
cat << END >> $NGX_AUTO_CONFIG_H
|
|
|
|
|
|
|
|
#define NGX_KQUEUE_UDATA_T
|
|
|
|
|
|
|
|
END
|
|
|
|
|
|
|
|
else
|
|
|
|
cat << END >> $NGX_AUTO_CONFIG_H
|
|
|
|
|
|
|
|
#define NGX_KQUEUE_UDATA_T (void *)
|
|
|
|
|
|
|
|
END
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
ngx_feature="crypt()"
|
|
|
|
ngx_feature_name=
|
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs=
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test="crypt(\"test\", \"salt\");"
|
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
|
|
|
if [ $ngx_found = no ]; then
|
|
|
|
|
|
|
|
ngx_feature="crypt() in libcrypt"
|
|
|
|
ngx_feature_name=
|
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs=
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=-lcrypt
|
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
if [ $ngx_found = yes ]; then
|
|
|
|
CRYPT_LIB="-lcrypt"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
ngx_feature="F_READAHEAD"
|
|
|
|
ngx_feature_name="NGX_HAVE_F_READAHEAD"
|
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <fcntl.h>"
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test="fcntl(0, F_READAHEAD, 1);"
|
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
|
|
|
ngx_feature="posix_fadvise()"
|
|
|
|
ngx_feature_name="NGX_HAVE_POSIX_FADVISE"
|
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <fcntl.h>"
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test="posix_fadvise(0, 0, 0, POSIX_FADV_SEQUENTIAL);"
|
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
|
|
|
ngx_feature="O_DIRECT"
|
|
|
|
ngx_feature_name="NGX_HAVE_O_DIRECT"
|
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <fcntl.h>"
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test="fcntl(0, F_SETFL, O_DIRECT);"
|
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
|
|
|
if [ $ngx_found = yes -a "$NGX_SYSTEM" = "Linux" ]; then
|
|
|
|
have=NGX_HAVE_ALIGNED_DIRECTIO . auto/have
|
|
|
|
fi
|
|
|
|
|
|
|
|
ngx_feature="F_NOCACHE"
|
|
|
|
ngx_feature_name="NGX_HAVE_F_NOCACHE"
|
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <fcntl.h>"
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test="fcntl(0, F_NOCACHE, 1);"
|
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
|
|
|
ngx_feature="directio()"
|
|
|
|
ngx_feature_name="NGX_HAVE_DIRECTIO"
|
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <sys/types.h>
|
|
|
|
#include <sys/fcntl.h>"
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test="directio(0, DIRECTIO_ON);"
|
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
|
|
|
ngx_feature="statfs()"
|
|
|
|
ngx_feature_name="NGX_HAVE_STATFS"
|
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="$NGX_INCLUDE_SYS_PARAM_H
|
|
|
|
$NGX_INCLUDE_SYS_MOUNT_H
|
|
|
|
$NGX_INCLUDE_SYS_VFS_H"
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test="struct statfs fs;
|
2012-03-15 15:39:38 -05:00
|
|
|
statfs(\".\", &fs);"
|
2011-05-31 03:25:10 -05:00
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
|
|
|
ngx_feature="statvfs()"
|
|
|
|
ngx_feature_name="NGX_HAVE_STATVFS"
|
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <sys/types.h>
|
|
|
|
#include <sys/statvfs.h>"
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test="struct statvfs fs;
|
2012-03-15 15:39:38 -05:00
|
|
|
statvfs(\".\", &fs);"
|
2011-05-31 03:25:10 -05:00
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
|
|
|
ngx_feature="dlopen()"
|
2016-02-04 09:30:21 -06:00
|
|
|
ngx_feature_name="NGX_HAVE_DLOPEN"
|
2011-05-31 03:25:10 -05:00
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <dlfcn.h>"
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
2016-06-27 17:00:04 -05:00
|
|
|
ngx_feature_test="dlopen(NULL, RTLD_NOW | RTLD_GLOBAL); dlsym(NULL, \"\")"
|
2011-05-31 03:25:10 -05:00
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
2016-06-27 17:00:01 -05:00
|
|
|
if [ $ngx_found = no ]; then
|
2011-05-31 03:25:10 -05:00
|
|
|
|
|
|
|
ngx_feature="dlopen() in libdl"
|
|
|
|
ngx_feature_libs="-ldl"
|
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
if [ $ngx_found = yes ]; then
|
2016-02-04 09:30:21 -06:00
|
|
|
CORE_LIBS="$CORE_LIBS -ldl"
|
2016-02-18 02:39:57 -06:00
|
|
|
NGX_LIBDL="-ldl"
|
2011-05-31 03:25:10 -05:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
ngx_feature="sched_yield()"
|
|
|
|
ngx_feature_name="NGX_HAVE_SCHED_YIELD"
|
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <sched.h>"
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test="sched_yield()"
|
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
2016-06-27 17:00:01 -05:00
|
|
|
if [ $ngx_found = no ]; then
|
2011-05-31 03:25:10 -05:00
|
|
|
|
|
|
|
ngx_feature="sched_yield() in librt"
|
|
|
|
ngx_feature_libs="-lrt"
|
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
if [ $ngx_found = yes ]; then
|
|
|
|
CORE_LIBS="$CORE_LIBS -lrt"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2011-08-21 06:37:37 -05:00
|
|
|
|
2017-05-29 08:48:30 -05:00
|
|
|
ngx_feature="sched_setaffinity()"
|
|
|
|
ngx_feature_name="NGX_HAVE_SCHED_SETAFFINITY"
|
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <sched.h>"
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test="cpu_set_t mask;
|
|
|
|
CPU_ZERO(&mask);
|
|
|
|
sched_setaffinity(0, sizeof(cpu_set_t), &mask)"
|
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
2011-05-31 03:25:10 -05:00
|
|
|
ngx_feature="SO_SETFIB"
|
|
|
|
ngx_feature_name="NGX_HAVE_SETFIB"
|
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <sys/socket.h>"
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
2015-05-20 07:51:13 -05:00
|
|
|
ngx_feature_test="setsockopt(0, SOL_SOCKET, SO_SETFIB, NULL, 0)"
|
2011-05-31 03:25:10 -05:00
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
2015-05-20 07:51:56 -05:00
|
|
|
ngx_feature="SO_REUSEPORT"
|
|
|
|
ngx_feature_name="NGX_HAVE_REUSEPORT"
|
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <sys/socket.h>"
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test="setsockopt(0, SOL_SOCKET, SO_REUSEPORT, NULL, 0)"
|
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
2011-08-21 06:37:37 -05:00
|
|
|
ngx_feature="SO_ACCEPTFILTER"
|
|
|
|
ngx_feature_name="NGX_HAVE_DEFERRED_ACCEPT"
|
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <sys/socket.h>"
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test="setsockopt(0, SOL_SOCKET, SO_ACCEPTFILTER, NULL, 0)"
|
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
2017-12-07 08:09:36 -06:00
|
|
|
# OpenBSD bind to any address for transparent proxying
|
2015-12-18 10:05:27 -06:00
|
|
|
|
|
|
|
ngx_feature="SO_BINDANY"
|
|
|
|
ngx_feature_name="NGX_HAVE_TRANSPARENT_PROXY"
|
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <sys/socket.h>"
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test="setsockopt(0, SOL_SOCKET, SO_BINDANY, NULL, 0)"
|
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
2017-12-07 08:09:33 -06:00
|
|
|
# Linux transparent proxying
|
2016-06-20 02:41:17 -05:00
|
|
|
|
2017-12-07 08:09:33 -06:00
|
|
|
ngx_feature="IP_TRANSPARENT"
|
|
|
|
ngx_feature_name="NGX_HAVE_TRANSPARENT_PROXY"
|
2016-06-20 02:41:17 -05:00
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <sys/socket.h>
|
|
|
|
#include <netinet/in.h>"
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
2017-12-07 08:09:33 -06:00
|
|
|
ngx_feature_test="setsockopt(0, IPPROTO_IP, IP_TRANSPARENT, NULL, 0)"
|
2016-06-20 02:41:17 -05:00
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
2017-12-07 08:09:33 -06:00
|
|
|
# FreeBSD bind to any address for transparent proxying
|
2015-12-18 10:05:27 -06:00
|
|
|
|
2017-12-07 08:09:33 -06:00
|
|
|
ngx_feature="IP_BINDANY"
|
2015-12-18 10:05:27 -06:00
|
|
|
ngx_feature_name="NGX_HAVE_TRANSPARENT_PROXY"
|
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <sys/socket.h>
|
|
|
|
#include <netinet/in.h>"
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
2017-12-07 08:09:33 -06:00
|
|
|
ngx_feature_test="setsockopt(0, IPPROTO_IP, IP_BINDANY, NULL, 0)"
|
2015-12-18 10:05:27 -06:00
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
2017-12-07 08:09:33 -06:00
|
|
|
# Linux IP_BIND_ADDRESS_NO_PORT
|
2015-12-18 10:05:27 -06:00
|
|
|
|
2017-12-07 08:09:33 -06:00
|
|
|
ngx_feature="IP_BIND_ADDRESS_NO_PORT"
|
|
|
|
ngx_feature_name="NGX_HAVE_IP_BIND_ADDRESS_NO_PORT"
|
2015-12-18 10:05:27 -06:00
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <sys/socket.h>
|
|
|
|
#include <netinet/in.h>"
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
2017-12-07 08:09:33 -06:00
|
|
|
ngx_feature_test="setsockopt(0, IPPROTO_IP, IP_BIND_ADDRESS_NO_PORT, NULL, 0)"
|
2015-12-18 10:05:27 -06:00
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
2016-01-20 10:52:12 -06:00
|
|
|
# BSD way to get IPv4 datagram destination address
|
|
|
|
|
|
|
|
ngx_feature="IP_RECVDSTADDR"
|
|
|
|
ngx_feature_name="NGX_HAVE_IP_RECVDSTADDR"
|
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <sys/socket.h>
|
|
|
|
#include <netinet/in.h>"
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test="setsockopt(0, IPPROTO_IP, IP_RECVDSTADDR, NULL, 0)"
|
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
2017-04-11 08:41:53 -05:00
|
|
|
# BSD way to set IPv4 datagram source address
|
|
|
|
|
|
|
|
ngx_feature="IP_SENDSRCADDR"
|
|
|
|
ngx_feature_name="NGX_HAVE_IP_SENDSRCADDR"
|
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <sys/socket.h>
|
|
|
|
#include <netinet/in.h>"
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test="setsockopt(0, IPPROTO_IP, IP_SENDSRCADDR, NULL, 0)"
|
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
2016-01-20 10:52:12 -06:00
|
|
|
# Linux way to get IPv4 datagram destination address
|
|
|
|
|
|
|
|
ngx_feature="IP_PKTINFO"
|
|
|
|
ngx_feature_name="NGX_HAVE_IP_PKTINFO"
|
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <sys/socket.h>
|
|
|
|
#include <netinet/in.h>"
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
2017-06-01 07:44:23 -05:00
|
|
|
ngx_feature_test="struct in_pktinfo pkt;
|
|
|
|
pkt.ipi_spec_dst.s_addr = INADDR_ANY;
|
|
|
|
(void) pkt;
|
|
|
|
setsockopt(0, IPPROTO_IP, IP_PKTINFO, NULL, 0)"
|
2016-01-20 10:52:12 -06:00
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
|
|
|
# RFC 3542 way to get IPv6 datagram destination address
|
|
|
|
|
|
|
|
ngx_feature="IPV6_RECVPKTINFO"
|
|
|
|
ngx_feature_name="NGX_HAVE_IPV6_RECVPKTINFO"
|
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <sys/socket.h>
|
|
|
|
#include <netinet/in.h>"
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test="setsockopt(0, IPPROTO_IPV6, IPV6_RECVPKTINFO, NULL, 0)"
|
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
2011-08-21 06:37:37 -05:00
|
|
|
ngx_feature="TCP_DEFER_ACCEPT"
|
|
|
|
ngx_feature_name="NGX_HAVE_DEFERRED_ACCEPT"
|
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <sys/socket.h>
|
|
|
|
#include <netinet/in.h>
|
|
|
|
#include <netinet/tcp.h>"
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test="setsockopt(0, IPPROTO_TCP, TCP_DEFER_ACCEPT, NULL, 0)"
|
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
2013-09-04 12:17:05 -05:00
|
|
|
ngx_feature="TCP_KEEPIDLE"
|
2011-12-05 02:06:15 -06:00
|
|
|
ngx_feature_name="NGX_HAVE_KEEPALIVE_TUNABLE"
|
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <sys/socket.h>
|
|
|
|
#include <netinet/in.h>
|
|
|
|
#include <netinet/tcp.h>"
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test="setsockopt(0, IPPROTO_TCP, TCP_KEEPIDLE, NULL, 0);
|
|
|
|
setsockopt(0, IPPROTO_TCP, TCP_KEEPINTVL, NULL, 0);
|
|
|
|
setsockopt(0, IPPROTO_TCP, TCP_KEEPCNT, NULL, 0)"
|
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
2013-12-03 12:07:03 -06:00
|
|
|
ngx_feature="TCP_FASTOPEN"
|
|
|
|
ngx_feature_name="NGX_HAVE_TCP_FASTOPEN"
|
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <sys/socket.h>
|
|
|
|
#include <netinet/in.h>
|
|
|
|
#include <netinet/tcp.h>"
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test="setsockopt(0, IPPROTO_TCP, TCP_FASTOPEN, NULL, 0)"
|
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
2012-03-16 14:15:33 -05:00
|
|
|
ngx_feature="TCP_INFO"
|
|
|
|
ngx_feature_name="NGX_HAVE_TCP_INFO"
|
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <sys/socket.h>
|
|
|
|
#include <netinet/in.h>
|
|
|
|
#include <netinet/tcp.h>"
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test="socklen_t optlen = sizeof(struct tcp_info);
|
2012-03-21 10:35:05 -05:00
|
|
|
struct tcp_info ti;
|
|
|
|
ti.tcpi_rtt = 0;
|
|
|
|
ti.tcpi_rttvar = 0;
|
|
|
|
ti.tcpi_snd_cwnd = 0;
|
|
|
|
ti.tcpi_rcv_space = 0;
|
2012-03-27 11:44:52 -05:00
|
|
|
getsockopt(0, IPPROTO_TCP, TCP_INFO, &ti, &optlen)"
|
2012-03-16 14:15:33 -05:00
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
2011-05-31 03:25:10 -05:00
|
|
|
ngx_feature="accept4()"
|
|
|
|
ngx_feature_name="NGX_HAVE_ACCEPT4"
|
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <sys/socket.h>"
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test="accept4(0, NULL, NULL, SOCK_NONBLOCK)"
|
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
if [ $NGX_FILE_AIO = YES ]; then
|
|
|
|
|
|
|
|
ngx_feature="kqueue AIO support"
|
|
|
|
ngx_feature_name="NGX_HAVE_FILE_AIO"
|
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <aio.h>"
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
2016-06-27 17:00:03 -05:00
|
|
|
ngx_feature_test="struct aiocb iocb;
|
2011-05-31 03:25:10 -05:00
|
|
|
iocb.aio_sigevent.sigev_notify = SIGEV_KEVENT;
|
2016-06-27 17:00:03 -05:00
|
|
|
(void) aio_read(&iocb)"
|
2011-05-31 03:25:10 -05:00
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
if [ $ngx_found = yes ]; then
|
|
|
|
CORE_SRCS="$CORE_SRCS $FILE_AIO_SRCS"
|
2014-05-23 07:37:05 -05:00
|
|
|
fi
|
2011-05-31 03:25:10 -05:00
|
|
|
|
2014-05-23 07:37:05 -05:00
|
|
|
if [ $ngx_found = no ]; then
|
2011-05-31 03:25:10 -05:00
|
|
|
|
|
|
|
ngx_feature="Linux AIO support"
|
|
|
|
ngx_feature_name="NGX_HAVE_FILE_AIO"
|
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <linux/aio_abi.h>
|
2014-05-23 07:37:05 -05:00
|
|
|
#include <sys/eventfd.h>"
|
2011-05-31 03:25:10 -05:00
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
2014-05-23 07:37:05 -05:00
|
|
|
ngx_feature_test="struct iocb iocb;
|
|
|
|
iocb.aio_lio_opcode = IOCB_CMD_PREAD;
|
|
|
|
iocb.aio_flags = IOCB_FLAG_RESFD;
|
|
|
|
iocb.aio_resfd = -1;
|
2016-06-27 17:00:03 -05:00
|
|
|
(void) iocb;
|
2014-05-23 07:37:05 -05:00
|
|
|
(void) eventfd(0, 0)"
|
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
if [ $ngx_found = yes ]; then
|
|
|
|
have=NGX_HAVE_EVENTFD . auto/have
|
|
|
|
have=NGX_HAVE_SYS_EVENTFD_H . auto/have
|
|
|
|
CORE_SRCS="$CORE_SRCS $LINUX_AIO_SRCS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $ngx_found = no ]; then
|
|
|
|
|
|
|
|
ngx_feature="Linux AIO support (SYS_eventfd)"
|
|
|
|
ngx_feature_incs="#include <linux/aio_abi.h>
|
|
|
|
#include <sys/syscall.h>"
|
2016-06-27 17:00:03 -05:00
|
|
|
ngx_feature_test="struct iocb iocb;
|
2011-05-31 03:25:10 -05:00
|
|
|
iocb.aio_lio_opcode = IOCB_CMD_PREAD;
|
|
|
|
iocb.aio_flags = IOCB_FLAG_RESFD;
|
2016-06-27 17:00:03 -05:00
|
|
|
iocb.aio_resfd = -1;
|
|
|
|
(void) iocb;
|
|
|
|
(void) SYS_eventfd"
|
2011-05-31 03:25:10 -05:00
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
if [ $ngx_found = yes ]; then
|
|
|
|
have=NGX_HAVE_EVENTFD . auto/have
|
|
|
|
CORE_SRCS="$CORE_SRCS $LINUX_AIO_SRCS"
|
2014-05-23 07:37:05 -05:00
|
|
|
fi
|
|
|
|
fi
|
2011-05-31 03:25:10 -05:00
|
|
|
|
2014-05-23 07:37:05 -05:00
|
|
|
if [ $ngx_found = no ]; then
|
|
|
|
cat << END
|
2011-05-31 03:25:10 -05:00
|
|
|
|
|
|
|
$0: no supported file AIO was found
|
|
|
|
Currently file AIO is supported on FreeBSD 4.3+ and Linux 2.6.22+ only
|
|
|
|
|
|
|
|
END
|
2014-05-23 07:37:05 -05:00
|
|
|
exit 1
|
2011-05-31 03:25:10 -05:00
|
|
|
fi
|
2015-03-14 09:37:13 -05:00
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
ngx_feature="eventfd()"
|
|
|
|
ngx_feature_name="NGX_HAVE_EVENTFD"
|
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <sys/eventfd.h>"
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test="(void) eventfd(0, 0)"
|
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
if [ $ngx_found = yes ]; then
|
|
|
|
have=NGX_HAVE_SYS_EVENTFD_H . auto/have
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $ngx_found = no ]; then
|
|
|
|
|
|
|
|
ngx_feature="eventfd() (SYS_eventfd)"
|
|
|
|
ngx_feature_incs="#include <sys/syscall.h>"
|
2016-06-27 17:00:03 -05:00
|
|
|
ngx_feature_test="(void) SYS_eventfd"
|
2015-03-14 09:37:13 -05:00
|
|
|
. auto/feature
|
|
|
|
fi
|
2011-05-31 03:25:10 -05:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
nginx-0.1.14-RELEASE import
*) Feature: the autoconfiguration directives:
--http-client-body-temp-path=PATH, --http-proxy-temp-path=PATH, and
--http-fastcgi-temp-path=PATH
*) Change: the directory name for the temporary files with the client
request body is specified by directive client_body_temp_path, by
default it is <prefix>/client_body_temp.
*) Feature: the ngx_http_fastcgi_module and the directives:
fastcgi_pass, fastcgi_root, fastcgi_index, fastcgi_params,
fastcgi_connect_timeout, fastcgi_send_timeout, fastcgi_read_timeout,
fastcgi_send_lowat, fastcgi_header_buffer_size, fastcgi_buffers,
fastcgi_busy_buffers_size, fastcgi_temp_path,
fastcgi_max_temp_file_size, fastcgi_temp_file_write_size,
fastcgi_next_upstream, and fastcgi_x_powered_by.
*) Bugfix: the "[alert] zero size buf" error; the bug had appeared in
0.1.3.
*) Change: the URI must be specified after the host name in the
proxy_pass directive.
*) Change: the %3F symbol in the URI was considered as the argument
string start.
*) Feature: the unix domain sockets support in the
ngx_http_proxy_module.
*) Feature: the ssl_engine and ssl_ciphers directives.
Thanks to Sergey Skvortsov for SSL-accelerator.
2005-01-18 07:03:58 -06:00
|
|
|
have=NGX_HAVE_UNIX_DOMAIN . auto/have
|
|
|
|
|
2005-12-05 07:18:09 -06:00
|
|
|
ngx_feature_libs=
|
2003-11-25 14:44:56 -06:00
|
|
|
|
2005-02-22 08:40:13 -06:00
|
|
|
|
2003-11-26 09:42:18 -06:00
|
|
|
# C types
|
|
|
|
|
2004-02-24 11:31:46 -06:00
|
|
|
ngx_type="int"; . auto/types/sizeof
|
2003-11-25 14:44:56 -06:00
|
|
|
|
2004-02-24 11:31:46 -06:00
|
|
|
ngx_type="long"; . auto/types/sizeof
|
2003-11-25 14:44:56 -06:00
|
|
|
|
2004-02-24 11:31:46 -06:00
|
|
|
ngx_type="long long"; . auto/types/sizeof
|
2003-11-25 14:44:56 -06:00
|
|
|
|
2004-06-27 13:01:57 -05:00
|
|
|
ngx_type="void *"; . auto/types/sizeof; ngx_ptr_size=$ngx_size
|
2005-02-22 08:40:13 -06:00
|
|
|
ngx_param=NGX_PTR_SIZE; ngx_value=$ngx_size; . auto/types/value
|
2003-11-25 14:44:56 -06:00
|
|
|
|
|
|
|
|
2004-02-09 01:46:43 -06:00
|
|
|
# POSIX types
|
2003-11-26 09:42:18 -06:00
|
|
|
|
2015-06-17 06:15:27 -05:00
|
|
|
NGX_INCLUDE_AUTO_CONFIG_H="#include \"ngx_auto_config.h\""
|
2003-11-26 09:42:18 -06:00
|
|
|
|
2016-04-01 08:38:31 -05:00
|
|
|
ngx_type="uint32_t"; ngx_types="u_int32_t"; . auto/types/typedef
|
2004-06-27 13:01:57 -05:00
|
|
|
ngx_type="uint64_t"; ngx_types="u_int64_t"; . auto/types/typedef
|
2003-11-26 09:42:18 -06:00
|
|
|
|
2004-06-27 13:01:57 -05:00
|
|
|
ngx_type="sig_atomic_t"; ngx_types="int"; . auto/types/typedef
|
|
|
|
. auto/types/sizeof
|
2004-12-21 06:30:30 -06:00
|
|
|
ngx_param=NGX_SIG_ATOMIC_T_SIZE; ngx_value=$ngx_size; . auto/types/value
|
2004-02-05 10:58:36 -06:00
|
|
|
|
2005-05-19 08:25:22 -05:00
|
|
|
ngx_type="socklen_t"; ngx_types="int"; . auto/types/typedef
|
2003-11-26 09:42:18 -06:00
|
|
|
|
2016-04-01 08:38:31 -05:00
|
|
|
ngx_type="in_addr_t"; ngx_types="uint32_t u_int32_t"; . auto/types/typedef
|
2003-11-26 09:42:18 -06:00
|
|
|
|
2004-09-07 10:29:22 -05:00
|
|
|
ngx_type="in_port_t"; ngx_types="u_short"; . auto/types/typedef
|
|
|
|
|
2004-06-27 13:01:57 -05:00
|
|
|
ngx_type="rlim_t"; ngx_types="int"; . auto/types/typedef
|
2003-11-26 09:42:18 -06:00
|
|
|
|
|
|
|
. auto/types/uintptr_t
|
|
|
|
|
2012-06-08 04:41:55 -05:00
|
|
|
. auto/endianness
|
2004-06-27 13:01:57 -05:00
|
|
|
|
2004-12-02 12:40:46 -06:00
|
|
|
ngx_type="size_t"; . auto/types/sizeof
|
2004-12-21 06:30:30 -06:00
|
|
|
ngx_param=NGX_MAX_SIZE_T_VALUE; ngx_value=$ngx_max_value; . auto/types/value
|
|
|
|
ngx_param=NGX_SIZE_T_LEN; ngx_value=$ngx_max_len; . auto/types/value
|
2003-11-26 09:42:18 -06:00
|
|
|
|
2004-12-02 12:40:46 -06:00
|
|
|
ngx_type="off_t"; . auto/types/sizeof
|
2004-12-21 06:30:30 -06:00
|
|
|
ngx_param=NGX_MAX_OFF_T_VALUE; ngx_value=$ngx_max_value; . auto/types/value
|
|
|
|
ngx_param=NGX_OFF_T_LEN; ngx_value=$ngx_max_len; . auto/types/value
|
2003-11-26 09:42:18 -06:00
|
|
|
|
2004-12-02 12:40:46 -06:00
|
|
|
ngx_type="time_t"; . auto/types/sizeof
|
2004-12-21 06:30:30 -06:00
|
|
|
ngx_param=NGX_TIME_T_SIZE; ngx_value=$ngx_size; . auto/types/value
|
|
|
|
ngx_param=NGX_TIME_T_LEN; ngx_value=$ngx_max_len; . auto/types/value
|
2015-03-16 16:24:34 -05:00
|
|
|
ngx_param=NGX_MAX_TIME_T_VALUE; ngx_value=$ngx_max_value; . auto/types/value
|
2003-11-25 14:44:56 -06:00
|
|
|
|
|
|
|
|
2004-06-17 12:18:53 -05:00
|
|
|
# syscalls, libc calls and some features
|
|
|
|
|
2003-11-25 14:44:56 -06:00
|
|
|
|
2016-10-04 08:38:14 -05:00
|
|
|
ngx_feature="AF_INET6"
|
|
|
|
ngx_feature_name="NGX_HAVE_INET6"
|
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <sys/socket.h>
|
|
|
|
#include <netinet/in.h>
|
|
|
|
#include <arpa/inet.h>"
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test="struct sockaddr_in6 sin6;
|
|
|
|
sin6.sin6_family = AF_INET6;
|
|
|
|
(void) sin6"
|
|
|
|
. auto/feature
|
2009-02-21 01:02:02 -06:00
|
|
|
|
|
|
|
|
2004-11-20 13:52:20 -06:00
|
|
|
ngx_feature="setproctitle()"
|
2004-11-25 10:17:31 -06:00
|
|
|
ngx_feature_name="NGX_HAVE_SETPROCTITLE"
|
2004-11-20 13:52:20 -06:00
|
|
|
ngx_feature_run=no
|
2012-03-15 15:39:38 -05:00
|
|
|
ngx_feature_incs="#include <stdlib.h>"
|
2006-11-27 05:07:09 -06:00
|
|
|
ngx_feature_path=
|
nginx-0.1.29-RELEASE import
*) Feature: the ngx_http_ssi_module supports "include virtual" command.
*) Feature: the ngx_http_ssi_module supports the condition command like
'if expr="$NAME"' and "else" and "endif" commands. Only one nested
level is supported.
*) Feature: the ngx_http_ssi_module supports the DATE_LOCAL and
DATE_GMT variables and "config timefmt" command.
*) Feature: the "ssi_ignore_recycled_buffers" directive.
*) Bugfix: the "echo" command did not show the default value for the
empty QUERY_STRING variable.
*) Change: the ngx_http_proxy_module was rewritten.
*) Feature: the "proxy_redirect", "proxy_pass_request_headers",
"proxy_pass_request_body", and "proxy_method" directives.
*) Feature: the "proxy_set_header" directive. The "proxy_x_var" was
canceled and must be replaced with the proxy_set_header directive.
*) Change: the "proxy_preserve_host" is canceled and must be replaced
with the "proxy_set_header Host $host" and the "proxy_redirect off"
directives, the "proxy_set_header Host $host:$proxy_port" directive
and the appropriate proxy_redirect directives.
*) Change: the "proxy_set_x_real_ip" is canceled and must be replaced
with the "proxy_set_header X-Real-IP $remote_addr" directive.
*) Change: the "proxy_add_x_forwarded_for" is canceled and must be
replaced with
the "proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for"
directive.
*) Change: the "proxy_set_x_url" is canceled and must be replaced with
the "proxy_set_header X-URL http://$host:$server_port$request_uri"
directive.
*) Feature: the "fastcgi_param" directive.
*) Change: the "fastcgi_root", "fastcgi_set_var" and "fastcgi_params"
directive are canceled and must be replaced with the fastcgi_param
directives.
*) Feature: the "index" directive can use the variables.
*) Feature: the "index" directive can be used at http and server levels.
*) Change: the last index only in the "index" directive can be absolute.
*) Feature: the "rewrite" directive can use the variables.
*) Feature: the "internal" directive.
*) Feature: the CONTENT_LENGTH, CONTENT_TYPE, REMOTE_PORT, SERVER_ADDR,
SERVER_PORT, SERVER_PROTOCOL, DOCUMENT_ROOT, SERVER_NAME,
REQUEST_METHOD, REQUEST_URI, and REMOTE_USER variables.
*) Change: nginx now passes the invalid lines in a client request
headers or a backend response header.
*) Bugfix: if the backend did not transfer response for a long time and
the "send_timeout" was less than "proxy_read_timeout", then nginx
returned the 408 response.
*) Bugfix: the segmentation fault was occurred if the backend sent an
invalid line in response header; the bug had appeared in 0.1.26.
*) Bugfix: the segmentation fault may occurred in FastCGI fault
tolerance configuration.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" and "Cache-Control" headers.
*) Bugfix: nginx did not take into account trailing dot in "Host"
header line.
*) Bugfix: the ngx_http_auth_module did not work under Linux.
*) Bugfix: the rewrite directive worked incorrectly, if the arguments
were in a request.
*) Bugfix: nginx could not be built on MacOS X.
2005-05-12 09:58:06 -05:00
|
|
|
ngx_feature_libs=$NGX_SETPROCTITLE_LIB
|
2004-11-20 13:52:20 -06:00
|
|
|
ngx_feature_test="setproctitle(\"test\");"
|
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
2004-10-21 10:34:38 -05:00
|
|
|
ngx_feature="pread()"
|
2004-11-25 10:17:31 -06:00
|
|
|
ngx_feature_name="NGX_HAVE_PREAD"
|
2004-10-21 10:34:38 -05:00
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs=
|
2006-11-27 05:07:09 -06:00
|
|
|
ngx_feature_path=
|
2004-10-21 10:34:38 -05:00
|
|
|
ngx_feature_libs=
|
2012-03-27 11:44:52 -05:00
|
|
|
ngx_feature_test="char buf[1]; ssize_t n; n = pread(0, buf, 1, 0);
|
|
|
|
if (n == -1) return 1"
|
2004-10-21 10:34:38 -05:00
|
|
|
. auto/feature
|
2003-11-25 14:44:56 -06:00
|
|
|
|
|
|
|
|
2004-10-21 10:34:38 -05:00
|
|
|
ngx_feature="pwrite()"
|
2004-11-25 10:17:31 -06:00
|
|
|
ngx_feature_name="NGX_HAVE_PWRITE"
|
2004-10-21 10:34:38 -05:00
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs=
|
2006-11-27 05:07:09 -06:00
|
|
|
ngx_feature_path=
|
2004-10-21 10:34:38 -05:00
|
|
|
ngx_feature_libs=
|
2012-03-27 11:44:52 -05:00
|
|
|
ngx_feature_test="char buf[1]; ssize_t n; n = pwrite(1, buf, 1, 0);
|
|
|
|
if (n == -1) return 1"
|
2015-11-17 10:01:41 -06:00
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
|
|
|
# pwritev() was introduced in FreeBSD 6 and Linux 2.6.30, glibc 2.10
|
|
|
|
|
|
|
|
ngx_feature="pwritev()"
|
|
|
|
ngx_feature_name="NGX_HAVE_PWRITEV"
|
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs='#include <sys/uio.h>'
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test="char buf[1]; struct iovec vec[1]; ssize_t n;
|
|
|
|
vec[0].iov_base = buf;
|
|
|
|
vec[0].iov_len = 1;
|
|
|
|
n = pwritev(1, vec, 1, 0);
|
|
|
|
if (n == -1) return 1"
|
2004-10-21 10:34:38 -05:00
|
|
|
. auto/feature
|
2003-11-25 14:44:56 -06:00
|
|
|
|
2003-12-19 02:15:11 -06:00
|
|
|
|
2010-11-25 05:04:03 -06:00
|
|
|
ngx_feature="sys_nerr"
|
|
|
|
ngx_feature_name="NGX_SYS_NERR"
|
|
|
|
ngx_feature_run=value
|
2011-11-21 05:51:41 -06:00
|
|
|
ngx_feature_incs='#include <errno.h>
|
|
|
|
#include <stdio.h>'
|
2006-11-27 05:07:09 -06:00
|
|
|
ngx_feature_path=
|
2004-10-21 10:34:38 -05:00
|
|
|
ngx_feature_libs=
|
2010-11-25 05:04:03 -06:00
|
|
|
ngx_feature_test='printf("%d", sys_nerr);'
|
2010-03-12 05:15:26 -06:00
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
2010-12-06 08:49:17 -06:00
|
|
|
if [ $ngx_found = no ]; then
|
2010-12-06 08:50:27 -06:00
|
|
|
|
2010-12-06 08:49:17 -06:00
|
|
|
# Cygiwn defines _sys_nerr
|
|
|
|
ngx_feature="_sys_nerr"
|
|
|
|
ngx_feature_name="NGX_SYS_NERR"
|
|
|
|
ngx_feature_run=value
|
|
|
|
ngx_feature_incs='#include <errno.h>
|
|
|
|
#include <stdio.h>'
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test='printf("%d", _sys_nerr);'
|
|
|
|
. auto/feature
|
|
|
|
fi
|
2010-12-01 13:22:37 -06:00
|
|
|
|
|
|
|
|
2010-12-06 08:51:20 -06:00
|
|
|
if [ $ngx_found = no ]; then
|
|
|
|
|
|
|
|
# Solaris has no sys_nerr
|
|
|
|
ngx_feature='maximum errno'
|
|
|
|
ngx_feature_name=NGX_SYS_NERR
|
|
|
|
ngx_feature_run=value
|
|
|
|
ngx_feature_incs='#include <errno.h>
|
2011-05-04 07:21:25 -05:00
|
|
|
#include <string.h>
|
2010-12-06 08:51:20 -06:00
|
|
|
#include <stdio.h>'
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test='int n;
|
2011-04-23 08:15:56 -05:00
|
|
|
char *p;
|
2010-12-06 08:51:20 -06:00
|
|
|
for (n = 1; n < 1000; n++) {
|
|
|
|
errno = 0;
|
2011-04-23 08:15:56 -05:00
|
|
|
p = strerror(n);
|
|
|
|
if (errno == EINVAL
|
|
|
|
|| p == NULL
|
|
|
|
|| strncmp(p, "Unknown error", 13) == 0)
|
|
|
|
{
|
2011-11-21 05:51:41 -06:00
|
|
|
break;
|
2010-12-06 08:51:20 -06:00
|
|
|
}
|
2011-11-21 05:51:41 -06:00
|
|
|
}
|
|
|
|
printf("%d", n);'
|
2010-12-06 08:51:20 -06:00
|
|
|
. auto/feature
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2004-10-21 10:34:38 -05:00
|
|
|
ngx_feature="localtime_r()"
|
2004-11-25 10:17:31 -06:00
|
|
|
ngx_feature_name="NGX_HAVE_LOCALTIME_R"
|
2004-10-21 10:34:38 -05:00
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <time.h>"
|
2006-11-27 05:07:09 -06:00
|
|
|
ngx_feature_path=
|
2004-10-21 10:34:38 -05:00
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test="struct tm t; time_t c=0; localtime_r(&c, &t)"
|
|
|
|
. auto/feature
|
2004-02-10 10:23:38 -06:00
|
|
|
|
2004-06-06 14:49:18 -05:00
|
|
|
|
2018-03-01 11:25:50 -06:00
|
|
|
ngx_feature="clock_gettime(CLOCK_MONOTONIC)"
|
|
|
|
ngx_feature_name="NGX_HAVE_CLOCK_MONOTONIC"
|
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <time.h>"
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test="struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts)"
|
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
|
|
|
if [ $ngx_found = no ]; then
|
|
|
|
|
|
|
|
# Linux before glibc 2.17, notably CentOS 6
|
|
|
|
|
|
|
|
ngx_feature="clock_gettime(CLOCK_MONOTONIC) in librt"
|
|
|
|
ngx_feature_libs="-lrt"
|
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
if [ $ngx_found = yes ]; then
|
|
|
|
CORE_LIBS="$CORE_LIBS -lrt"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2004-10-21 10:34:38 -05:00
|
|
|
ngx_feature="posix_memalign()"
|
2004-11-25 10:17:31 -06:00
|
|
|
ngx_feature_name="NGX_HAVE_POSIX_MEMALIGN"
|
2004-10-21 10:34:38 -05:00
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <stdlib.h>"
|
2006-11-27 05:07:09 -06:00
|
|
|
ngx_feature_path=
|
2004-10-21 10:34:38 -05:00
|
|
|
ngx_feature_libs=
|
2012-03-27 11:44:52 -05:00
|
|
|
ngx_feature_test="void *p; int n; n = posix_memalign(&p, 4096, 4096);
|
|
|
|
if (n != 0) return 1"
|
2004-10-21 10:34:38 -05:00
|
|
|
. auto/feature
|
2004-06-06 14:49:18 -05:00
|
|
|
|
|
|
|
|
2004-10-21 10:34:38 -05:00
|
|
|
ngx_feature="memalign()"
|
2004-11-25 10:17:31 -06:00
|
|
|
ngx_feature_name="NGX_HAVE_MEMALIGN"
|
2004-10-21 10:34:38 -05:00
|
|
|
ngx_feature_run=no
|
2012-03-15 15:39:38 -05:00
|
|
|
ngx_feature_incs="#include <stdlib.h>
|
|
|
|
#include <malloc.h>"
|
2006-11-27 05:07:09 -06:00
|
|
|
ngx_feature_path=
|
2004-10-21 10:34:38 -05:00
|
|
|
ngx_feature_libs=
|
2012-03-27 11:44:52 -05:00
|
|
|
ngx_feature_test="void *p; p = memalign(4096, 4096);
|
|
|
|
if (p == NULL) return 1"
|
2004-10-21 10:34:38 -05:00
|
|
|
. auto/feature
|
2004-06-06 14:49:18 -05:00
|
|
|
|
2004-06-15 12:47:16 -05:00
|
|
|
|
2004-06-17 12:18:53 -05:00
|
|
|
ngx_feature="mmap(MAP_ANON|MAP_SHARED)"
|
2004-11-25 10:17:31 -06:00
|
|
|
ngx_feature_name="NGX_HAVE_MAP_ANON"
|
2004-10-21 10:34:38 -05:00
|
|
|
ngx_feature_run=yes
|
|
|
|
ngx_feature_incs="#include <sys/mman.h>"
|
2006-11-27 05:07:09 -06:00
|
|
|
ngx_feature_path=
|
2004-10-21 10:34:38 -05:00
|
|
|
ngx_feature_libs=
|
2004-06-17 12:18:53 -05:00
|
|
|
ngx_feature_test="void *p;
|
|
|
|
p = mmap(NULL, 4096, PROT_READ|PROT_WRITE,
|
|
|
|
MAP_ANON|MAP_SHARED, -1, 0);
|
|
|
|
if (p == MAP_FAILED) return 1;"
|
|
|
|
. auto/feature
|
2004-06-15 12:47:16 -05:00
|
|
|
|
2004-06-17 12:18:53 -05:00
|
|
|
|
|
|
|
ngx_feature='mmap("/dev/zero", MAP_SHARED)'
|
2004-11-25 10:17:31 -06:00
|
|
|
ngx_feature_name="NGX_HAVE_MAP_DEVZERO"
|
2004-10-21 10:34:38 -05:00
|
|
|
ngx_feature_run=yes
|
|
|
|
ngx_feature_incs="#include <sys/mman.h>
|
2009-03-23 15:26:33 -05:00
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <fcntl.h>"
|
2006-11-27 05:07:09 -06:00
|
|
|
ngx_feature_path=
|
2004-10-21 10:34:38 -05:00
|
|
|
ngx_feature_libs=
|
2004-06-17 12:18:53 -05:00
|
|
|
ngx_feature_test='void *p; int fd;
|
|
|
|
fd = open("/dev/zero", O_RDWR);
|
|
|
|
p = mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
|
|
|
|
if (p == MAP_FAILED) return 1;'
|
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
|
|
|
ngx_feature="System V shared memory"
|
2004-11-25 10:17:31 -06:00
|
|
|
ngx_feature_name="NGX_HAVE_SYSVSHM"
|
2004-10-21 10:34:38 -05:00
|
|
|
ngx_feature_run=yes
|
|
|
|
ngx_feature_incs="#include <sys/ipc.h>
|
2009-03-23 15:26:33 -05:00
|
|
|
#include <sys/shm.h>"
|
2006-11-27 05:07:09 -06:00
|
|
|
ngx_feature_path=
|
2004-10-21 10:34:38 -05:00
|
|
|
ngx_feature_libs=
|
2004-06-17 12:18:53 -05:00
|
|
|
ngx_feature_test="int id;
|
|
|
|
id = shmget(IPC_PRIVATE, 4096, (SHM_R|SHM_W|IPC_CREAT));
|
|
|
|
if (id == -1) return 1;
|
|
|
|
shmctl(id, IPC_RMID, NULL);"
|
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
2011-05-10 06:39:13 -05:00
|
|
|
ngx_feature="POSIX semaphores"
|
|
|
|
ngx_feature_name="NGX_HAVE_POSIX_SEM"
|
|
|
|
ngx_feature_run=yes
|
|
|
|
ngx_feature_incs="#include <semaphore.h>"
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test="sem_t sem;
|
|
|
|
if (sem_init(&sem, 1, 0) == -1) return 1;
|
|
|
|
sem_destroy(&sem);"
|
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
2011-05-31 03:17:27 -05:00
|
|
|
if [ $ngx_found = no ]; then
|
|
|
|
|
|
|
|
# Linux has POSIX semaphores in libpthread
|
|
|
|
ngx_feature="POSIX semaphores in libpthread"
|
|
|
|
ngx_feature_libs=-lpthread
|
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
if [ $ngx_found = yes ]; then
|
|
|
|
CORE_LIBS="$CORE_LIBS -lpthread"
|
2018-03-22 07:55:57 -05:00
|
|
|
NGX_LIBPTHREAD="-lpthread"
|
2011-05-31 03:17:27 -05:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2011-08-17 03:35:54 -05:00
|
|
|
if [ $ngx_found = no ]; then
|
|
|
|
|
|
|
|
# Solaris has POSIX semaphores in librt
|
|
|
|
ngx_feature="POSIX semaphores in librt"
|
|
|
|
ngx_feature_libs=-lrt
|
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
if [ $ngx_found = yes ]; then
|
|
|
|
CORE_LIBS="$CORE_LIBS -lrt"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2004-06-17 12:18:53 -05:00
|
|
|
ngx_feature="struct msghdr.msg_control"
|
2004-11-25 10:17:31 -06:00
|
|
|
ngx_feature_name="NGX_HAVE_MSGHDR_MSG_CONTROL"
|
2004-10-21 10:34:38 -05:00
|
|
|
ngx_feature_run=no
|
2012-03-27 11:44:52 -05:00
|
|
|
ngx_feature_incs="#include <sys/socket.h>
|
|
|
|
#include <stdio.h>"
|
2006-11-27 05:07:09 -06:00
|
|
|
ngx_feature_path=
|
2004-10-21 10:34:38 -05:00
|
|
|
ngx_feature_libs=
|
2012-03-28 07:38:03 -05:00
|
|
|
ngx_feature_test="struct msghdr msg;
|
|
|
|
printf(\"%d\", (int) sizeof(msg.msg_control))"
|
2004-06-17 12:18:53 -05:00
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
|
|
|
ngx_feature="ioctl(FIONBIO)"
|
2004-11-25 10:17:31 -06:00
|
|
|
ngx_feature_name="NGX_HAVE_FIONBIO"
|
2004-10-21 10:34:38 -05:00
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <sys/ioctl.h>
|
2012-03-27 11:44:52 -05:00
|
|
|
#include <stdio.h>
|
2009-03-23 15:26:33 -05:00
|
|
|
$NGX_INCLUDE_SYS_FILIO_H"
|
2006-11-27 05:07:09 -06:00
|
|
|
ngx_feature_path=
|
2004-10-21 10:34:38 -05:00
|
|
|
ngx_feature_libs=
|
2012-03-27 11:44:52 -05:00
|
|
|
ngx_feature_test="int i = FIONBIO; printf(\"%d\", i)"
|
2004-06-17 12:18:53 -05:00
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
2019-10-17 08:02:19 -05:00
|
|
|
ngx_feature="ioctl(FIONREAD)"
|
|
|
|
ngx_feature_name="NGX_HAVE_FIONREAD"
|
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <sys/ioctl.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
$NGX_INCLUDE_SYS_FILIO_H"
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test="int i = FIONREAD; printf(\"%d\", i)"
|
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
2004-06-17 12:18:53 -05:00
|
|
|
ngx_feature="struct tm.tm_gmtoff"
|
2004-11-25 10:17:31 -06:00
|
|
|
ngx_feature_name="NGX_HAVE_GMTOFF"
|
2004-10-21 10:34:38 -05:00
|
|
|
ngx_feature_run=no
|
2012-03-27 11:44:52 -05:00
|
|
|
ngx_feature_incs="#include <time.h>
|
|
|
|
#include <stdio.h>"
|
2006-11-27 05:07:09 -06:00
|
|
|
ngx_feature_path=
|
2004-10-21 10:34:38 -05:00
|
|
|
ngx_feature_libs=
|
2012-03-27 11:44:52 -05:00
|
|
|
ngx_feature_test="struct tm tm; tm.tm_gmtoff = 0;
|
|
|
|
printf(\"%d\", (int) tm.tm_gmtoff)"
|
2004-06-17 12:18:53 -05:00
|
|
|
. auto/feature
|
2008-09-05 10:43:34 -05:00
|
|
|
|
|
|
|
|
|
|
|
ngx_feature="struct dirent.d_namlen"
|
|
|
|
ngx_feature_name="NGX_HAVE_D_NAMLEN"
|
|
|
|
ngx_feature_run=no
|
2012-03-27 11:44:52 -05:00
|
|
|
ngx_feature_incs="#include <dirent.h>
|
|
|
|
#include <stdio.h>"
|
2008-09-05 10:43:34 -05:00
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
2012-03-27 11:44:52 -05:00
|
|
|
ngx_feature_test="struct dirent dir; dir.d_namlen = 0;
|
|
|
|
printf(\"%d\", (int) dir.d_namlen)"
|
2008-09-05 10:43:34 -05:00
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
|
|
|
ngx_feature="struct dirent.d_type"
|
|
|
|
ngx_feature_name="NGX_HAVE_D_TYPE"
|
|
|
|
ngx_feature_run=no
|
2012-03-27 11:44:52 -05:00
|
|
|
ngx_feature_incs="#include <dirent.h>
|
|
|
|
#include <stdio.h>"
|
2008-09-05 10:43:34 -05:00
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
2012-03-27 11:44:52 -05:00
|
|
|
ngx_feature_test="struct dirent dir; dir.d_type = DT_REG;
|
|
|
|
printf(\"%d\", (int) dir.d_type)"
|
2008-09-05 10:43:34 -05:00
|
|
|
. auto/feature
|
2012-02-10 05:24:19 -06:00
|
|
|
|
|
|
|
|
|
|
|
ngx_feature="sysconf(_SC_NPROCESSORS_ONLN)"
|
|
|
|
ngx_feature_name="NGX_HAVE_SC_NPROCESSORS_ONLN"
|
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs=
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test="sysconf(_SC_NPROCESSORS_ONLN)"
|
|
|
|
. auto/feature
|
2012-02-13 10:13:21 -06:00
|
|
|
|
|
|
|
|
2017-12-11 10:28:11 -06:00
|
|
|
ngx_feature="sysconf(_SC_LEVEL1_DCACHE_LINESIZE)"
|
|
|
|
ngx_feature_name="NGX_HAVE_LEVEL1_DCACHE_LINESIZE"
|
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs=
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test="sysconf(_SC_LEVEL1_DCACHE_LINESIZE)"
|
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
2012-02-13 10:13:21 -06:00
|
|
|
ngx_feature="openat(), fstatat()"
|
|
|
|
ngx_feature_name="NGX_HAVE_OPENAT"
|
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <fcntl.h>"
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test="struct stat sb;
|
|
|
|
openat(AT_FDCWD, \".\", O_RDONLY|O_NOFOLLOW);
|
|
|
|
fstatat(AT_FDCWD, \".\", &sb, AT_SYMLINK_NOFOLLOW);"
|
|
|
|
. auto/feature
|
2012-12-17 06:08:53 -06:00
|
|
|
|
|
|
|
|
|
|
|
ngx_feature="getaddrinfo()"
|
|
|
|
ngx_feature_name="NGX_HAVE_GETADDRINFO"
|
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <sys/types.h>
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#include <netdb.h>"
|
|
|
|
ngx_feature_path=
|
|
|
|
ngx_feature_libs=
|
2013-08-05 04:44:56 -05:00
|
|
|
ngx_feature_test='struct addrinfo *res;
|
|
|
|
if (getaddrinfo("localhost", NULL, NULL, &res) != 0) return 1;
|
2012-12-17 06:08:53 -06:00
|
|
|
freeaddrinfo(res)'
|
|
|
|
. auto/feature
|