added small script to check for usability of headers
authorChristoph Junghans <junghans@mpip-mainz.mpg.de>
Wed, 28 Jul 2010 17:14:08 +0000 (19:14 +0200)
committerChristoph Junghans <junghans@mpip-mainz.mpg.de>
Wed, 28 Jul 2010 17:14:08 +0000 (19:14 +0200)
scripts/checkheaders.sh [new file with mode: 0755]

diff --git a/scripts/checkheaders.sh b/scripts/checkheaders.sh
new file mode 100755 (executable)
index 0000000..c011b08
--- /dev/null
@@ -0,0 +1,23 @@
+#! /bin/bash
+
+incldir="../include"
+rm -f gromacs
+ln -s $incldir gromacs
+
+if [ -z "$1" ]; then
+  files=$(cd $incldir; find -name "*.h" | sed 's/^\./gromacs/')
+else
+  files="$@"
+fi
+
+for i in $files; do
+  echo $i
+  cat << EOF > t.c
+#include <$i>
+int main(){
+  return 0;
+}
+EOF
+  gcc -I. -c t.c -D bool=int || echo "Failed"
+done
+rm -f gromacs t.[co]