~ubuntu-branches/ubuntu/natty/postgresql-8.4/natty-updates

« back to all changes in this revision

Viewing changes to src/tools/pginclude/pgcompinclude

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-03-20 12:00:13 UTC
  • Revision ID: james.westby@ubuntu.com-20090320120013-hogj7egc5mjncc5g
Tags: upstream-8.4~0cvs20090328
ImportĀ upstreamĀ versionĀ 8.4~0cvs20090328

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
:
 
2
# report which #include files can not compile on their own
 
3
# takes -v option to display compile failure message and line numbers
 
4
# $PostgreSQL$
 
5
 
 
6
trap "rm -f /tmp/$$.c /tmp/$$.o /tmp/$$ /tmp/$$a" 0 1 2 3 15
 
7
find . \( -name CVS -a -prune \) -o -name '*.h' -type f -print | while read FILE
 
8
do
 
9
        sed 's/->[a-zA-Z0-9_\.]*//g' "$FILE" >/tmp/$$a
 
10
        echo "#include \"postgres.h\"" >/tmp/$$.c
 
11
        echo "#include \"/tmp/$$a\"" >>/tmp/$$.c
 
12
        echo "void include_test(void);" >>/tmp/$$.c
 
13
        echo "void include_test() {" >>/tmp/$$.c
 
14
        pgdefine "$FILE" >>/tmp/$$.c
 
15
        echo "}" >>/tmp/$$.c
 
16
        cc -fsyntax-only -Werror -Wall -Wmissing-prototypes \
 
17
                -Wmissing-declarations -I/pg/include -I/pg/backend \
 
18
                -I/pg/interfaces/libpq -I`dirname $FILE` $CFLAGS -c /tmp/$$.c \
 
19
                -o /tmp/$$.o >/tmp/$$ 2>&1
 
20
        if [ "$?" -ne 0 ]
 
21
        then    echo "$FILE"
 
22
                if [ "$1" = "-v" ]
 
23
                then    cat /tmp/$$
 
24
                        nl /tmp/$$.c
 
25
                        echo
 
26
                fi
 
27
        fi
 
28
done