summaryrefslogtreecommitdiffhomepage
path: root/auto/inc
blob: 1c84eae5aa5f73c7dce2f5608a2d816b5dfb76f6 (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

echo "checking for $NGX_INC"

NGX_FOUND=NO

inc=`echo $NGX_INC | sed -e 's/\./_/' | sed -e 's/\//_/' | tr '[a-z]' '[A-Z]'`

echo "#include <$NGX_INC>" > autotest.c
echo "int main() { return 0; }" >> autotest.c

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

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

    echo "#ifndef HAVE_$inc"      >> $NGX_AUTO_CONFIG_H
    echo "#define HAVE_$inc  1"   >> $NGX_AUTO_CONFIG_H
    echo "#endif"                 >> $NGX_AUTO_CONFIG_H
    echo                          >> $NGX_AUTO_CONFIG_H

    eval "NGX_$inc='#include <$NGX_INC>'"
    NGX_FOUND=YES

else
    echo " + $NGX_INC not found"
fi

rm autotest*