nginx/auto/types/typedef

83 lines
1.6 KiB
Plaintext
Raw Normal View History

2003-11-20 11:36:43 -06:00
# Copyright (C) Igor Sysoev
2012-01-18 09:07:43 -06:00
# Copyright (C) Nginx, Inc.
echo $ngx_n "checking for $ngx_type ...$ngx_c"
2003-11-25 14:44:56 -06:00
cat << END >> $NGX_AUTOCONF_ERR
2003-11-25 14:44:56 -06:00
----------------------------------------
checking for $ngx_type
END
ngx_found=no
for ngx_try in $ngx_type $ngx_types
2003-11-25 14:44:56 -06:00
do
2003-12-14 14:10:27 -06:00
cat << END > $NGX_AUTOTEST.c
#include <sys/types.h>
2004-06-27 13:01:57 -05:00
#include <signal.h>
2003-12-14 14:10:27 -06:00
#include <sys/socket.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <netinet/in.h>
$NGX_INCLUDE_INTTYPES_H
2003-12-14 14:10:27 -06:00
int main() {
$ngx_try i = 0;
return (int) i;
2003-12-14 14:10:27 -06:00
}
END
ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
-o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
2003-12-14 14:10:27 -06:00
if [ -x $NGX_AUTOTEST ]; then
if [ $ngx_try = $ngx_type ]; then
2003-12-14 14:10:27 -06:00
echo " found"
ngx_found=yes
2003-11-25 14:44:56 -06:00
else
echo ", $ngx_try used"
ngx_found=$ngx_try
2003-11-25 14:44:56 -06:00
fi
fi
if [ $ngx_found = no ]; then
if [ $ngx_try = $ngx_type ]; then
echo $ngx_n " $ngx_try not found$ngx_c"
else
echo $ngx_n ", $ngx_try not found$ngx_c"
fi
echo "----------" >> $NGX_AUTOCONF_ERR
cat $NGX_AUTOTEST.c >> $NGX_AUTOCONF_ERR
echo "----------" >> $NGX_AUTOCONF_ERR
echo $ngx_test >> $NGX_AUTOCONF_ERR
echo "----------" >> $NGX_AUTOCONF_ERR
fi
rm -rf $NGX_AUTOTEST*
2003-11-25 14:44:56 -06:00
if [ $ngx_found != no ]; then
2003-11-25 14:44:56 -06:00
break
fi
done
if [ $ngx_found = no ]; then
2003-12-14 14:10:27 -06:00
echo
echo "$0: error: can not define $ngx_type"
2003-11-25 14:44:56 -06:00
exit 1
fi
if [ $ngx_found != yes ]; then
echo "typedef $ngx_found $ngx_type;" >> $NGX_AUTO_CONFIG_H
2003-11-25 14:44:56 -06:00
fi