File: testincl

package info (click to toggle)
cfdisk-utf8 2.11n-5%2B1
  • links: PTS
  • area: main
  • in suites: sarge, woody
  • size: 600 kB
  • ctags: 1,187
  • sloc: ansic: 10,113; sh: 586; makefile: 155
file content (31 lines) | stat: -rwxr-xr-x 583 bytes parent folder | download | duplicates (8)
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
#!/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
# 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
	res=0
	$echo "You have $IFILE"
else
        res=1
	$echo "You don't have $IFILE"
fi
rm -f conftest conftest.c
exit $res