diff options
| author | Bruce Momjian | 2006-04-21 23:11:58 +0000 |
|---|---|---|
| committer | Bruce Momjian | 2006-04-21 23:11:58 +0000 |
| commit | 899f49cfce7484b97be50d9c1aac2557ca7d359c (patch) | |
| tree | df190c01d86ef1f247080d8e1f3d6218c8d78d3c /configure.in | |
| parent | 1b4504ced27d902208114bdc936fef7b6e33d419 (diff) | |
Use special gcc -W flags only if we are using gcc, not if we are using
the Intel compiler.
Jeremy Drake
Diffstat (limited to 'configure.in')
| -rw-r--r-- | configure.in | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/configure.in b/configure.in index 8e627b9ce54..982e2081ce2 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -dnl $PostgreSQL: pgsql/configure.in,v 1.457 2006/04/19 16:32:08 tgl Exp $ +dnl $PostgreSQL: pgsql/configure.in,v 1.458 2006/04/21 23:11:58 momjian Exp $ dnl dnl Developers, please strive to achieve this order: dnl @@ -248,13 +248,22 @@ else fi fi -if test "$GCC" = yes; then - CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wpointer-arith -Winline" +# The Intel compiler on Linux supports most gcc options, but not +# all of them, so only add these options if we are really using +# gcc - # Some versions of GCC support some additional useful warning flags. - # Check whether they are supported, and add them to CFLAGS if so. - PGAC_PROG_CC_CFLAGS_OPT([-Wdeclaration-after-statement]) - PGAC_PROG_CC_CFLAGS_OPT([-Wendif-labels]) +if test "$GCC" = yes; then +AC_TRY_COMPILE([], [@%:@ifndef __INTEL_COMPILER +choke me +@%:@endif], [ICC=[yes]], [ICC=[no]]) + if test "$ICC" = no; then + CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wpointer-arith -Winline" + + # Some versions of GCC support some additional useful warning flags. + # Check whether they are supported, and add them to CFLAGS if so. + PGAC_PROG_CC_CFLAGS_OPT([-Wdeclaration-after-statement]) + PGAC_PROG_CC_CFLAGS_OPT([-Wendif-labels]) + fi # Disable strict-aliasing rules; needed for gcc 3.3+ PGAC_PROG_CC_CFLAGS_OPT([-fno-strict-aliasing]) |
