diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index 38d59c65e..bf7c8835e 100644 --- a/configure.ac +++ b/configure.ac @@ -458,8 +458,6 @@ dnl (__GMP_CFLAGS macro in gmp.h) above. The consequence is that this dnl might yield a compilation failure if the -Werror option appears in dnl __GMP_CFLAGS. But in this case, since -Werror is not used by default, dnl one may expect that the user would also set CFLAGS for MPFR. -dnl Note: When the compiler is GCC not in C++ mode, -Wc++-compat may be -dnl interesting, but it has been introduced in GCC 4.1 only. if test "$test_CFLAGS" != set && test -n "$GCC"; then CFLAGS="-Wpointer-arith $CFLAGS" AC_MSG_CHECKING(whether the selected language is C++) @@ -470,12 +468,20 @@ error #endif ]], [[]])],[ AC_MSG_RESULT(no) + dnl The option -Wc++-compat is available in GCC 4.1.0 and newer. + [ + case `$CC --version | $SED -e 's/^[^ ]* //' -e 's/([^)]*) //' -e 1q` in + 2.*|3.*|4.0*) ;; + *) CFLAGS="-Wc++-compat $CFLAGS" ;; + esac CFLAGS="-Wmissing-prototypes $CFLAGS" + ] ],[ AC_MSG_RESULT(yes) CFLAGS="-Wmissing-declarations -Wno-sign-compare $CFLAGS" ]) CFLAGS="-Wall $CFLAGS" + AC_MSG_NOTICE([using CFLAGS="$CFLAGS"]) fi AM_PROG_CC_C_O |