2003-11-26 04:44:56 +08:00
|
|
|
|
2004-09-30 00:00:49 +08:00
|
|
|
# Copyright (C) Igor Sysoev
|
|
|
|
|
|
|
|
|
2004-10-21 23:34:38 +08:00
|
|
|
CC_WARN=
|
2003-12-15 04:10:27 +08:00
|
|
|
ngx_fmt_collect=yes
|
2003-11-26 04:44:56 +08:00
|
|
|
|
2003-11-26 23:42:18 +08:00
|
|
|
# C types
|
|
|
|
|
2004-02-25 01:31:46 +08:00
|
|
|
ngx_type="int"; . auto/types/sizeof
|
2004-11-11 22:07:14 +08:00
|
|
|
#ngx_formats="%d"; . auto/fmt/fmt
|
2003-11-26 04:44:56 +08:00
|
|
|
|
2004-02-25 01:31:46 +08:00
|
|
|
ngx_type="long"; . auto/types/sizeof
|
2004-11-11 22:07:14 +08:00
|
|
|
#ngx_formats="%ld"; . auto/fmt/fmt
|
2003-11-26 04:44:56 +08:00
|
|
|
|
2004-02-25 01:31:46 +08:00
|
|
|
ngx_type="long long"; . auto/types/sizeof
|
2004-11-11 22:07:14 +08:00
|
|
|
#ngx_formats="%lld %qd"; . auto/fmt/fmt
|
2003-11-26 04:44:56 +08:00
|
|
|
|
2004-06-28 02:01:57 +08:00
|
|
|
ngx_type="void *"; . auto/types/sizeof; ngx_ptr_size=$ngx_size
|
2004-11-11 22:07:14 +08:00
|
|
|
#ngx_fmt_name=PTR_FMT;
|
|
|
|
#eval ngx_formats=\${ngx_${ngx_ptr_size}_fmt}; . auto/fmt/ptrfmt
|
2003-11-26 04:44:56 +08:00
|
|
|
|
|
|
|
|
2004-02-09 15:46:43 +08:00
|
|
|
# POSIX types
|
2003-11-26 23:42:18 +08:00
|
|
|
|
2004-10-21 23:34:38 +08:00
|
|
|
NGX_INCLUDE_AUTO_CONFIG_H="#include \"../$NGX_AUTO_CONFIG_H\""
|
2003-11-26 23:42:18 +08:00
|
|
|
|
2004-06-28 02:01:57 +08:00
|
|
|
ngx_type="uint64_t"; ngx_types="u_int64_t"; . auto/types/typedef
|
2003-11-26 23:42:18 +08:00
|
|
|
|
2004-06-28 02:01:57 +08:00
|
|
|
ngx_type="sig_atomic_t"; ngx_types="int"; . auto/types/typedef
|
|
|
|
. auto/types/sizeof
|
2004-12-21 20:30:30 +08:00
|
|
|
ngx_param=NGX_SIG_ATOMIC_T_SIZE; ngx_value=$ngx_size; . auto/types/value
|
2004-02-06 00:58:36 +08:00
|
|
|
|
2004-06-28 02:01:57 +08:00
|
|
|
ngx_type="socklen_t"; ngx_types="uint32_t"; . auto/types/typedef
|
2003-11-26 23:42:18 +08:00
|
|
|
|
2004-06-28 02:01:57 +08:00
|
|
|
ngx_type="in_addr_t"; ngx_types="uint32_t"; . auto/types/typedef
|
2003-11-26 23:42:18 +08:00
|
|
|
|
2004-09-07 23:29:22 +08:00
|
|
|
ngx_type="in_port_t"; ngx_types="u_short"; . auto/types/typedef
|
|
|
|
|
2004-06-28 02:01:57 +08:00
|
|
|
ngx_type="rlim_t"; ngx_types="int"; . auto/types/typedef
|
2003-11-26 23:42:18 +08:00
|
|
|
|
|
|
|
. auto/types/uintptr_t
|
|
|
|
|
2004-06-28 02:01:57 +08:00
|
|
|
. auto/endianess
|
|
|
|
|
2004-12-03 02:40:46 +08:00
|
|
|
ngx_type="size_t"; . auto/types/sizeof
|
2004-12-21 20:30:30 +08: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 23:42:18 +08:00
|
|
|
|
2004-12-03 02:40:46 +08:00
|
|
|
ngx_type="off_t"; . auto/types/sizeof
|
2004-12-21 20:30:30 +08: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 23:42:18 +08:00
|
|
|
|
2004-12-03 02:40:46 +08:00
|
|
|
ngx_type="time_t"; . auto/types/sizeof
|
2004-12-21 20:30:30 +08: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
|
2003-11-26 04:44:56 +08:00
|
|
|
|
|
|
|
|
2004-06-18 01:18:53 +08:00
|
|
|
# syscalls, libc calls and some features
|
|
|
|
|
2003-11-26 04:44:56 +08:00
|
|
|
|
2004-11-21 03:52:20 +08:00
|
|
|
ngx_feature="setproctitle()"
|
2004-11-26 00:17:31 +08:00
|
|
|
ngx_feature_name="NGX_HAVE_SETPROCTITLE"
|
2004-11-21 03:52:20 +08:00
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs=
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test="setproctitle(\"test\");"
|
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
2004-10-21 23:34:38 +08:00
|
|
|
ngx_feature="pread()"
|
2004-11-26 00:17:31 +08:00
|
|
|
ngx_feature_name="NGX_HAVE_PREAD"
|
2004-10-21 23:34:38 +08:00
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs=
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test="char buf[1]; ssize_t n; n = pread(0, buf, 1, 0)"
|
|
|
|
. auto/feature
|
2003-11-26 04:44:56 +08:00
|
|
|
|
|
|
|
|
2004-10-21 23:34:38 +08:00
|
|
|
ngx_feature="pwrite()"
|
2004-11-26 00:17:31 +08:00
|
|
|
ngx_feature_name="NGX_HAVE_PWRITE"
|
2004-10-21 23:34:38 +08:00
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs=
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test="char buf[1]; ssize_t n; n = pwrite(1, buf, 1, 0)"
|
|
|
|
. auto/feature
|
2003-11-26 04:44:56 +08:00
|
|
|
|
2003-12-19 16:15:11 +08:00
|
|
|
|
2004-10-21 23:34:38 +08:00
|
|
|
ngx_feature="strerror_r()"
|
2004-11-26 00:17:31 +08:00
|
|
|
ngx_feature_name="NGX_HAVE_STRERROR_R"
|
2004-11-11 22:07:14 +08:00
|
|
|
ngx_feature_run=yes
|
2004-10-21 23:34:38 +08:00
|
|
|
ngx_feature_incs="#include <string.h>"
|
|
|
|
ngx_feature_libs=
|
2004-11-11 22:07:14 +08:00
|
|
|
ngx_feature_test="char buf[32]; int n; n = strerror_r(1, buf, 32);
|
|
|
|
if (n > 32) return 1;"
|
2004-10-21 23:34:38 +08:00
|
|
|
. auto/feature
|
2003-12-19 16:15:11 +08:00
|
|
|
|
2003-12-15 04:10:27 +08:00
|
|
|
|
2004-11-11 22:07:14 +08:00
|
|
|
# GNU style strerror_r() returns not length, but pointer
|
|
|
|
|
|
|
|
ngx_feature="gnu style strerror_r()"
|
2004-11-26 00:17:31 +08:00
|
|
|
ngx_feature_name="NGX_HAVE_GNU_STRERROR_R"
|
2004-11-11 22:07:14 +08:00
|
|
|
ngx_feature_run=yes
|
2004-10-21 23:34:38 +08:00
|
|
|
ngx_feature_incs="#include <string.h>"
|
|
|
|
ngx_feature_libs=
|
2004-11-11 22:07:14 +08:00
|
|
|
ngx_feature_test="char buf[32]; int n; n = strerror_r(1, buf, 32);
|
|
|
|
if (n < 32) return 1;"
|
2004-10-21 23:34:38 +08:00
|
|
|
. auto/feature
|
2003-12-15 04:10:27 +08:00
|
|
|
|
2004-02-11 00:23:38 +08:00
|
|
|
|
2004-10-21 23:34:38 +08:00
|
|
|
ngx_feature="localtime_r()"
|
2004-11-26 00:17:31 +08:00
|
|
|
ngx_feature_name="NGX_HAVE_LOCALTIME_R"
|
2004-10-21 23:34:38 +08:00
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <time.h>"
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test="struct tm t; time_t c=0; localtime_r(&c, &t)"
|
|
|
|
. auto/feature
|
2004-02-11 00:23:38 +08:00
|
|
|
|
2004-06-07 03:49:18 +08:00
|
|
|
|
2004-10-21 23:34:38 +08:00
|
|
|
ngx_feature="posix_memalign()"
|
2004-11-26 00:17:31 +08:00
|
|
|
ngx_feature_name="NGX_HAVE_POSIX_MEMALIGN"
|
2004-10-21 23:34:38 +08:00
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <stdlib.h>"
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test="void *p; int n; n = posix_memalign(&p, 4096, 4096)"
|
|
|
|
. auto/feature
|
2004-06-07 03:49:18 +08:00
|
|
|
|
|
|
|
|
2004-10-21 23:34:38 +08:00
|
|
|
ngx_feature="memalign()"
|
2004-11-26 00:17:31 +08:00
|
|
|
ngx_feature_name="NGX_HAVE_MEMALIGN"
|
2004-10-21 23:34:38 +08:00
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <stdlib.h>"
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test="void *p; p = memalign(4096, 4096)"
|
|
|
|
. auto/feature
|
2004-06-07 03:49:18 +08:00
|
|
|
|
2004-06-16 01:47:16 +08:00
|
|
|
|
2004-10-21 23:34:38 +08:00
|
|
|
ngx_feature="sched_yield()"
|
2004-11-26 00:17:31 +08:00
|
|
|
ngx_feature_name="NGX_HAVE_SCHED_YIELD"
|
2004-10-21 23:34:38 +08:00
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <sched.h>"
|
|
|
|
ngx_feature_libs=
|
|
|
|
ngx_feature_test="sched_yield()"
|
|
|
|
. auto/feature
|
2004-06-16 01:47:16 +08:00
|
|
|
|
|
|
|
|
2004-06-18 01:18:53 +08:00
|
|
|
ngx_feature="mmap(MAP_ANON|MAP_SHARED)"
|
2004-11-26 00:17:31 +08:00
|
|
|
ngx_feature_name="NGX_HAVE_MAP_ANON"
|
2004-10-21 23:34:38 +08:00
|
|
|
ngx_feature_run=yes
|
|
|
|
ngx_feature_incs="#include <sys/mman.h>"
|
|
|
|
ngx_feature_libs=
|
2004-06-18 01:18:53 +08: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-16 01:47:16 +08:00
|
|
|
|
2004-06-18 01:18:53 +08:00
|
|
|
|
|
|
|
ngx_feature='mmap("/dev/zero", MAP_SHARED)'
|
2004-11-26 00:17:31 +08:00
|
|
|
ngx_feature_name="NGX_HAVE_MAP_DEVZERO"
|
2004-10-21 23:34:38 +08:00
|
|
|
ngx_feature_run=yes
|
|
|
|
ngx_feature_incs="#include <sys/mman.h>
|
2004-06-18 01:18:53 +08:00
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <fcntl.h>"
|
2004-10-21 23:34:38 +08:00
|
|
|
ngx_feature_libs=
|
2004-06-18 01:18:53 +08: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-26 00:17:31 +08:00
|
|
|
ngx_feature_name="NGX_HAVE_SYSVSHM"
|
2004-10-21 23:34:38 +08:00
|
|
|
ngx_feature_run=yes
|
|
|
|
ngx_feature_incs="#include <sys/ipc.h>
|
2004-06-18 01:18:53 +08:00
|
|
|
#include <sys/shm.h>"
|
2004-10-21 23:34:38 +08:00
|
|
|
ngx_feature_libs=
|
2004-06-18 01:18:53 +08: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
|
|
|
|
|
|
|
|
|
|
|
|
ngx_feature="struct msghdr.msg_control"
|
2004-11-26 00:17:31 +08:00
|
|
|
ngx_feature_name="NGX_HAVE_MSGHDR_MSG_CONTROL"
|
2004-10-21 23:34:38 +08:00
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <sys/socket.h>"
|
|
|
|
ngx_feature_libs=
|
2004-06-18 01:18:53 +08:00
|
|
|
ngx_feature_test="struct msghdr msg; msg.msg_control = NULL"
|
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
|
|
|
ngx_feature="ioctl(FIONBIO)"
|
2004-11-26 00:17:31 +08:00
|
|
|
ngx_feature_name="NGX_HAVE_FIONBIO"
|
2004-10-21 23:34:38 +08:00
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <sys/ioctl.h>
|
|
|
|
$NGX_INCLUDE_SYS_FILIO_H"
|
|
|
|
ngx_feature_libs=
|
2004-06-18 01:18:53 +08:00
|
|
|
ngx_feature_test="int i; i = FIONBIO"
|
|
|
|
. auto/feature
|
|
|
|
|
|
|
|
|
|
|
|
ngx_feature="struct tm.tm_gmtoff"
|
2004-11-26 00:17:31 +08:00
|
|
|
ngx_feature_name="NGX_HAVE_GMTOFF"
|
2004-10-21 23:34:38 +08:00
|
|
|
ngx_feature_run=no
|
|
|
|
ngx_feature_incs="#include <time.h>"
|
|
|
|
ngx_feature_libs=
|
2004-06-18 01:18:53 +08:00
|
|
|
ngx_feature_test="struct tm tm; tm.tm_gmtoff = 0"
|
|
|
|
. auto/feature
|