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-07-10 22:01:24 -04:00
|
|
|
# $PostgreSQL: pgsql/src/tools/pginclude/pgcompinclude,v 1.6 2006/07/11 02:01:24 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
|
2006-07-10 13:08:38 -04:00
|
|
|
find . \( -name CVS -a -prune \) -o -name '*.h' -type f -print | while read FILE
|
1999-07-15 11:21:54 -04:00
|
|
|
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
|
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
|
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
|