Back to home page

Nginx displayed by LXR

Source navigation ]
Diff markup ]
Identifier search ]
general search ]
 
 
Version: nginx-1.15.12 ]​[ nginx-1.16.0 ]​

0001 
0002 # Copyright (C) Igor Sysoev
0003 # Copyright (C) Nginx, Inc.
0004 
0005 
0006 have=NGX_DARWIN . auto/have_headers
0007 
0008 CORE_INCS="$UNIX_INCS"
0009 CORE_DEPS="$UNIX_DEPS $DARWIN_DEPS"
0010 CORE_SRCS="$UNIX_SRCS $DARWIN_SRCS"
0011 
0012 
0013 
0014 ngx_spacer='
0015 '
0016 
0017 MAIN_LINK=
0018 MODULE_LINK="-shared -Wl,-undefined,dynamic_lookup"
0019 
0020 CC_AUX_FLAGS="$CC_AUX_FLAGS -D__APPLE_USE_RFC_3542"
0021 
0022 
0023 # kqueue
0024 
0025 echo " + kqueue found"
0026 have=NGX_HAVE_KQUEUE . auto/have
0027 have=NGX_HAVE_CLEAR_EVENT . auto/have
0028 EVENT_MODULES="$EVENT_MODULES $KQUEUE_MODULE"
0029 CORE_SRCS="$CORE_SRCS $KQUEUE_SRCS"
0030 EVENT_FOUND=YES
0031 NGX_KQUEUE_CHECKED=YES
0032 
0033 ngx_feature="kqueue's EVFILT_TIMER"
0034 ngx_feature_name="NGX_HAVE_TIMER_EVENT"
0035 ngx_feature_run=yes
0036 ngx_feature_incs="#include <sys/event.h>
0037                   #include <sys/time.h>"
0038 ngx_feature_path=
0039 ngx_feature_libs=
0040 ngx_feature_test="int      kq;
0041                   struct kevent    kev;
0042                   struct timespec  ts;
0043 
0044                   if ((kq = kqueue()) == -1) return 1;
0045 
0046                   kev.ident = 0;
0047                   kev.filter = EVFILT_TIMER;
0048                   kev.flags = EV_ADD|EV_ENABLE;
0049                   kev.fflags = 0;
0050                   kev.data = 1000;
0051                   kev.udata = 0;
0052 
0053                   ts.tv_sec = 0;
0054                   ts.tv_nsec = 0;
0055 
0056                   if (kevent(kq, &kev, 1, &kev, 1, &ts) == -1) return 1;
0057 
0058                   if (kev.flags & EV_ERROR) return 1;"
0059 
0060 . auto/feature
0061 
0062 
0063 ngx_feature="Darwin 64-bit kqueue millisecond timeout bug"
0064 ngx_feature_name=NGX_DARWIN_KEVENT_BUG
0065 ngx_feature_run=bug
0066 ngx_feature_incs="#include <sys/event.h>
0067                   #include <sys/time.h>"
0068 ngx_feature_path=
0069 ngx_feature_libs=
0070 ngx_feature_test="int  kq;
0071                   struct kevent    kev;
0072                   struct timespec  ts;
0073                   struct timeval   tv, tv0;
0074 
0075                   kq = kqueue();
0076 
0077                   ts.tv_sec = 0;
0078                   ts.tv_nsec = 999000000;
0079 
0080                   gettimeofday(&tv, 0);
0081                   kevent(kq, NULL, 0, &kev, 1, &ts);
0082                   gettimeofday(&tv0, 0);
0083                   timersub(&tv0, &tv, &tv);
0084 
0085                   if (tv.tv_sec * 1000000 + tv.tv_usec < 900000) return 1;"
0086 
0087 . auto/feature
0088 
0089 
0090 # sendfile()
0091 
0092 ngx_feature="sendfile()"
0093 ngx_feature_name="NGX_HAVE_SENDFILE"
0094 ngx_feature_run=yes
0095 ngx_feature_incs="#include <sys/types.h>
0096                   #include <sys/socket.h>
0097                   #include <sys/uio.h>
0098                   #include <sys/errno.h>"
0099 ngx_feature_path=
0100 ngx_feature_libs=
0101 ngx_feature_test="int s = 0, fd = 1;
0102                   off_t n; off_t off = 0;
0103                   n = sendfile(s, fd, off, &n, NULL, 0);
0104                   if (n == -1 && errno == ENOSYS) return 1"
0105 . auto/feature
0106 
0107 if [ $ngx_found = yes ]; then
0108     CORE_SRCS="$CORE_SRCS $DARWIN_SENDFILE_SRCS"
0109 fi
0110 
0111 
0112 ngx_feature="atomic(3)"
0113 ngx_feature_name=NGX_DARWIN_ATOMIC
0114 ngx_feature_run=no
0115 ngx_feature_incs="#include <libkern/OSAtomic.h>"
0116 ngx_feature_path=
0117 ngx_feature_libs=
0118 ngx_feature_test="int32_t  lock = 0;
0119                   if (!OSAtomicCompareAndSwap32Barrier(0, 1, &lock)) return 1"
0120 . auto/feature