2 trap "rm -f /tmp/$$.c /tmp/$$.o /tmp/$$ /tmp/$$a /tmp/$$b" 0 1 2 3 15
3 find . \( -name CVS -a -prune \) -o -type f -print | grep -v '\./postgres.h' |
6 if [ "`echo $FILE | sed -n 's/^.*\.\([^\.]*\)$/\1/p'`" = "h" ]
11 if [ "$IS_INCLUDE" = "Y" ]
12 then cat "$FILE" | grep -v "^#if" | grep -v "^#else" |
13 grep -v "^#endif" | sed 's/->[a-zA-Z0-9_\.]*//g' >/tmp/$$a
14 else cat "$FILE" >/tmp/$$a
16 cat /tmp/$$a | grep "^#include" |
17 sed 's/#include[ ]*[<"]\([^>"]*\).*$/\1/g' |
20 [ -s /usr/include/$INCLUDE ] && continue
21 [ "$INCLUDE" = postgres.h ] && continue
23 grep -v '^#include[ ]*[<"]'"$INCLUDE"'[>"]' >/tmp/$$b
24 if [ "$IS_INCLUDE" = "Y" ]
25 then echo "#include \"postgres.h\"" >/tmp/$$.c
28 echo "#include \"/tmp/$$b\"" >>/tmp/$$.c
29 echo "void include_test(void);" >>/tmp/$$.c
30 echo "void include_test() {" >>/tmp/$$.c
31 if [ "$IS_INCLUDE" = "Y" ]
32 then pgdefine "$FILE" >>/tmp/$$.c
35 cc -fsyntax-only -Werror -Wall -Wmissing-prototypes -Wmissing-declarations -I/pg/include -I/pg/backend -c /tmp/$$.c -o /tmp/$$.o >/tmp/$$ 2>&1
37 then echo "$FILE $INCLUDE"
38 if [ "$IS_INCLUDE" = "N" ]
39 then grep -v '#include[ ]*[<"]$INCLUDE[>"]' $FILE >/tmp/$$b