1999-07-15 11:21:54 -04:00
|
|
|
:
|
2000-06-14 18:28:16 -04:00
|
|
|
# report which #include files can not compile on their own
|
|
|
|
|
# takes -v option to display compile failure message and line numbers
|
2006-03-10 23:38:42 -05:00
|
|
|
# $PostgreSQL: pgsql/src/tools/pginclude/pgcompinclude,v 1.2 2006/03/11 04:38:42 momjian Exp $
|
2000-05-29 13:40:45 -04:00
|
|
|
|
1999-07-15 11:21:54 -04:00
|
|
|
trap "rm -f /tmp/$$.c /tmp/$$.o /tmp/$$ /tmp/$$a" 0 1 2 3 15
|
|
|
|
|
find . \( -name CVS -a -prune \) -o -name '*.[ch]' -type f -print | while read FILE
|
|
|
|
|
do
|
|
|
|
|
sed 's/->[a-zA-Z0-9_\.]*//g' "$FILE" >/tmp/$$a
|
|
|
|
|
echo "#include \"postgres.h\"" >/tmp/$$.c
|
|
|
|
|
echo "#include \"/tmp/$$a\"" >>/tmp/$$.c
|
1999-07-15 15:21:43 -04:00
|
|
|
echo "void include_test(void);" >>/tmp/$$.c
|
1999-07-15 12:55:32 -04:00
|
|
|
echo "void include_test() {" >>/tmp/$$.c
|
1999-07-15 11:21:54 -04:00
|
|
|
pgdefine "$FILE" >>/tmp/$$.c
|
|
|
|
|
echo "}" >>/tmp/$$.c
|
1999-07-15 15:21:43 -04:00
|
|
|
cc -fsyntax-only -Werror -Wall -Wmissing-prototypes -Wmissing-declarations -I/pg/include -I/pg/backend -c /tmp/$$.c -o /tmp/$$.o >/tmp/$$ 2>&1
|
1999-07-15 11:21:54 -04:00
|
|
|
if [ "$?" -ne 0 ]
|
|
|
|
|
then echo "$FILE"
|
|
|
|
|
if [ "$1" = "-v" ]
|
|
|
|
|
then cat /tmp/$$
|
|
|
|
|
nl /tmp/$$.c
|
|
|
|
|
echo
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
done
|