blob: dc58054cb36d278b6a113df68050d5a46cb999b1 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
# Copyright (C) Igor Sysoev
# Copyright (C) NGINX, Inc.
$echo -n "checking for $nxt_feature ..."
cat << END >> $NXT_AUTOCONF_ERR
----------------------------------------
checking for $nxt_feature
END
nxt_found=no
nxt_feature_value=
nxt_feature_inc_path=
if test -n "$nxt_feature_incs"; then
case "$nxt_feature_incs" in
-*)
nxt_feature_inc_path="$nxt_feature_incs"
;;
*)
for nxt_temp in $nxt_feature_incs; do
nxt_feature_inc_path="$nxt_feature_inc_path -I $nxt_temp"
done
;;
esac
fi
cat << END > $NXT_AUTOTEST.c
$nxt_feature_test
END
nxt_test="$CC $CFLAGS $NXT_CFLAGS $NXT_CC_OPT $NXT_TEST_CFLAGS \
$nxt_feature_inc_path -o $NXT_AUTOTEST $NXT_AUTOTEST.c \
$nxt_feature_libs $NXT_LD_OPT $NXT_TEST_LIBS"
# /bin/sh -c "(...)" is to intercept "Killed", "Abort trap",
# "Segmentation fault", or other shell messages.
# "|| true" is to bypass "set -e" setting.
/bin/sh -c "($nxt_test || true)" >> $NXT_AUTOCONF_ERR 2>&1
if [ -x $NXT_AUTOTEST ]; then
case "$nxt_feature_run" in
value)
if /bin/sh -c "($NXT_AUTOTEST)" >> $NXT_AUTOCONF_ERR 2>&1; then
$echo >> $NXT_AUTOCONF_ERR
nxt_found=yes
nxt_feature_value=`$NXT_AUTOTEST`
$echo " $nxt_feature_value"
if [ -n "$nxt_feature_name" ]; then
cat << END >> $NXT_AUTO_CONFIG_H
#ifndef $nxt_feature_name
#define $nxt_feature_name $nxt_feature_value
#endif
END
fi
else
$echo " not found"
fi
;;
yes)
if /bin/sh -c "($NXT_AUTOTEST)" >> $NXT_AUTOCONF_ERR 2>&1; then
$echo " found"
nxt_found=yes
if [ -n "$nxt_feature_name" ]; then
cat << END >> $NXT_AUTO_CONFIG_H
#ifndef $nxt_feature_name
#define $nxt_feature_name 1
#endif
END
fi
else
$echo " found but is not working"
fi
;;
*)
$echo " found"
nxt_found=yes
if [ -n "$nxt_feature_name" ]; then
cat << END >> $NXT_AUTO_CONFIG_H
#ifndef $nxt_feature_name
#define $nxt_feature_name 1
#endif
END
fi
;;
esac
else
$echo " not found"
$echo "----------" >> $NXT_AUTOCONF_ERR
cat $NXT_AUTOTEST.c >> $NXT_AUTOCONF_ERR
$echo "----------" >> $NXT_AUTOCONF_ERR
$echo $nxt_test >> $NXT_AUTOCONF_ERR
$echo "----------" >> $NXT_AUTOCONF_ERR
fi
rm -rf $NXT_AUTOTEST*
|