summaryrefslogtreecommitdiffhomepage
path: root/auto/unix
blob: c9e2a8ee18e2cebf6d29da78bb663a24914715ba (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89

CC_WARN=$CC
NGX_FMT_COLLECT=YES

# C types

NGX_TYPE="int"; . auto/types/sizeof;
NGX_FORMATS="%d"; . auto/fmt/fmt

NGX_TYPE="long"; . auto/types/sizeof;
NGX_FORMATS="%ld"; . auto/fmt/fmt

NGX_TYPE="long long"; . auto/types/sizeof;
NGX_FORMATS="%lld %qd"; . auto/fmt/fmt

NGX_TYPE="void *"; . auto/types/sizeof; NGX_PTR_BYTES=$NGX_BYTES


# headers

NGX_INC="unistd.h"; . auto/inc
NGX_INC="inttypes.h"; . auto/inc

#POSIX types

NGX_AUTO_CONFIG="#include \"$NGX_AUTO_CONFIG_H\""

NGX_TYPE="uint64_t"
NGX_TYPES="u_int64_t"; . auto/types/typedef

NGX_TYPE="socklen_t"
NGX_TYPES="uint32_t"; . auto/types/typedef

NGX_TYPE="in_addr_t"
NGX_TYPES="uint32_t"; . auto/types/typedef

NGX_TYPE="rlim_t"
NGX_TYPES="int"; . auto/types/typedef

. auto/types/uintptr_t


# printf() formats

CC_WARN=$CC_STRONG
NGX_FMT_COLLECT=NO

NGX_FMT_NAME=OFF_T_FMT
NGX_TYPE="off_t"; . auto/types/sizeof
eval NGX_FORMATS=\${NGX_${NGX_BYTES}_FMT}; . auto/fmt/fmt

NGX_FMT_NAME=TIME_T_FMT
NGX_TYPE="time_t"; . auto/types/sizeof
eval NGX_FORMATS=\${NGX_${NGX_BYTES}_FMT}; . auto/fmt/fmt

NGX_FMT_NAME=SIZE_T_FMT
NGX_TYPE="size_t"; . auto/types/sizeof
eval NGX_FORMATS=\${NGX_${NGX_BYTES}_FMT}; . auto/fmt/fmt

NGX_FMT_NAME=SIZE_T_X_FMT; . auto/fmt/xfmt

NGX_FMT_NAME=PID_T_FMT
NGX_TYPE="pid_t"; . auto/types/sizeof
eval NGX_FORMATS=\${NGX_${NGX_BYTES}_FMT}; . auto/fmt/fmt

NGX_FMT_NAME=RLIM_T_FMT
NGX_TYPE="rlim_t"; . auto/types/sizeof
eval NGX_FORMATS=\${NGX_${NGX_BYTES}_FMT}; . auto/fmt/fmt


# syscalls and libc calls

NGX_FUNC_INC=
NGX_FUNC_TEST="int fd = 0; char buf[1]; size_t size = 1;
               ssize_t n; off_t offset = 0;
               n = pread(fd, buf, size, offset)"
NGX_FUNC="pread()"; . auto/func


NGX_FUNC_INC=
NGX_FUNC_TEST="int fd = 1; char buf[1]; size_t size = 1;
               ssize_t n; off_t offset = 0;
               n = pwrite(fd, buf, size, offset)"
NGX_FUNC="pwrite()"; . auto/func


NGX_FUNC_INC="#include <time.h>"
NGX_FUNC_TEST="struct tm t; time_t c=0; localtime_r(&c, &t)"
NGX_FUNC="localtime_r()"; . auto/func