summaryrefslogtreecommitdiffstats
path: root/testincl
blob: 47c074fa33661316e598acde75bab56039d3fab7 (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
#!/bin/sh
#
# call:
#	COMPILE=...; export COMPILE
#	if ./testincl [-q] "foo.h" ...
#
echo=echo
case $1 in -q)
    echo=":"
    shift
    ;;
esac
IFILE="<$1>"

echo "
#include $IFILE
main(){ exit(0); }
" > conftest.c
eval $COMPILE
if test -s conftest && ./conftest 2>/dev/null; then
	res=0
	$echo "You have $IFILE"
else
        res=1
	$echo "You don't have $IFILE"
fi
rm -f conftest conftest.c
exit $res