comparison auto/types/typedef @ 195:8dee38ea9117

nginx-0.0.1-2003-11-25-23:44:56 import
author Igor Sysoev <igor@sysoev.ru>
date Tue, 25 Nov 2003 20:44:56 +0000
parents dd66383796a5
children 11fbd0fc041d
comparison
equal deleted inserted replaced
194:2357fa41738a 195:8dee38ea9117
1 1
2 echo "Checking for $NGX_TYPE definition" 2 echo "checking for $NGX_TYPE"
3 3
4 echo "#include <sys/types.h>" > autotest.c 4 FOUND=NO
5 TYPE=`${CPP} autotest.c | \
6 awk "/^typedef.*$NGX_TYPE/ { for (i = 1; i< NF; i++) print $i}"`
7 #rm autotest.c
8 5
9 echo $TYPE 6 for TYPE in $NGX_TYPE $NGX_TYPES
7 do
8 echo "#include <sys/types.h>" > autotest.c
9 echo "#include <sys/socket.h>" >> autotest.c
10 echo "$NGX_INTTYPES_H" >> autotest.c
11 echo "int main() { $TYPE i = 0; return 0; }" >> autotest.c
10 12
11 case $TYPE in 13 eval "$CC -o autotest autotest.c > /dev/null 2>&1"
12 "long long")
13 echo ' + defined as long long'
14 NGX_FMT=$NGX_LONG_LONG_FMT
15 ;;
16 14
17 long) 15 if [ -x autotest ]; then
18 echo ' + defined as long' 16 if [ $TYPE = $NGX_TYPE ]; then
19 NGX_FMT=$NGX_LONG_FMT 17 echo " + $NGX_TYPE found"
20 ;; 18 FOUND=YES
19 else
20 echo " + $TYPE used"
21 FOUND=$TYPE
22 fi
23 fi
21 24
22 int) 25 rm autotest*
23 echo ' + defined as int'
24 NGX_FMT=$NGX_INT_FMT
25 ;;
26 26
27 *) 27 if [ $FOUND = NO ]; then
28 echo "$0: error: unknown $NGX_TYPE definition: \"$TYPE\"" 28 echo " + $TYPE not found"
29 exit 1 29 else
30 ;; 30 break
31 fi
32 done
31 33
32 esac 34 if [ $FOUND = NO ]; then
35 echo "$0: error: can not define $NGX_TYPE"
36 exit 1
37 fi
38
39 if [ $FOUND != YES ]; then
40 echo "typedef $FOUND $NGX_TYPE;" >> $NGX_AUTO_CONFIG_H
41 echo >> $NGX_AUTO_CONFIG_H
42 fi