2003-11-20 11:36:43 -06:00
|
|
|
|
2003-11-25 14:44:56 -06:00
|
|
|
echo "checking for $NGX_TYPE"
|
|
|
|
|
|
|
|
FOUND=NO
|
|
|
|
|
|
|
|
for TYPE in $NGX_TYPE $NGX_TYPES
|
|
|
|
do
|
|
|
|
echo "#include <sys/types.h>" > autotest.c
|
|
|
|
echo "#include <sys/socket.h>" >> autotest.c
|
2003-11-26 09:42:18 -06:00
|
|
|
echo "#include <sys/time.h>" >> autotest.c
|
|
|
|
echo "#include <sys/resource.h>" >> autotest.c
|
|
|
|
echo "#include <netinet/in.h>" >> autotest.c
|
2003-11-25 14:44:56 -06:00
|
|
|
echo "$NGX_INTTYPES_H" >> autotest.c
|
|
|
|
echo "int main() { $TYPE i = 0; return 0; }" >> autotest.c
|
|
|
|
|
2003-11-26 09:42:18 -06:00
|
|
|
eval "$CC -o autotest autotest.c > $NGX_ERR 2>&1"
|
2003-11-25 14:44:56 -06:00
|
|
|
|
|
|
|
if [ -x autotest ]; then
|
|
|
|
if [ $TYPE = $NGX_TYPE ]; then
|
|
|
|
echo " + $NGX_TYPE found"
|
|
|
|
FOUND=YES
|
|
|
|
else
|
|
|
|
echo " + $TYPE used"
|
|
|
|
FOUND=$TYPE
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
rm autotest*
|
|
|
|
|
|
|
|
if [ $FOUND = NO ]; then
|
|
|
|
echo " + $TYPE not found"
|
|
|
|
else
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
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
|