|
24 | 24 |
|
25 | 25 | me=`basename $0`
|
26 | 26 |
|
| 27 | +# These switches are g++ specific, you may override if necessary. |
| 28 | +CXXFLAGS=${CXXFLAGS:- -fsyntax-only -Wall} |
| 29 | + |
27 | 30 | # Pull some info from configure's results.
|
28 | 31 | MGLOB="$builddir/src/Makefile.global"
|
| 32 | +CPPFLAGS=`sed -n 's/^CPPFLAGS[ ]*=[ ]*//p' "$MGLOB"` |
29 | 33 | CXX=`sed -n 's/^CXX[ ]*=[ ]*//p' "$MGLOB"`
|
30 | 34 | perl_includespec=`sed -n 's/^perl_includespec[ ]*=[ ]*//p' "$MGLOB"`
|
31 | 35 | python_includespec=`sed -n 's/^python_includespec[ ]*=[ ]*//p' "$MGLOB"`
|
32 | 36 |
|
33 |
| -# These switches are g++ specific, you may override if necessary. |
34 |
| -CXXFLAGS=${CXXFLAGS:- -fsyntax-only -Wall} |
| 37 | +# Extract any -I and -D switches from CPPFLAGS. |
| 38 | +# (If necessary, user can pass more switches by presetting EXTRAFLAGS.) |
| 39 | +for flag in $CPPFLAGS; do |
| 40 | + case $flag in |
| 41 | + -I*|-D*) EXTRAFLAGS="$EXTRAFLAGS $flag";; |
| 42 | + esac |
| 43 | +done |
35 | 44 |
|
36 | 45 | # Create temp directory.
|
37 | 46 | tmp=`mktemp -d /tmp/$me.XXXXXX`
|
|
65 | 74 | # Likewise, these files are platform-specific, and the one
|
66 | 75 | # relevant to our platform will be included by atomics.h.
|
67 | 76 | test "$f" = src/include/port/atomics/arch-arm.h && continue
|
| 77 | + test "$f" = src/include/port/atomics/arch-hppa.h && continue |
| 78 | + test "$f" = src/include/port/atomics/arch-ia64.h && continue |
| 79 | + test "$f" = src/include/port/atomics/arch-ppc.h && continue |
| 80 | + test "$f" = src/include/port/atomics/arch-x86.h && continue |
68 | 81 | test "$f" = src/include/port/atomics/fallback.h && continue
|
69 | 82 | test "$f" = src/include/port/atomics/generic.h && continue
|
70 | 83 | test "$f" = src/include/port/atomics/generic-acc.h && continue
|
71 | 84 | test "$f" = src/include/port/atomics/generic-gcc.h && continue
|
72 | 85 | test "$f" = src/include/port/atomics/generic-msvc.h && continue
|
| 86 | + test "$f" = src/include/port/atomics/generic-sunpro.h && continue |
73 | 87 | test "$f" = src/include/port/atomics/generic-xlc.h && continue
|
74 | 88 |
|
75 | 89 | # rusagestub.h is also platform-specific, and will be included
|
|
145 | 159 | ${CXX:-g++} -I $builddir -I $srcdir \
|
146 | 160 | -I $builddir/src/include -I $srcdir/src/include \
|
147 | 161 | -I $builddir/src/interfaces/libpq -I $srcdir/src/interfaces/libpq \
|
148 |
| - $EXTRAINCLUDES $CXXFLAGS -c $tmp/test.cpp |
| 162 | + $EXTRAINCLUDES $EXTRAFLAGS $CXXFLAGS -c $tmp/test.cpp |
149 | 163 |
|
150 | 164 | done
|
0 commit comments