2004-06-18 01:18:53 +08:00
|
|
|
|
2004-09-30 00:00:49 +08:00
|
|
|
# Copyright (C) Igor Sysoev
|
|
|
|
|
|
|
|
|
2004-10-21 23:34:38 +08:00
|
|
|
echo $ngx_n "checking for $ngx_feature ...$ngx_c"
|
|
|
|
|
|
|
|
cat << END >> $NGX_AUTOCONF_ERR
|
|
|
|
|
|
|
|
----------------------------------------
|
|
|
|
checking for $ngx_feature
|
|
|
|
|
|
|
|
END
|
2004-06-18 01:18:53 +08:00
|
|
|
|
|
|
|
ngx_found=no
|
|
|
|
|
2004-10-21 23:34:38 +08:00
|
|
|
if test -n "$ngx_feature_name"; then
|
2006-05-04 23:32:46 +08:00
|
|
|
ngx_have_feature=`echo $ngx_feature_name \
|
|
|
|
| tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`
|
2004-10-21 23:34:38 +08:00
|
|
|
fi
|
2004-06-18 01:18:53 +08:00
|
|
|
|
2006-11-27 19:07:09 +08:00
|
|
|
if test -n "$ngx_feature_path"; then
|
2008-08-04 22:48:15 +08:00
|
|
|
for ngx_temp in $ngx_feature_path; do
|
|
|
|
ngx_feature_inc_path="$ngx_feature_inc_path -I $ngx_temp"
|
|
|
|
done
|
2006-11-27 19:07:09 +08:00
|
|
|
fi
|
|
|
|
|
2004-06-18 01:18:53 +08:00
|
|
|
cat << END > $NGX_AUTOTEST.c
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
2004-10-21 23:34:38 +08:00
|
|
|
$NGX_INCLUDE_UNISTD_H
|
|
|
|
$ngx_feature_incs
|
2004-06-18 01:18:53 +08:00
|
|
|
|
|
|
|
int main() {
|
|
|
|
$ngx_feature_test;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
END
|
|
|
|
|
2004-10-21 23:34:38 +08:00
|
|
|
|
2006-11-27 19:07:09 +08:00
|
|
|
ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS $ngx_feature_inc_path \
|
2009-11-28 06:02:04 +08:00
|
|
|
-o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_TEST_LD_OPT $ngx_feature_libs"
|
2004-11-11 22:07:14 +08:00
|
|
|
|
2006-11-27 19:07:09 +08:00
|
|
|
ngx_feature_inc_path=
|
|
|
|
|
2006-12-24 04:31:14 +08:00
|
|
|
eval "/bin/sh -c \"$ngx_test\" >> $NGX_AUTOCONF_ERR 2>&1"
|
2004-10-21 23:34:38 +08:00
|
|
|
|
2004-06-18 01:18:53 +08:00
|
|
|
|
|
|
|
if [ -x $NGX_AUTOTEST ]; then
|
|
|
|
|
2006-03-10 20:51:52 +08:00
|
|
|
case "$ngx_feature_run" in
|
|
|
|
|
|
|
|
yes)
|
2006-09-18 20:27:33 +08:00
|
|
|
# /bin/sh is used to intercept "Killed" or "Abort trap" messages
|
2011-05-11 19:50:19 +08:00
|
|
|
if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then
|
2006-03-10 20:51:52 +08:00
|
|
|
echo " found"
|
|
|
|
ngx_found=yes
|
|
|
|
|
|
|
|
if test -n "$ngx_feature_name"; then
|
|
|
|
have=$ngx_have_feature . auto/have
|
|
|
|
fi
|
|
|
|
|
|
|
|
else
|
|
|
|
echo " found but is not working"
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
2010-11-25 19:04:03 +08:00
|
|
|
value)
|
|
|
|
# /bin/sh is used to intercept "Killed" or "Abort trap" messages
|
2011-05-11 19:50:19 +08:00
|
|
|
if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then
|
2010-11-25 19:04:03 +08:00
|
|
|
echo " found"
|
|
|
|
ngx_found=yes
|
|
|
|
|
|
|
|
cat << END >> $NGX_AUTO_CONFIG_H
|
|
|
|
|
|
|
|
#ifndef $ngx_feature_name
|
|
|
|
#define $ngx_feature_name `$NGX_AUTOTEST`
|
|
|
|
#endif
|
|
|
|
|
|
|
|
END
|
|
|
|
else
|
|
|
|
echo " found but is not working"
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
2006-03-10 20:51:52 +08:00
|
|
|
bug)
|
2006-09-18 20:27:33 +08:00
|
|
|
# /bin/sh is used to intercept "Killed" or "Abort trap" messages
|
2011-05-11 19:50:19 +08:00
|
|
|
if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then
|
2006-03-10 20:51:52 +08:00
|
|
|
echo " not found"
|
|
|
|
|
|
|
|
else
|
|
|
|
echo " found"
|
|
|
|
ngx_found=yes
|
|
|
|
|
|
|
|
if test -n "$ngx_feature_name"; then
|
|
|
|
have=$ngx_have_feature . auto/have
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
echo " found"
|
|
|
|
ngx_found=yes
|
|
|
|
|
|
|
|
if test -n "$ngx_feature_name"; then
|
|
|
|
have=$ngx_have_feature . auto/have
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|
2004-06-18 01:18:53 +08:00
|
|
|
|
|
|
|
else
|
|
|
|
echo " not found"
|
2004-10-21 23:34:38 +08:00
|
|
|
|
|
|
|
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
|
2004-06-18 01:18:53 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
rm $NGX_AUTOTEST*
|