summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2015-05-31 09:49:05 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2015-05-31 09:49:05 +0000
commit70ae0d06f8d11f616f0a89834ac42d2b0459e06d (patch)
treef3af9e65cfab5286efe5bde33721c9843377a9ab
parent8a5520c41395975e3344247eb156c7795fd30c7a (diff)
downloadmpfr-70ae0d06f8d11f616f0a89834ac42d2b0459e06d.tar.gz
[configure.ac] For the gcc compiler, better choice of the -W flags
when the selected language is C++ (e.g. when CC=g++). (merged changeset r9478 from the trunk) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@9479 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r--configure.ac16
1 files changed, 15 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 1648b97eb..0e294642c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -339,7 +339,21 @@ error
dnl If compiler is gcc, then use some specific flags.
dnl But don't touch user other flags.
if test "$test_CFLAGS" != set && test -n "$GCC"; then
- CFLAGS="-Wall -Wmissing-prototypes -Wpointer-arith $CFLAGS"
+ CFLAGS="-Wpointer-arith $CFLAGS"
+ AC_MSG_CHECKING(whether the selected language is C++)
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#if defined (__cplusplus)
+# error "C++"
+error
+#endif
+ ]], [[]])],[
+ AC_MSG_RESULT(no)
+ CFLAGS="-Wmissing-prototypes $CFLAGS"
+ ],[
+ AC_MSG_RESULT(yes)
+ CFLAGS="-Wmissing-declarations -Wno-sign-compare $CFLAGS"
+ ])
+ CFLAGS="-Wall $CFLAGS"
fi
AM_PROG_CC_C_O