2003-11-20 11:36:43 -06:00
|
|
|
|
2004-09-29 11:00:49 -05:00
|
|
|
# Copyright (C) Igor Sysoev
|
|
|
|
|
|
|
|
|
2004-10-21 10:34:38 -05:00
|
|
|
echo $ngx_n "checking for $ngx_type ...$ngx_c"
|
2003-11-25 14:44:56 -06:00
|
|
|
|
2004-10-21 10:34:38 -05:00
|
|
|
cat << END >> $NGX_AUTOCONF_ERR
|
2003-11-25 14:44:56 -06:00
|
|
|
|
2004-10-21 10:34:38 -05: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>
|
2004-10-21 10:34:38 -05:00
|
|
|
$NGX_INCLUDE_INTTYPES_H
|
2003-12-14 14:10:27 -06:00
|
|
|
|
|
|
|
int main() {
|
2004-10-21 10:34:38 -05:00
|
|
|
$ngx_try i = 0;
|
2003-12-14 14:10:27 -06:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
END
|
|
|
|
|
2005-12-05 07:18:09 -06:00
|
|
|
ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
|
|
|
|
-o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
|
|
|
|
|
2004-10-21 10:34:38 -05:00
|
|
|
eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
|
2003-12-14 14:10:27 -06:00
|
|
|
|
|
|
|
if [ -x $NGX_AUTOTEST ]; then
|
2004-10-21 10:34:38 -05:00
|
|
|
if [ $ngx_try = $ngx_type ]; then
|
2003-12-14 14:10:27 -06:00
|
|
|
echo " found"
|
2004-10-21 10:34:38 -05:00
|
|
|
ngx_found=yes
|
2003-11-25 14:44:56 -06:00
|
|
|
else
|
2004-10-21 10:34:38 -05:00
|
|
|
echo ", $ngx_try used"
|
|
|
|
ngx_found=$ngx_try
|
2003-11-25 14:44:56 -06:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2004-10-21 10:34:38 -05:00
|
|
|
rm -f $NGX_AUTOTEST
|
|
|
|
|
|
|
|
if [ $ngx_found = no ]; then
|
|
|
|
echo $ngx_n " $ngx_try not found$ngx_c"
|
|
|
|
|
|
|
|
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
|
2003-11-25 14:44:56 -06:00
|
|
|
|
|
|
|
else
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2004-10-21 10:34:38 -05:00
|
|
|
if [ $ngx_found = no ]; then
|
2003-12-14 14:10:27 -06:00
|
|
|
echo
|
|
|
|
echo "$0: error: can not define $ngx_type"
|
2004-10-21 10:34:38 -05:00
|
|
|
|
2003-11-25 14:44:56 -06:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2004-10-21 10:34:38 -05:00
|
|
|
if [ $ngx_found != yes ]; then
|
|
|
|
echo "typedef $ngx_found $ngx_type;" >> $NGX_AUTO_CONFIG_H
|
2003-11-25 14:44:56 -06:00
|
|
|
fi
|