aboutsummaryrefslogtreecommitdiff
path: root/auto/func
blob: 553333dc0fc10c487f52e50069947a93f62fc9e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
echo "checking for $NGX_FUNC"

func=`echo $NGX_FUNC | sed -e 's/()$//' | tr '[a-z]' '[A-Z]'`

echo "$NGX_UNISTD_H" > autotest.c
echo "$NGX_FUNC_INC" >> autotest.c
echo "int main() { $NGX_FUNC_TEST; return 0; }" >> autotest.c

eval "$CC $CC_TEST_FLAGS -o autotest autotest.c > /dev/null 2>&1"

if [ -x autotest ]; then
    echo " + $NGX_FUNC found"

    echo "#ifndef HAVE_$func"      >> $NGX_AUTO_CONFIG_H
    echo "#define HAVE_$func  1"   >> $NGX_AUTO_CONFIG_H
    echo "#endif"                  >> $NGX_AUTO_CONFIG_H
    echo                           >> $NGX_AUTO_CONFIG_H
else
    echo " + $NGX_FUNC not found"
fi

rm autotest*