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
|
2010-09-20 16:08:53 -04:00
|
|
|
# src/tools/pginclude/pgcompinclude
|
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-13 21:05:14 -04:00
|
|
|
cc -fsyntax-only -Werror -Wall -Wmissing-prototypes \
|
2006-07-11 16:12:29 -04:00
|
|
|
-Wmissing-declarations -I/pg/include -I/pg/backend \
|
2006-07-13 21:05:14 -04:00
|
|
|
-I/pg/interfaces/libpq -I`dirname $FILE` $CFLAGS -c /tmp/$$.c \
|
2006-07-11 16:12:29 -04:00
|
|
|
-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
|