Mercurial > hg > nginx
comparison auto/fmt/fmt @ 194:2357fa41738a
nginx-0.0.1-2003-11-21-09:30:49 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 21 Nov 2003 06:30:49 +0000 |
parents | dd66383796a5 |
children | 8dee38ea9117 |
comparison
equal
deleted
inserted
replaced
193:dd66383796a5 | 194:2357fa41738a |
---|---|
1 | 1 |
2 echo "Checking for printf() $NGX_TYPE format" | 2 echo "Checking for $NGX_TYPE printf() format" |
3 | 3 |
4 NGX_FMT=NO | 4 NGX_FMT=NO |
5 | 5 |
6 for FMT in $NGX_FORMATS | 6 for FMT in $NGX_FORMATS |
7 do | 7 do |
8 echo "int main() {" > autotest.c | 8 echo "#include <unistd.h>" > autotest.c |
9 echo "printf(\"%${FMT}u\", (unsigned $NGX_TYPE) -1);" >> autotest.c | 9 echo "#include <stdio.h>" >> autotest.c |
10 echo "#include <sys/types.h>" >> autotest.c | |
11 echo "int main() {" >> autotest.c | |
12 echo "printf(\"${FMT}\", ($NGX_TYPE) $NGX_MAX_SIZE);" >> autotest.c | |
10 echo "return 0; }" >> autotest.c | 13 echo "return 0; }" >> autotest.c |
11 | 14 |
12 eval "${CC} -o autotest autotest.c > /dev/null 2>&1" | 15 eval "${CC_WARN} -o autotest autotest.c > /dev/null 2>&1" |
13 | 16 |
14 if [ -x ./autotest -a "`./autotest`" = $NGX_MAX_SIZE ]; then | 17 if [ -x ./autotest ]; then |
15 echo " + \"%${FMT}\" used" | 18 if [ "`./autotest`" = $NGX_MAX_SIZE ]; then |
16 NGX_FMT=$FMT | 19 echo " + \"${FMT}\" used" |
17 else | 20 NGX_FMT=$FMT |
18 echo " + \"%${FMT}\" is not appropriate" | 21 fi |
19 fi | 22 fi |
20 | 23 |
21 rm autotest* | 24 rm autotest* |
22 | 25 |
23 if [ $NGX_FMT != NO ]; then | 26 if [ $NGX_FMT != NO ]; then |
24 break | 27 break |
25 fi | 28 fi |
29 | |
30 echo " + \"${FMT}\" is not appropriate" | |
26 done | 31 done |
27 | 32 |
28 | 33 |
29 if [ $NGX_FMT = NO ]; then | 34 if [ $NGX_FMT = NO ]; then |
30 echo "printf() $NGX_TYPE format not found" | 35 echo "printf() $NGX_TYPE format not found" |
31 exit 1 | 36 exit 1 |
32 fi | 37 fi |
38 | |
39 | |
40 echo "#ifndef $NGX_FMT_NAME" >> $NGX_AUTO_CONFIG_H | |
41 echo "#define $NGX_FMT_NAME \"$NGX_FMT\"" >> $NGX_AUTO_CONFIG_H | |
42 echo "#endif" >> $NGX_AUTO_CONFIG_H | |
43 echo >> $NGX_AUTO_CONFIG_H |