Mercurial > hg > nginx-quic
annotate auto/fmt/ptrfmt @ 504:4cfdcb10967c
release-0.1.26 tag
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 22 Mar 2005 16:02:46 +0000 |
parents | 295d97d70c69 |
children |
rev | line source |
---|---|
444
42d11f017717
nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents:
370
diff
changeset
|
1 |
42d11f017717
nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents:
370
diff
changeset
|
2 # Copyright (C) Igor Sysoev |
42d11f017717
nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents:
370
diff
changeset
|
3 |
267
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
4 |
455 | 5 echo $ngx_n "checking for $ngx_type printf() format ...$ngx_c" |
6 | |
7 cat << END >> $NGX_AUTOCONF_ERR | |
8 | |
9 ---------------------------------------- | |
10 checking for $ngx_type printf() format | |
267
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
11 |
455 | 12 END |
13 | |
267
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
14 |
455 | 15 ngx_format=no |
16 ngx_comma= | |
17 ngx_fmt_x= | |
18 | |
19 for ngx_fmt in $ngx_formats | |
267
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
20 do |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
21 |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
22 cat << END > $NGX_AUTOTEST.c |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
23 |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
24 int main() { |
455 | 25 printf("$ngx_fmt", ($ngx_type) $ngx_max_value); |
267
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
26 return 0; |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
27 } |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
28 |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
29 END |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
30 |
455 | 31 ngx_test="$CC $CC_TEST_FLAGS $CC_WARN $CC_AUX_FLAGS \ |
32 -o $NGX_AUTOTEST $NGX_AUTOTEST.c" | |
33 eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1" | |
267
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
34 |
455 | 35 ngx_max_val=`echo $ngx_max_value | sed -e "s/L*\$//"` |
267
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
36 |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
37 if [ -x $NGX_AUTOTEST ]; then |
455 | 38 if [ "`$NGX_AUTOTEST`" = $ngx_max_val ]; then |
39 ngx_format=$ngx_fmt | |
267
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
40 fi |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
41 fi |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
42 |
455 | 43 rm $NGX_AUTOTEST |
267
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
44 |
455 | 45 if [ $ngx_format != no ]; then |
267
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
46 break |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
47 fi |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
48 |
455 | 49 ngx_fmt_x=`echo $ngx_fmt | sed -e "s/d/X/"` |
50 | |
51 echo $ngx_n "$ngx_comma \"${ngx_fmt_x}\" is not appropriate$ngx_c" | |
52 ngx_comma="," | |
267
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
53 |
455 | 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 | |
267
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
59 done |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
60 |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
61 |
455 | 62 if [ $ngx_format = no ]; then |
267
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
63 echo "$0: error: printf() $ngx_type format not found" |
455 | 64 |
267
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
65 exit 1 |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
66 fi |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
67 |
268
db5e5d854754
nginx-0.0.2-2004-02-24-22:34:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
267
diff
changeset
|
68 |
370
54f76b0b8dca
nginx-0.0.7-2004-06-27-22:01:57 import
Igor Sysoev <igor@sysoev.ru>
parents:
269
diff
changeset
|
69 if [ $ngx_ptr_size = 4 ]; then |
455 | 70 ngx_fmt_x="%0`expr 2 \* $ngx_ptr_size`" |
268
db5e5d854754
nginx-0.0.2-2004-02-24-22:34:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
267
diff
changeset
|
71 else |
455 | 72 ngx_fmt_x="%" |
268
db5e5d854754
nginx-0.0.2-2004-02-24-22:34:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
267
diff
changeset
|
73 fi |
db5e5d854754
nginx-0.0.2-2004-02-24-22:34:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
267
diff
changeset
|
74 |
455 | 75 ngx_format=`echo $ngx_format | sed -e "s/d/X/" -e "s/^%/$ngx_fmt_x/"` |
267
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
76 |
455 | 77 echo "$ngx_comma \"${ngx_format}\" used" |
267
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
78 |
268
db5e5d854754
nginx-0.0.2-2004-02-24-22:34:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
267
diff
changeset
|
79 |
267
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
80 cat << END >> $NGX_AUTO_CONFIG_H |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
81 |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
82 #ifndef $ngx_fmt_name |
455 | 83 #define $ngx_fmt_name "$ngx_format" |
267
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
84 #endif |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
85 |
83205e0b5522
nginx-0.0.2-2004-02-24-20:31:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
86 END |