2006-12-06 17:25:41 -06:00
|
|
|
#!/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
|
2006-12-06 17:25:49 -06:00
|
|
|
# Brian Murphy asks not to run conftest since that fails on cross-compilation.
|
|
|
|
# Maybe just testing for the existence of conftest suffices.
|
|
|
|
# if test -s conftest && ./conftest 2>/dev/null; then
|
|
|
|
if test -s conftest 2>/dev/null; then
|
2006-12-06 17:25:41 -06:00
|
|
|
res=0
|
|
|
|
$echo "You have $IFILE"
|
|
|
|
else
|
|
|
|
res=1
|
|
|
|
$echo "You don't have $IFILE"
|
|
|
|
fi
|
|
|
|
rm -f conftest conftest.c
|
|
|
|
exit $res
|