comparison auto/types/typedef @ 210:00cafae0bdf1

nginx-0.0.1-2003-12-14-23:10:27 import
author Igor Sysoev <igor@sysoev.ru>
date Sun, 14 Dec 2003 20:10:27 +0000
parents 11fbd0fc041d
children 1903c6821958
comparison
equal deleted inserted replaced
209:e1c815be05ae 210:00cafae0bdf1
1 1
2 echo "checking for $NGX_TYPE" 2 echo -n "checking for $ngx_type ..."
3 echo >> $NGX_ERR
4 echo "checking for $ngx_type" >> $NGX_ERR
3 5
4 FOUND=NO 6 found=no
5 7
6 for TYPE in $NGX_TYPE $NGX_TYPES 8 for type in $ngx_type $ngx_types
7 do 9 do
8 echo "#include <sys/types.h>" > autotest.c
9 echo "#include <sys/socket.h>" >> autotest.c
10 echo "#include <sys/time.h>" >> autotest.c
11 echo "#include <sys/resource.h>" >> autotest.c
12 echo "#include <netinet/in.h>" >> autotest.c
13 echo "$NGX_INTTYPES_H" >> autotest.c
14 echo "int main() { $TYPE i = 0; return 0; }" >> autotest.c
15 10
16 eval "$CC -o autotest autotest.c > $NGX_ERR 2>&1" 11 cat << END > $NGX_AUTOTEST.c
17 12
18 if [ -x autotest ]; then 13 #include <sys/types.h>
19 if [ $TYPE = $NGX_TYPE ]; then 14 #include <sys/socket.h>
20 echo " + $NGX_TYPE found" 15 #include <sys/time.h>
21 FOUND=YES 16 #include <sys/resource.h>
17 #include <netinet/in.h>
18 $NGX_INTTYPES_H
19
20 int main() {
21 $type i = 0;
22 return 0;
23 }
24
25 END
26
27 eval "$CC -o $NGX_AUTOTEST $NGX_AUTOTEST.c >> $NGX_ERR 2>&1"
28
29 if [ -x $NGX_AUTOTEST ]; then
30 if [ $type = $ngx_type ]; then
31 echo " found"
32 found=yes
22 else 33 else
23 echo " + $TYPE used" 34 echo ", $type used"
24 FOUND=$TYPE 35 found=$type
25 fi 36 fi
26 fi 37 fi
27 38
28 rm autotest* 39 rm $NGX_AUTOTEST*
29 40
30 if [ $FOUND = NO ]; then 41 if [ $found = no ]; then
31 echo " + $TYPE not found" 42 echo -n " $type not found"
32 else 43 else
33 break 44 break
34 fi 45 fi
35 done 46 done
36 47
37 if [ $FOUND = NO ]; then 48 if [ $found = no ]; then
38 echo "$0: error: can not define $NGX_TYPE" 49 echo
50 echo "$0: error: can not define $ngx_type"
39 exit 1 51 exit 1
40 fi 52 fi
41 53
42 if [ $FOUND != YES ]; then 54 if [ $found != yes ]; then
43 echo "typedef $FOUND $NGX_TYPE;" >> $NGX_AUTO_CONFIG_H 55 echo "typedef $found $ngx_type;" >> $NGX_AUTO_CONFIG_H
44 echo >> $NGX_AUTO_CONFIG_H
45 fi 56 fi