File: testincl

package info (click to toggle)
util-linux 2.12r-19
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 8,928 kB
  • ctags: 5,101
  • sloc: ansic: 46,134; sh: 8,041; makefile: 1,111; perl: 86; csh: 62; sed: 55
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