dovecot-2.1: configure: Avoid some unnecessary warnings with clang.
dovecot at dovecot.org
dovecot at dovecot.org
Thu Feb 9 16:28:05 EET 2012
details: http://hg.dovecot.org/dovecot-2.1/rev/671b637e20db
changeset: 14101:671b637e20db
user: Timo Sirainen <tss at iki.fi>
date: Thu Feb 09 15:53:18 2012 +0200
description:
configure: Avoid some unnecessary warnings with clang.
diffstat:
configure.in | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diffs (38 lines):
diff -r aea4151da8f6 -r 671b637e20db configure.in
--- a/configure.in Thu Feb 09 05:33:54 2012 +0200
+++ b/configure.in Thu Feb 09 15:53:18 2012 +0200
@@ -294,6 +294,12 @@
xfs/xqm.h execinfo.h ucontext.h malloc_np.h sys/utsname.h sys/vmount.h \
sys/utsname.h glob.h linux/falloc.h ucred.h)
+dnl * clang check
+have_clang=no
+if $CC -dM -E -x c /dev/null | grep __clang__ > /dev/null 2>&1; then
+ have_clang=yes
+fi
+
dnl * gcc specific options
if test "x$ac_cv_c_compiler_gnu" = "xyes"; then
# -Wcast-qual -Wcast-align -Wconversion -Wunreachable-code # too many warnings
@@ -301,8 +307,10 @@
# -Wmissing-format-attribute -Wmissing-noreturn -Wwrite-strings # a couple of warnings
CFLAGS="$CFLAGS -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wformat=2 -Wbad-function-cast"
- # This is simply to avoid warning when building strftime() wrappers..
- CFLAGS="$CFLAGS -fno-builtin-strftime"
+ if test "$have_clang" != "yes"; then
+ # This is simply to avoid warning when building strftime() wrappers..
+ CFLAGS="$CFLAGS -fno-builtin-strftime"
+ fi
AC_TRY_COMPILE([
#if __GNUC__ < 4
@@ -323,7 +331,7 @@
CFLAGS="$old_cflags"
])
fi
-if $CC -dM -E -x c /dev/null | grep __clang__ > /dev/null 2>&1; then
+if test "$have_clang" = "yes"; then
# clang specific options
if test "$want_devel_checks" = "yes"; then
CFLAGS="$CFLAGS -fcatch-undefined-behavior -ftrapv"
More information about the dovecot-cvs
mailing list