147 lines
3.0 KiB
Plaintext
147 lines
3.0 KiB
Plaintext
|
|
# Copyright (C) 2024 Web Server LLC
|
|
# Copyright (C) Igor Sysoev
|
|
# Copyright (C) Nginx, Inc.
|
|
|
|
|
|
if check_cache "$ngx_feature" "feature"; then
|
|
return
|
|
fi
|
|
|
|
echo $ngx_n "checking for $ngx_feature ...$ngx_c"
|
|
|
|
cat << END >> $NGX_AUTOCONF_ERR
|
|
|
|
----------------------------------------
|
|
checking for $ngx_feature
|
|
|
|
END
|
|
|
|
ngx_found=no
|
|
ngx_add_have=no
|
|
ngx_add_value=no
|
|
|
|
if test -n "$ngx_feature_name"; then
|
|
name2macro "$ngx_feature_name"
|
|
ngx_have_feature="$res"
|
|
fi
|
|
|
|
if test -n "$ngx_feature_path"; then
|
|
for ngx_temp in $ngx_feature_path; do
|
|
ngx_feature_inc_path="$ngx_feature_inc_path -I $ngx_temp"
|
|
done
|
|
fi
|
|
|
|
cat << END > $NGX_AUTOTEST.c
|
|
|
|
#include <sys/types.h>
|
|
$NGX_INCLUDE_UNISTD_H
|
|
$ngx_feature_incs
|
|
|
|
int main(void) {
|
|
$ngx_feature_test;
|
|
return 0;
|
|
}
|
|
|
|
END
|
|
|
|
|
|
ngx_test="($CC -c $CC_TEST_FLAGS $CC_AUX_FLAGS $ngx_feature_inc_path \
|
|
-o $NGX_AUTOTEST.o $NGX_AUTOTEST.c && \
|
|
$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
|
|
-o $NGX_AUTOTEST $NGX_AUTOTEST.o $NGX_TEST_LD_OPT $ngx_feature_libs)"
|
|
|
|
ngx_feature_inc_path=
|
|
|
|
eval "/bin/sh -c \"$ngx_test\" >> $NGX_AUTOCONF_ERR 2>&1"
|
|
|
|
|
|
if [ -x $NGX_AUTOTEST ]; then
|
|
|
|
case "$ngx_feature_run" in
|
|
|
|
yes)
|
|
if runtest "feature" "$ngx_feature_name"; then
|
|
echo " found"
|
|
ngx_found=yes
|
|
|
|
if test -n "$ngx_feature_name"; then
|
|
have=$ngx_have_feature . auto/have
|
|
ngx_add_have=yes
|
|
fi
|
|
|
|
else
|
|
echo " found but is not working"
|
|
fi
|
|
;;
|
|
|
|
value)
|
|
if runtest "feature" "$ngx_feature_name"; then
|
|
echo " found"
|
|
ngx_found=yes
|
|
|
|
have="$ngx_feature_name" value="$ngx_rtval" . auto/define
|
|
ngx_add_value=$value
|
|
|
|
else
|
|
echo " found but is not working"
|
|
fi
|
|
;;
|
|
|
|
bug)
|
|
if runtest "feature" "$ngx_feature_name"; then
|
|
echo " not found"
|
|
|
|
else
|
|
echo " found"
|
|
ngx_found=yes
|
|
|
|
if test -n "$ngx_feature_name"; then
|
|
have=$ngx_have_feature . auto/have
|
|
ngx_add_have=yes
|
|
fi
|
|
fi
|
|
;;
|
|
|
|
*)
|
|
echo " found"
|
|
ngx_found=yes
|
|
|
|
if test -n "$ngx_feature_name"; then
|
|
have=$ngx_have_feature . auto/have
|
|
ngx_add_have=yes
|
|
fi
|
|
;;
|
|
|
|
esac
|
|
|
|
else
|
|
echo " not found"
|
|
|
|
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*
|
|
|
|
if [ $NGX_FEATURE_CACHE = NO ]; then
|
|
return
|
|
fi
|
|
|
|
cache_output_start
|
|
|
|
echo "ngx_found=$ngx_found"
|
|
|
|
if [ $ngx_add_have = yes ]; then
|
|
echo "have=$ngx_have_feature . auto/have"
|
|
fi
|
|
|
|
if [ $ngx_add_value != no ]; then
|
|
echo "have=\"$ngx_feature_name\" value=\"$ngx_add_value\" . auto/define"
|
|
fi
|
|
|
|
cache_output_end
|