~ubuntu-branches/ubuntu/oneiric/libpgjava/oneiric

« back to all changes in this revision

Viewing changes to src/tools/pginclude/pgcompinclude

  • Committer: Bazaar Package Importer
  • Author(s): Arnaud Vandyck
  • Date: 2005-04-21 14:25:11 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20050421142511-wibh5vc31fkrorx7
Tags: 7.4.7-3
Built with sources...

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
 
 
5
trap "rm -f /tmp/$$.c /tmp/$$.o /tmp/$$ /tmp/$$a" 0 1 2 3 15
 
6
find . \( -name CVS -a -prune \) -o -name '*.[ch]' -type f -print | while read FILE
 
7
do
 
8
        sed 's/->[a-zA-Z0-9_\.]*//g' "$FILE" >/tmp/$$a
 
9
        echo "#include \"postgres.h\"" >/tmp/$$.c
 
10
        echo "#include \"/tmp/$$a\"" >>/tmp/$$.c
 
11
        echo "void include_test(void);" >>/tmp/$$.c
 
12
        echo "void include_test() {" >>/tmp/$$.c
 
13
        pgdefine "$FILE" >>/tmp/$$.c
 
14
        echo "}" >>/tmp/$$.c
 
15
        cc -fsyntax-only -Werror -Wall -Wmissing-prototypes -Wmissing-declarations -I/pg/include -I/pg/backend -c /tmp/$$.c -o /tmp/$$.o >/tmp/$$ 2>&1
 
16
        if [ "$?" -ne 0 ]
 
17
        then    echo "$FILE"
 
18
                if [ "$1" = "-v" ]
 
19
                then    cat /tmp/$$
 
20
                        nl /tmp/$$.c
 
21
                        echo
 
22
                fi
 
23
        fi
 
24
done