2009-07-16 08:33:46 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2010-12-27 18:51:44 +01:00
|
|
|
# Check all exported PostgreSQL include files for C++ compatibility.
|
|
|
|
# Run this from the top-level source directory after performing a build.
|
2009-07-16 08:33:46 +02:00
|
|
|
# No output if everything is OK, else compiler errors.
|
|
|
|
|
|
|
|
me=`basename $0`
|
|
|
|
|
|
|
|
tmp=`mktemp -d /tmp/$me.XXXXXX`
|
|
|
|
|
2010-12-27 18:51:44 +01:00
|
|
|
trap 'rm -rf $tmp' 0 1 2 3 15
|
2009-07-16 08:33:46 +02:00
|
|
|
|
2010-12-27 18:51:44 +01:00
|
|
|
# Omit src/include/port/, because it's platform specific, and c.h includes
|
|
|
|
# the relevant file anyway.
|
|
|
|
# rusagestub.h is also platform-specific, and will be included by
|
|
|
|
# utils/pg_rusage.h if necessary.
|
|
|
|
# regex/regerrs.h is not meant to be included standalone.
|
|
|
|
# parser/gram.h will be included by parser/gramparse.h.
|
|
|
|
# parser/kwlist.h is not meant to be included standalone.
|
|
|
|
|
|
|
|
for f in `find src/include src/interfaces/libpq/libpq-fe.h src/interfaces/libpq/libpq-events.h -name '*.h' -print | \
|
|
|
|
grep -v -e ^src/include/port/ \
|
|
|
|
-e ^src/include/rusagestub.h -e ^src/include/regex/regerrs.h \
|
|
|
|
-e ^src/include/parser/gram.h -e ^src/include/parser/kwlist.h`
|
|
|
|
do
|
|
|
|
{
|
|
|
|
echo ' extern "C" {'
|
|
|
|
echo '#include "postgres.h"'
|
|
|
|
echo "#include \"$f\""
|
|
|
|
echo '};'
|
|
|
|
} >$tmp/test.cpp
|
|
|
|
|
2010-12-27 21:03:24 +01:00
|
|
|
${CXX:-g++} -I . -I src/include -fsyntax-only -Wall -c $tmp/test.cpp
|
2009-07-16 08:33:46 +02:00
|
|
|
done
|