nginx-0.0.1-2003-11-25-23:44:56 import

This commit is contained in:
Igor Sysoev
2003-11-25 20:44:56 +00:00
parent d9d0ca1268
commit a8fa0a6a37
74 changed files with 1933 additions and 914 deletions

View File

@@ -1,31 +0,0 @@
echo "Checking for long long size"
BYTES=
echo "int main() {" > autotest.c
echo "printf(\"%d\", sizeof(long long));" >> autotest.c
echo "return 0; }" >> autotest.c
eval "${CC} -o autotest autotest.c > /dev/null 2>&1"
if [ -x ./autotest ]; then
BYTES=`./autotest`
echo " + long long is $BYTES bytes"
fi
rm autotest*
case $BYTES in
4)
NGX_MAX_LONG_LONG=4294967295
;;
8)
NGX_MAX_LONG_LONG=18446744073709551615
;;
*)
echo "$0: error: can not detect long long size"
exit 1
esac

View File

@@ -1,29 +1,37 @@
echo "Checking for $NGX_TYPE size"
echo "checking for $NGX_TYPE size"
BYTES=
NGX_BYTES=
echo "#include <sys/types.h>" > autotest.c
echo "int main() {" >> autotest.c
echo "printf(\"%d\", sizeof($NGX_TYPE));" >> autotest.c
echo "return 0; }" >> autotest.c
eval "${CC} -o autotest autotest.c > /dev/null 2>&1"
eval "$CC $CC_TEST_FLAGS -o autotest autotest.c > /dev/null 2>&1"
if [ -x ./autotest ]; then
BYTES=`./autotest`
echo " + $NGX_TYPE is $BYTES bytes"
NGX_BYTES=`./autotest`
echo " + $NGX_TYPE is $NGX_BYTES bytes"
fi
rm autotest*
case $BYTES in
case $NGX_BYTES in
4)
NGX_MAX_SIZE=2147483647
if [ "$NGX_TYPE"="long" ]; then
NGX_MAX_SIZE=2147483647L
else
NGX_MAX_SIZE=2147483647
fi
;;
8)
NGX_MAX_SIZE=9223372036854775807
if [ "$NGX_TYPE"="long long" ]; then
NGX_MAX_SIZE=9223372036854775807LL
else
NGX_MAX_SIZE=9223372036854775807L
fi
;;
*)

View File

@@ -1,28 +0,0 @@
found=0
echo 'Checking for socklen_t'
echo '#include <sys/types.h>' > autotest.c
echo '#include <sys/socket.h>' >> autotest.c
echo 'int main() { socklen_t i = 0; return 0; }' >> autotest.c
eval "${CC} -o autotest autotest.c > /dev/null 2>&1"
if [ -x autotest ]; then
echo ' + socklen_t found'
found=1
else
echo ' + socklen_t not found'
echo ' + uint32_t used'
type='typedef uint32_t socklen_t;'
found=2
fi
rm autotest*
if [ $found = 2 ]; then
echo $type >> ngx_auto_config.h
echo >> ngx_auto_config.h
fi

View File

@@ -1,30 +0,0 @@
echo "Checking for printf() time_t format"
echo '#include <sys/types.h>' > autotest.c
type=`${CPP} autotest.c | awk '/^typedef.*time_t/ {print \$2}'`
rm autotest.c
case $type in
long)
echo ' + long: "%ld" used'
fmt='"%ld"'
;;
int)
echo ' + int: "%d" used'
fmt='"%d"'
;;
*)
echo "$0: error: unknown time_t definition: \"$type\""
exit 1
;;
esac
echo "#ifndef TIME_FMT" >> ngx_auto_config.h
echo "#define TIME_FMT $fmt" >> ngx_auto_config.h
echo "#endif" >> ngx_auto_config.h
echo >> ngx_auto_config.h

View File

@@ -1,32 +1,42 @@
echo "Checking for $NGX_TYPE definition"
echo "checking for $NGX_TYPE"
echo "#include <sys/types.h>" > autotest.c
TYPE=`${CPP} autotest.c | \
awk "/^typedef.*$NGX_TYPE/ { for (i = 1; i< NF; i++) print $i}"`
#rm autotest.c
FOUND=NO
echo $TYPE
for TYPE in $NGX_TYPE $NGX_TYPES
do
echo "#include <sys/types.h>" > autotest.c
echo "#include <sys/socket.h>" >> autotest.c
echo "$NGX_INTTYPES_H" >> autotest.c
echo "int main() { $TYPE i = 0; return 0; }" >> autotest.c
case $TYPE in
"long long")
echo ' + defined as long long'
NGX_FMT=$NGX_LONG_LONG_FMT
;;
eval "$CC -o autotest autotest.c > /dev/null 2>&1"
long)
echo ' + defined as long'
NGX_FMT=$NGX_LONG_FMT
;;
if [ -x autotest ]; then
if [ $TYPE = $NGX_TYPE ]; then
echo " + $NGX_TYPE found"
FOUND=YES
else
echo " + $TYPE used"
FOUND=$TYPE
fi
fi
int)
echo ' + defined as int'
NGX_FMT=$NGX_INT_FMT
;;
rm autotest*
*)
echo "$0: error: unknown $NGX_TYPE definition: \"$TYPE\""
exit 1
;;
if [ $FOUND = NO ]; then
echo " + $TYPE not found"
else
break
fi
done
esac
if [ $FOUND = NO ]; then
echo "$0: error: can not define $NGX_TYPE"
exit 1
fi
if [ $FOUND != YES ]; then
echo "typedef $FOUND $NGX_TYPE;" >> $NGX_AUTO_CONFIG_H
echo >> $NGX_AUTO_CONFIG_H
fi

View File

@@ -1,50 +0,0 @@
found=0
echo 'Checking for uint64_t'
echo '#include <sys/types.h>' > autotest.c
echo 'int main() { uint64_t i = 0; return 0; }' >> autotest.c
eval "${CC} -o autotest autotest.c > /dev/null 2>&1"
if [ -x autotest ]; then
echo ' + uint64_t found'
found=1
else
echo ' + uint64_t not found'
fi
rm autotest*
if [ $found = 0 ]; then
echo '#include <sys/types.h>' > autotest.c
echo 'int main() { u_int64_t i = 0; return 0; }' >> autotest.c
eval "${CC} -o autotest autotest.c > /dev/null 2>&1"
if [ -x autotest ]; then
echo ' + u_int64_t used'
type='typedef u_int64_t uint64_t;'
found=2
else
echo ' + u_int64_t not found'
fi
rm autotest*
fi
if [ $found = 0 ]; then
echo "$0: error: uint64_t not found"
exit 1
fi
if [ $found = 2 ]; then
echo $type >> ngx_auto_config.h
echo >> ngx_auto_config.h
fi

View File

@@ -1,47 +1,26 @@
found=0
echo 'checking for uintptr_t'
echo 'Checking for uintptr_t'
FOUND=NO
echo '#include <sys/types.h>' > autotest.c
echo 'int main() { uintptr_t i = 0; return i; }' >> autotest.c
echo "#include <sys/types.h>" > autotest.c
echo "int main() { uintptr_t i = 0; return 0; }" >> autotest.c
eval "${CC} -o autotest autotest.c > /dev/null 2>&1"
eval "$CC -o autotest autotest.c > /dev/null 2>&1"
if [ -x autotest ]; then
echo ' + uintptr_t found'
found=1
else
echo ' + uintptr_t not found'
fi
rm autotest*
if [ $found = 0 ]; then
echo 'int main() { printf("%d", 8 * sizeof(void *)); return 0; }' \
> autotest.c
eval "${CC} -o autotest autotest.c > /dev/null 2>&1"
if [ -x autotest ]; then
type="uint`./autotest`_t"
echo " + $type used"
type="typedef $type uintptr_t;"
found=2
fi
rm autotest*
if [ -x autotest ]; then
echo " + uintptr_t found"
FOUND=YES
else
echo " + uintptr_t not found"
fi
rm autotest*
if [ $found = 0 ]; then
echo "$0: error: uintptr_t not found"
exit 1
if [ $FOUND = NO ]; then
FOUND="uint`expr 8 \* $NGX_PTR_BYTES`_t"
echo " + $FOUND used"
echo "typedef $FOUND uintptr_t;" >> $NGX_AUTO_CONFIG_H
echo >> $NGX_AUTO_CONFIG_H
fi
if [ $found = 2 ]; then
echo $type >> ngx_auto_config.h
echo >> ngx_auto_config.h
fi