Annotation of embedaddon/nginx/auto/os/freebsd, revision 1.1.1.1
1.1 misho 1:
2: # Copyright (C) Igor Sysoev
3: # Copyright (C) Nginx, Inc.
4:
5:
6: have=NGX_FREEBSD . auto/have_headers
7:
8: CORE_INCS="$UNIX_INCS"
9: CORE_DEPS="$UNIX_DEPS $FREEBSD_DEPS"
10: CORE_SRCS="$UNIX_SRCS $FREEBSD_SRCS"
11:
12: ngx_spacer='
13: '
14:
15:
16: # __FreeBSD_version and sysctl kern.osreldate are the best ways
17: # to determine whether some capability exists and is safe to use.
18: # __FreeBSD_version is used for the testing of the build environment.
19: # sysctl kern.osreldate is used for the testing of the kernel capabilities.
20:
21: version=`grep "#define __FreeBSD_version" /usr/include/osreldate.h \
22: | sed -e 's/^.* \(.*\)$/\1/'`
23:
24: osreldate=`/sbin/sysctl -n kern.osreldate`
25:
26:
27: # setproctitle() in libutil
28:
29: if [ \( $version -ge 500000 -a $version -lt 500012 \) \
30: -o $version -lt 410002 ]
31: then
32: echo " + setproctitle() in libutil"
33:
34: CORE_LIBS="$CORE_LIBS -lutil"
35: NGX_SETPROCTITLE_LIB="-lutil"
36: fi
37:
38: # sendfile
39:
40: if [ $osreldate -gt 300007 ]; then
41: echo " + sendfile() found"
42:
43: have=NGX_HAVE_SENDFILE . auto/have
44: CORE_SRCS="$CORE_SRCS $FREEBSD_SENDFILE_SRCS"
45: fi
46:
47: if [ $osreldate -gt 502103 ]; then
48: echo " + sendfile()'s SF_NODISKIO found"
49:
50: have=NGX_HAVE_AIO_SENDFILE . auto/have
51: fi
52:
53: # POSIX semaphores
54: # http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/127545
55:
56: if [ $osreldate -ge 701106 ]; then
57: echo " + POSIX semaphores should work"
58: else
59: have=NGX_HAVE_POSIX_SEM . auto/nohave
60: fi
61:
62:
63: # kqueue
64:
65: if [ \( $osreldate -lt 500000 -a $osreldate -ge 410000 \) \
66: -o $osreldate -ge 500011 ]
67: then
68: echo " + kqueue found"
69:
70: have=NGX_HAVE_KQUEUE . auto/have
71: have=NGX_HAVE_CLEAR_EVENT . auto/have
72: EVENT_MODULES="$EVENT_MODULES $KQUEUE_MODULE"
73: CORE_SRCS="$CORE_SRCS $KQUEUE_SRCS"
74: EVENT_FOUND=YES
75: fi
76:
77:
78: NGX_KQUEUE_CHECKED=YES
79:
80:
81: # kqueue's NOTE_LAWAT
82:
83: if [ \( $version -lt 500000 -a $version -ge 430000 \) \
84: -o $version -ge 500018 ]
85: then
86: echo " + kqueue's NOTE_LOWAT found"
87: have=NGX_HAVE_LOWAT_EVENT . auto/have
88: fi
89:
90: # kqueue's EVFILT_TIMER
91:
92: if [ \( $version -lt 500000 -a $version -ge 440001 \) \
93: -o $version -ge 500023 ]
94: then
95: echo " + kqueue's EVFILT_TIMER found"
96: have=NGX_HAVE_TIMER_EVENT . auto/have
97: fi
98:
99:
100: if [ $USE_THREADS = "rfork" ]; then
101:
102: echo " + using rfork()"
103:
104: # # kqueue's EVFILT_SIGNAL is safe
105: #
106: # if [ $version -gt 460101 ]; then
107: # echo " + kqueue's EVFILT_SIGNAL is safe"
108: # have=NGX_HAVE_SAFE_EVFILT_SIGNAL . auto/have
109: # else
110: # echo "$0: error: the kqueue's EVFILT_SIGNAL is unsafe on this"
111: # echo "FreeBSD version, so --with-threads=rfork could not be used"
112: # echo
113: #
114: # exit 1
115: # fi
116: fi
117:
118:
119: if [ $EVENT_AIO = YES ]; then
120: if [ \( $version -lt 500000 -a $version -ge 430000 \) \
121: -o $version -ge 500014 ]
122: then
123: have=NGX_HAVE_AIO . auto/have
124: EVENT_MODULES="$EVENT_MODULES $AIO_MODULE"
125: CORE_SRCS="$CORE_SRCS $AIO_SRCS"
126: else
127:
128: cat << END
129:
130: $0: error: the kqueue does not support AIO on this FreeBSD version
131:
132: END
133:
134: exit 1
135: fi
136: fi
137:
138:
139: # cpuset_setaffinity()
140:
141: if [ $version -ge 701000 ]; then
142: echo " + cpuset_setaffinity() found"
143: have=NGX_HAVE_CPUSET_SETAFFINITY . auto/have
144: fi
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>