Add updates.

This commit is contained in:
Bruce Momjian 1999-07-15 16:55:32 +00:00
parent 3c4447fd97
commit 353eb3dadf
2 changed files with 24 additions and 6 deletions

View File

@ -5,7 +5,7 @@ do
sed 's/->[a-zA-Z0-9_\.]*//g' "$FILE" >/tmp/$$a
echo "#include \"postgres.h\"" >/tmp/$$.c
echo "#include \"/tmp/$$a\"" >>/tmp/$$.c
echo "void main() {" >>/tmp/$$.c
echo "void include_test() {" >>/tmp/$$.c
pgdefine "$FILE" >>/tmp/$$.c
echo "}" >>/tmp/$$.c
cc -Werror -Wall -I/pg/include -I/pg/backend -c /tmp/$$.c -o /tmp/$$.o >/tmp/$$ 2>&1

View File

@ -1,9 +1,18 @@
:
trap "rm -f /tmp/$$.c /tmp/$$.o /tmp/$$ /tmp/$$a /tmp/$$b" 0 1 2 3 15
find . \( -name CVS -a -prune \) -o -type f -print | while read FILE
find . \( -name CVS -a -prune \) -o -type f -print | grep -v postgres.h |
while read FILE
do
cat "$FILE" | grep -v "^#if" | grep -v "^#else" |
if [ "`echo $FILE | sed -n 's/^.*\.\([^\.]*\)$/\1/p'`" = "h" ]
then IS_INCLUDE="Y"
else IS_INCLUDE="N"
fi
if [ "$IS_INCLUDE" = "Y" ]
then cat "$FILE" | grep -v "^#if" | grep -v "^#else" |
grep -v "^#endif" | sed 's/->[a-zA-Z0-9_\.]*//g' >/tmp/$$a
else cat "$FILE" >/tmp/$$a
fi
cat /tmp/$$a | grep "^#include" |
sed 's/#include[ ]*[<"]\([^>"]*\).*$/\1/g' |
while read INCLUDE
@ -11,14 +20,23 @@ do
[ -s /usr/include/$INCLUDE ] && continue
cat /tmp/$$a |
grep -v '^#include[ ]*[<"]'"$INCLUDE"'[>"]' >/tmp/$$b
echo "#include \"postgres.h\"" >/tmp/$$.c
if [ "$IS_INCLUDE" = "Y" ]
then echo "#include \"postgres.h\"" >/tmp/$$.c
else >/tmp/$$.c
fi
echo "#include \"/tmp/$$b\"" >>/tmp/$$.c
echo "void main() {" >>/tmp/$$.c
pgdefine "$FILE" >>/tmp/$$.c
echo "void include_test() {" >>/tmp/$$.c
if [ "$IS_INCLUDE" = "Y" ]
then pgdefine "$FILE" >>/tmp/$$.c
fi
echo "}" >>/tmp/$$.c
cc -Werror -Wall -I/pg/include -I/pg/backend -c /tmp/$$.c -o /tmp/$$.o >/tmp/$$ 2>&1
if [ "$?" -eq 0 ]
then echo "$FILE $INCLUDE"
if [ "$IS_INCLUDE" = "N" ]
then grep -v '#include[ ]*[<"]$FILE[>"]' >/tmp/$$a
mv /tmp/$$a "$FILE"
fi
if [ "$1" = "-v" ]
then cat /tmp/$$
cat /tmp/$$.c