summaryrefslogtreecommitdiff
path: root/tools/check_header.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tools/check_header.sh')
-rwxr-xr-xtools/check_header.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/check_header.sh b/tools/check_header.sh
new file mode 100755
index 00000000..19d7064a
--- /dev/null
+++ b/tools/check_header.sh
@@ -0,0 +1,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
+