File: check_header.sh

package info (click to toggle)
dwb 20140702hg-2
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,860 kB
  • ctags: 2,802
  • sloc: ansic: 27,062; makefile: 341; sh: 84
file content (12 lines) | stat: -rwxr-xr-x 147 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/sh

HEADER="$1"
CC="${2:-gcc}"

echo "#include <$HEADER>" | "${CC}" -E - &>/dev/null
if [ $? -eq 0 ]; then 
    echo 1
else 
    echo 0
fi