comparison auto/fmt/ptrfmt @ 4:4b2dafa26fe2 NGINX_0_1_2

nginx 0.1.2 *) Feature: the --user=USER, --group=GROUP, and --with-ld-opt=OPTIONS options in configure. *) Feature: the server_name directive supports *.domain.tld. *) Bugfix: the portability improvements. *) Bugfix: if configuration file was set in command line, the reconfiguration was impossible; bug appeared in 0.1.1. *) Bugfix: proxy module may get caught in an endless loop when sendfile is not used. *) Bugfix: with sendfile the response was not recoded according to the charset module directives; bug appeared in 0.1.1. *) Bugfix: very seldom bug in the kqueue processing. *) Bugfix: the gzip module compressed the proxied responses that was already compressed.
author Igor Sysoev <http://sysoev.ru>
date Thu, 21 Oct 2004 00:00:00 +0400
parents f0b350454894
children
comparison
equal deleted inserted replaced
3:8beaf7b3241f 4:4b2dafa26fe2
1 1
2 # Copyright (C) Igor Sysoev 2 # Copyright (C) Igor Sysoev
3 3
4 4
5 echo $ngx_n "checking for $ngx_type printf() format ..." $ngx_c 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 6
9 ngx_fmt=no 7 cat << END >> $NGX_AUTOCONF_ERR
10 comma=
11 fmtX=
12 8
13 for fmt in $ngx_formats 9 ----------------------------------------
10 checking for $ngx_type printf() format
11
12 END
13
14
15 ngx_format=no
16 ngx_comma=
17 ngx_fmt_x=
18
19 for ngx_fmt in $ngx_formats
14 do 20 do
15 21
16 cat << END > $NGX_AUTOTEST.c 22 cat << END > $NGX_AUTOTEST.c
17 23
18 int main() { 24 int main() {
19 printf("$fmt", ($ngx_type) $ngx_max_value); 25 printf("$ngx_fmt", ($ngx_type) $ngx_max_value);
20 return 0; 26 return 0;
21 } 27 }
22 28
23 END 29 END
24 30
25 eval "$CC_WARN $CC_TEST_FLAGS -o $NGX_AUTOTEST $NGX_AUTOTEST.c \ 31 ngx_test="$CC $CC_TEST_FLAGS $CC_WARN $CC_AUX_FLAGS \
26 >> $NGX_ERR 2>&1" 32 -o $NGX_AUTOTEST $NGX_AUTOTEST.c"
33 eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
27 34
28 max_value=`echo $ngx_max_value | sed -e "s/L*\$//"` 35 ngx_max_val=`echo $ngx_max_value | sed -e "s/L*\$//"`
29 36
30 if [ -x $NGX_AUTOTEST ]; then 37 if [ -x $NGX_AUTOTEST ]; then
31 if [ "`$NGX_AUTOTEST`" = $max_value ]; then 38 if [ "`$NGX_AUTOTEST`" = $ngx_max_val ]; then
32 ngx_fmt=$fmt 39 ngx_format=$ngx_fmt
33 fi 40 fi
34 fi 41 fi
35 42
36 rm $NGX_AUTOTEST* 43 rm $NGX_AUTOTEST
37 44
38 if [ $ngx_fmt != no ]; then 45 if [ $ngx_format != no ]; then
39 break 46 break
40 fi 47 fi
41 48
42 fmtX=`echo $fmt | sed -e "s/d/X/"` 49 ngx_fmt_x=`echo $ngx_fmt | sed -e "s/d/X/"`
43 50
44 echo $ngx_n "$comma \"${fmtX}\" is not appropriate" $ngx_c 51 echo $ngx_n "$ngx_comma \"${ngx_fmt_x}\" is not appropriate$ngx_c"
45 comma="," 52 ngx_comma=","
53
54 echo "----------" >> $NGX_AUTOCONF_ERR
55 cat $NGX_AUTOTEST.c >> $NGX_AUTOCONF_ERR
56 echo "----------" >> $NGX_AUTOCONF_ERR
57 echo $ngx_test >> $NGX_AUTOCONF_ERR
58 echo "----------" >> $NGX_AUTOCONF_ERR
46 done 59 done
47 60
48 61
49 if [ $ngx_fmt = no ]; then 62 if [ $ngx_format = no ]; then
50 echo "$0: error: printf() $ngx_type format not found" 63 echo "$0: error: printf() $ngx_type format not found"
64
51 exit 1 65 exit 1
52 fi 66 fi
53 67
54 68
55 if [ $ngx_ptr_size = 4 ]; then 69 if [ $ngx_ptr_size = 4 ]; then
56 fmtX="%0`expr 2 \* $ngx_ptr_size`" 70 ngx_fmt_x="%0`expr 2 \* $ngx_ptr_size`"
57 else 71 else
58 fmtX="%" 72 ngx_fmt_x="%"
59 fi 73 fi
60 74
61 ngx_fmt=`echo $ngx_fmt | sed -e "s/d/X/" -e "s/^%/$fmtX/"` 75 ngx_format=`echo $ngx_format | sed -e "s/d/X/" -e "s/^%/$ngx_fmt_x/"`
62 76
63 echo "$comma \"${ngx_fmt}\" used" 77 echo "$ngx_comma \"${ngx_format}\" used"
64 78
65 79
66 cat << END >> $NGX_AUTO_CONFIG_H 80 cat << END >> $NGX_AUTO_CONFIG_H
67 81
68 #ifndef $ngx_fmt_name 82 #ifndef $ngx_fmt_name
69 #define $ngx_fmt_name "$ngx_fmt" 83 #define $ngx_fmt_name "$ngx_format"
70 #endif 84 #endif
71 85
72 END 86 END