nginx-0.0.1-2003-11-20-10:05:50 import; auto/configure

This commit is contained in:
Igor Sysoev
2003-11-20 07:05:50 +00:00
parent 160d774afc
commit bb6ec8c9fd
10 changed files with 183 additions and 103 deletions

28
auto/types/socklen_t Normal file
View File

@@ -0,0 +1,28 @@
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

30
auto/types/time_t Normal file
View File

@@ -0,0 +1,30 @@
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

50
auto/types/uint64_t Normal file
View File

@@ -0,0 +1,50 @@
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

45
auto/types/uintptr_t Normal file
View File

@@ -0,0 +1,45 @@
found=0
echo 'Checking for uintptr_t'
echo '#include <sys/types.h>' > autotest.c
echo 'int main() { uintptr_t i = 0; return i; }' >> autotest.c
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
fi
if [ $found = 0 ]; then
echo "$0: error: uintptr_t not found"
exit 1
fi
if [ $found = 2 ]; then
echo $type >> ngx_auto_config.h
echo >> ngx_auto_config.h
fi