1 #! /bin/sh
2 # Check that each .h file has all the includes it needs.
4 # Probably requires gnu find (for -printf '%P\n').
6 # This script hereby placed into the public domain.
8 set -e
9 mydir=`dirname "$0"`
10 cd "$mydir"
11 srcdir="@srcdir@"
12 CXX="@CXX@"
13 INKSCAPE_CFLAGS="@INKSCAPE_CFLAGS@"
14 OBJEXT="@OBJEXT@"
15 config_h_dir=..
17 check_compile () {
18 (echo "#include <config.h>"; echo "#include <$1>"; echo "int header_tst_dummy;") > header-tst.cpp
19 $CXX -c -I. -I"$srcdir" -I$config_h_dir $INKSCAPE_CFLAGS header-tst.cpp
20 }
22 if [ $# = 0 ]; then
23 for i in `find "$srcdir" \
24 -name bonobo -prune \
25 -o -name ecma -prune \
26 -o -name render -prune \
27 -o -name xpath -prune \
28 -o -path '*/extension/script/js' -prune \
29 -o -name '*.h' \
30 \! -name gnome.h \! -name win32.h \! -name nr-type-gnome.h \! -name nr-type-w32.h \! -name Livarot.h \! -name radial.h \
31 \! -name '*-test.h' \
32 -printf '%P\n'`
33 do
34 check_compile "$i"
35 done
36 else
37 for i in "$@"; do
38 check_compile "$i"
39 done
40 fi
41 rm header-tst.cpp header-tst.$OBJEXT