diff options
Diffstat (limited to 'auto')
| -rw-r--r-- | auto/lib/pcre/conf | 4 | ||||
| -rw-r--r-- | auto/os/freebsd | 8 | ||||
| -rw-r--r-- | auto/os/linux | 9 | ||||
| -rw-r--r-- | auto/os/solaris | 3 | ||||
| -rw-r--r-- | auto/sources | 2 | ||||
| -rw-r--r-- | auto/types/sizeof | 3 | ||||
| -rw-r--r-- | auto/types/typedef | 2 | ||||
| -rw-r--r-- | auto/types/uintptr_t | 11 | ||||
| -rwxr-xr-x | auto/unix | 75 |
9 files changed, 84 insertions, 33 deletions
diff --git a/auto/lib/pcre/conf b/auto/lib/pcre/conf index c56848d5d..6a8c326c4 100644 --- a/auto/lib/pcre/conf +++ b/auto/lib/pcre/conf @@ -98,7 +98,9 @@ else ngx_feature_incs="#include <pcre.h>" ngx_feature_path= ngx_feature_libs="-lpcre" - ngx_feature_test="pcre *re; re = pcre_compile(NULL, 0, NULL, 0, NULL)" + ngx_feature_test="pcre *re; + re = pcre_compile(NULL, 0, NULL, 0, NULL); + if (re == NULL) return 1" . auto/feature if [ $ngx_found = no ]; then diff --git a/auto/os/freebsd b/auto/os/freebsd index 88654ba60..6aa823f92 100644 --- a/auto/os/freebsd +++ b/auto/os/freebsd @@ -134,3 +134,11 @@ END exit 1 fi fi + + +# cpuset_setaffinity() + +if [ $version -ge 701000 ]; then + echo " + cpuset_setaffinity() found" + have=NGX_HAVE_CPUSET_SETAFFINITY . auto/have +fi diff --git a/auto/os/linux b/auto/os/linux index 0b2173cae..c506d3dc3 100644 --- a/auto/os/linux +++ b/auto/os/linux @@ -52,7 +52,7 @@ ngx_feature_run=yes ngx_feature_incs="#include <sys/epoll.h>" ngx_feature_path= ngx_feature_libs= -ngx_feature_test="int efd = 0, fd = 1, n; +ngx_feature_test="int efd = 0; struct epoll_event ee; ee.events = EPOLLIN|EPOLLOUT|EPOLLET; ee.data.ptr = NULL; @@ -128,8 +128,9 @@ ngx_feature_run=no ngx_feature_incs="#include <sched.h>" ngx_feature_path= ngx_feature_libs= -ngx_feature_test="long mask = 0; - sched_setaffinity(0, 32, (cpu_set_t *) &mask)" +ngx_feature_test="cpu_set_t mask; + CPU_ZERO(&mask); + sched_setaffinity(0, sizeof(cpu_set_t), &mask)" . auto/feature @@ -142,7 +143,7 @@ ngx_feature_incs="#include <crypt.h>" ngx_feature_path= ngx_feature_libs=-lcrypt ngx_feature_test="struct crypt_data cd; - crypt_r(NULL, NULL, &cd);" + crypt_r(\"key\", \"salt\", &cd);" . auto/feature diff --git a/auto/os/solaris b/auto/os/solaris index 16da4b3fd..d39df0bf7 100644 --- a/auto/os/solaris +++ b/auto/os/solaris @@ -35,7 +35,8 @@ ngx_feature_path= ngx_feature_libs="-lsendfile" ngx_feature_test="int fd = 1; sendfilevec_t vec[1]; size_t sent; ssize_t n; - n = sendfilev(fd, vec, 1, &sent)" + n = sendfilev(fd, vec, 1, &sent); + if (n == -1) return 1" . auto/feature diff --git a/auto/sources b/auto/sources index c48c3adf4..374ad667c 100644 --- a/auto/sources +++ b/auto/sources @@ -145,6 +145,7 @@ UNIX_DEPS="$CORE_DEPS $EVENT_DEPS \ src/os/unix/ngx_channel.h \ src/os/unix/ngx_shmem.h \ src/os/unix/ngx_process.h \ + src/os/unix/ngx_setaffinity.h \ src/os/unix/ngx_setproctitle.h \ src/os/unix/ngx_atomic.h \ src/os/unix/ngx_gcc_atomic_x86.h \ @@ -179,6 +180,7 @@ UNIX_SRCS="$CORE_SRCS $EVENT_SRCS \ src/os/unix/ngx_shmem.c \ src/os/unix/ngx_process.c \ src/os/unix/ngx_daemon.c \ + src/os/unix/ngx_setaffinity.c \ src/os/unix/ngx_setproctitle.c \ src/os/unix/ngx_posix_init.c \ src/os/unix/ngx_user.c \ diff --git a/auto/types/sizeof b/auto/types/sizeof index e84a0905e..e1d405c65 100644 --- a/auto/types/sizeof +++ b/auto/types/sizeof @@ -20,12 +20,13 @@ cat << END > $NGX_AUTOTEST.c #include <sys/time.h> $NGX_INCLUDE_UNISTD_H #include <signal.h> +#include <stdio.h> #include <sys/resource.h> $NGX_INCLUDE_INTTYPES_H $NGX_INCLUDE_AUTO_CONFIG_H int main() { - printf("%d", sizeof($ngx_type)); + printf("%d", (int) sizeof($ngx_type)); return 0; } diff --git a/auto/types/typedef b/auto/types/typedef index f121e8fc2..d81229331 100644 --- a/auto/types/typedef +++ b/auto/types/typedef @@ -29,7 +29,7 @@ $NGX_INCLUDE_INTTYPES_H int main() { $ngx_try i = 0; - return 0; + return (int) i; } END diff --git a/auto/types/uintptr_t b/auto/types/uintptr_t index 07f7e7d7d..2f1908035 100644 --- a/auto/types/uintptr_t +++ b/auto/types/uintptr_t @@ -4,8 +4,8 @@ echo $ngx_n "checking for uintptr_t ...$ngx_c" -echo >> $NGX_ERR -echo "checking for uintptr_t" >> $NGX_ERR +echo >> $NGX_AUTOCONF_ERR +echo "checking for uintptr_t" >> $NGX_AUTOCONF_ERR found=no @@ -16,12 +16,15 @@ $NGX_INTTYPES_H int main() { uintptr_t i = 0; - return 0; + return (int) i; } END -eval "$CC -o $NGX_AUTOTEST $NGX_AUTOTEST.c >> $NGX_ERR 2>&1" +ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \ + -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT" + +eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1" if [ -x $NGX_AUTOTEST ]; then echo " uintptr_t found" @@ -33,12 +33,12 @@ ngx_feature_run=no ngx_feature_incs="#include <poll.h>" ngx_feature_path= ngx_feature_libs= -ngx_feature_test="int n, dp; struct pollfd pl; - dp = 0; +ngx_feature_test="int n; struct pollfd pl; pl.fd = 0; pl.events = 0; pl.revents = 0; - n = poll(&pl, 1, 0)" + n = poll(&pl, 1, 0); + if (n == -1) return 1" . auto/feature if [ $ngx_found = no ]; then @@ -57,7 +57,8 @@ ngx_feature_test="int n, dp; struct dvpoll dvp; dvp.dp_fds = NULL; dvp.dp_nfds = 0; dvp.dp_timeout = 0; - n = ioctl(dp, DP_POLL, &dvp)" + n = ioctl(dp, DP_POLL, &dvp); + if (n == -1) return 1" . auto/feature if [ $ngx_found = yes ]; then @@ -237,7 +238,7 @@ ngx_feature_incs="$NGX_INCLUDE_SYS_PARAM_H ngx_feature_path= ngx_feature_libs= ngx_feature_test="struct statfs fs; - statfs(NULL, &fs);" + statfs(\".\", &fs);" . auto/feature @@ -249,7 +250,7 @@ ngx_feature_incs="#include <sys/types.h> ngx_feature_path= ngx_feature_libs= ngx_feature_test="struct statvfs fs; - statvfs(NULL, &fs);" + statvfs(\".\", &fs);" . auto/feature @@ -343,6 +344,24 @@ ngx_feature_test="setsockopt(0, IPPROTO_TCP, TCP_KEEPIDLE, NULL, 0); . auto/feature +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); + struct tcp_info ti; + ti.tcpi_rtt = 0; + ti.tcpi_rttvar = 0; + ti.tcpi_snd_cwnd = 0; + ti.tcpi_rcv_space = 0; + getsockopt(0, IPPROTO_TCP, TCP_INFO, &ti, &optlen)" +. auto/feature + + ngx_feature="accept4()" ngx_feature_name="NGX_HAVE_ACCEPT4" ngx_feature_run=no @@ -481,7 +500,7 @@ fi ngx_feature="setproctitle()" ngx_feature_name="NGX_HAVE_SETPROCTITLE" ngx_feature_run=no -ngx_feature_incs= +ngx_feature_incs="#include <stdlib.h>" ngx_feature_path= ngx_feature_libs=$NGX_SETPROCTITLE_LIB ngx_feature_test="setproctitle(\"test\");" @@ -494,7 +513,8 @@ ngx_feature_run=no ngx_feature_incs= ngx_feature_path= ngx_feature_libs= -ngx_feature_test="char buf[1]; ssize_t n; n = pread(0, buf, 1, 0)" +ngx_feature_test="char buf[1]; ssize_t n; n = pread(0, buf, 1, 0); + if (n == -1) return 1" . auto/feature @@ -504,7 +524,8 @@ ngx_feature_run=no ngx_feature_incs= ngx_feature_path= ngx_feature_libs= -ngx_feature_test="char buf[1]; ssize_t n; n = pwrite(1, buf, 1, 0)" +ngx_feature_test="char buf[1]; ssize_t n; n = pwrite(1, buf, 1, 0); + if (n == -1) return 1" . auto/feature @@ -578,17 +599,20 @@ ngx_feature_run=no ngx_feature_incs="#include <stdlib.h>" ngx_feature_path= ngx_feature_libs= -ngx_feature_test="void *p; int n; n = posix_memalign(&p, 4096, 4096)" +ngx_feature_test="void *p; int n; n = posix_memalign(&p, 4096, 4096); + if (n != 0) return 1" . auto/feature ngx_feature="memalign()" ngx_feature_name="NGX_HAVE_MEMALIGN" ngx_feature_run=no -ngx_feature_incs="#include <stdlib.h>" +ngx_feature_incs="#include <stdlib.h> + #include <malloc.h>" ngx_feature_path= ngx_feature_libs= -ngx_feature_test="void *p; p = memalign(4096, 4096)" +ngx_feature_test="void *p; p = memalign(4096, 4096); + if (p == NULL) return 1" . auto/feature @@ -675,10 +699,12 @@ fi ngx_feature="struct msghdr.msg_control" ngx_feature_name="NGX_HAVE_MSGHDR_MSG_CONTROL" ngx_feature_run=no -ngx_feature_incs="#include <sys/socket.h>" +ngx_feature_incs="#include <sys/socket.h> + #include <stdio.h>" ngx_feature_path= ngx_feature_libs= -ngx_feature_test="struct msghdr msg; msg.msg_control = NULL" +ngx_feature_test="struct msghdr msg; + printf(\"%d\", (int) sizeof(msg.msg_control))" . auto/feature @@ -686,40 +712,47 @@ ngx_feature="ioctl(FIONBIO)" ngx_feature_name="NGX_HAVE_FIONBIO" 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; i = FIONBIO" +ngx_feature_test="int i = FIONBIO; printf(\"%d\", i)" . auto/feature ngx_feature="struct tm.tm_gmtoff" ngx_feature_name="NGX_HAVE_GMTOFF" ngx_feature_run=no -ngx_feature_incs="#include <time.h>" +ngx_feature_incs="#include <time.h> + #include <stdio.h>" ngx_feature_path= ngx_feature_libs= -ngx_feature_test="struct tm tm; tm.tm_gmtoff = 0" +ngx_feature_test="struct tm tm; tm.tm_gmtoff = 0; + printf(\"%d\", (int) tm.tm_gmtoff)" . auto/feature ngx_feature="struct dirent.d_namlen" ngx_feature_name="NGX_HAVE_D_NAMLEN" ngx_feature_run=no -ngx_feature_incs="#include <dirent.h>" +ngx_feature_incs="#include <dirent.h> + #include <stdio.h>" ngx_feature_path= ngx_feature_libs= -ngx_feature_test="struct dirent dir; dir.d_namlen = 0" +ngx_feature_test="struct dirent dir; dir.d_namlen = 0; + printf(\"%d\", (int) dir.d_namlen)" . auto/feature ngx_feature="struct dirent.d_type" ngx_feature_name="NGX_HAVE_D_TYPE" ngx_feature_run=no -ngx_feature_incs="#include <dirent.h>" +ngx_feature_incs="#include <dirent.h> + #include <stdio.h>" ngx_feature_path= ngx_feature_libs= -ngx_feature_test="struct dirent dir; dir.d_type = DT_REG" +ngx_feature_test="struct dirent dir; dir.d_type = DT_REG; + printf(\"%d\", (int) dir.d_type)" . auto/feature |
