postgresql/src/tools/pginclude/pgcompinclude

27 lines
957 B
Text
Raw Normal View History

:
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-07-10 22:01:24 -04:00
# $PostgreSQL: pgsql/src/tools/pginclude/pgcompinclude,v 1.6 2006/07/11 02:01:24 momjian Exp $
trap "rm -f /tmp/$$.c /tmp/$$.o /tmp/$$ /tmp/$$a" 0 1 2 3 15
find . \( -name CVS -a -prune \) -o -name '*.h' -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
echo "void include_test(void);" >>/tmp/$$.c
1999-07-15 12:55:32 -04:00
echo "void include_test() {" >>/tmp/$$.c
pgdefine "$FILE" >>/tmp/$$.c
echo "}" >>/tmp/$$.c
2006-07-10 14:39:32 -04:00
cc $CFLAGS -fsyntax-only -Werror -Wall -Wmissing-prototypes -Wmissing-declarations \
2006-07-10 22:01:24 -04:00
-I/pg/include -I/pg/backend -I/pg/interfaces/libpq -I`dirname $FILE` -c /tmp/$$.c -o /tmp/$$.o >/tmp/$$ 2>&1
if [ "$?" -ne 0 ]
then echo "$FILE"
if [ "$1" = "-v" ]
then cat /tmp/$$
nl /tmp/$$.c
echo
fi
fi
done