Mercurial > hg > nginx-vendor-1-0
comparison auto/fmt/fmt @ 0:f0b350454894 NGINX_0_1_0
nginx 0.1.0
*) The first public version.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Mon, 04 Oct 2004 00:00:00 +0400 |
parents | |
children | 4b2dafa26fe2 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0b350454894 |
---|---|
1 | |
2 # Copyright (C) Igor Sysoev | |
3 | |
4 | |
5 echo $ngx_n "checking for $ngx_type printf() format ..." $ngx_c | |
6 echo >> $NGX_ERR | |
7 echo "checking for $ngx_type printf() format" >> $NGX_ERR | |
8 | |
9 ngx_fmt=no | |
10 comma= | |
11 | |
12 for fmt in $ngx_formats | |
13 do | |
14 | |
15 cat << END > $NGX_AUTOTEST.c | |
16 | |
17 #include <sys/types.h> | |
18 #include <sys/time.h> | |
19 #include <stdio.h> | |
20 #include <sys/resource.h> | |
21 $NGX_INTTYPES_H | |
22 $NGX_AUTO_CONFIG | |
23 | |
24 int main() { | |
25 printf("$fmt", ($ngx_type) $ngx_max_value); | |
26 return 0; | |
27 } | |
28 | |
29 END | |
30 | |
31 eval "$CC_WARN $CC_TEST_FLAGS -o $NGX_AUTOTEST $NGX_AUTOTEST.c \ | |
32 >> $NGX_ERR 2>&1" | |
33 | |
34 max_value=`echo $ngx_max_value | sed -e "s/L*\$//"` | |
35 | |
36 if [ -x $NGX_AUTOTEST ]; then | |
37 if [ "`$NGX_AUTOTEST`" = $max_value ]; then | |
38 if [ $ngx_fmt_collect = yes ]; then | |
39 echo $ngx_n "$comma \"${fmt}\" is appropriate" $ngx_c | |
40 else | |
41 echo $ngx_n "$comma \"${fmt}\" used" $ngx_c | |
42 fi | |
43 ngx_fmt=$fmt | |
44 fi | |
45 fi | |
46 | |
47 rm $NGX_AUTOTEST* | |
48 | |
49 if [ $ngx_fmt != no ]; then | |
50 if [ $ngx_fmt_collect = yes ]; then | |
51 eval "ngx_${ngx_size}_fmt=\"\${ngx_${ngx_size}_fmt} \$ngx_fmt\"" | |
52 comma="," | |
53 continue | |
54 else | |
55 break | |
56 fi | |
57 fi | |
58 | |
59 echo $ngx_n "$comma \"${fmt}\" is not appropriate" $ngx_c | |
60 comma="," | |
61 done | |
62 | |
63 echo | |
64 | |
65 if [ $ngx_fmt = no ]; then | |
66 echo "$0: error: printf() $ngx_type format not found" | |
67 exit 1 | |
68 fi | |
69 | |
70 | |
71 if [ $ngx_fmt_collect = no ]; then | |
72 cat << END >> $NGX_AUTO_CONFIG_H | |
73 | |
74 #ifndef $ngx_fmt_name | |
75 #define $ngx_fmt_name "$ngx_fmt" | |
76 #endif | |
77 | |
78 END | |
79 | |
80 fi |