From: Timo Sirainen Date: Fri, 16 Dec 2011 10:50:53 +0000 (+0200) Subject: --enable-devel-checks: Use -fcatch-undefined-behavior -ftrapv with clang. X-Git-Tag: 2.1.rc2~34 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1d9ecfa7f060da746c5bfa1690c02cadea7423f0;p=thirdparty%2Fdovecot%2Fcore.git --enable-devel-checks: Use -fcatch-undefined-behavior -ftrapv with clang. --- diff --git a/configure.in b/configure.in index 1bb6f0ec27..aa01f2ad7f 100644 --- a/configure.in +++ b/configure.in @@ -33,6 +33,7 @@ AC_ARG_ENABLE(devel-checks, AS_HELP_STRING([--enable-devel-checks], [Enable some extra expensive checks for developers]), if test x$enableval = xyes; then AC_DEFINE(DEBUG,, Build with extra debugging checks) + want_devel_checks=yes fi) AC_ARG_ENABLE(asserts, @@ -319,6 +320,12 @@ if test "x$ac_cv_c_compiler_gnu" = "xyes"; then CFLAGS="$old_cflags" ]) fi +if $CC -dM -E -x c /dev/null | grep __clang__ > /dev/null 2>&1; then + # clang specific options + if test "$want_devel_checks" = "yes"; then + CFLAGS="$CFLAGS -fcatch-undefined-behavior -ftrapv" + fi +fi dnl ** dnl ** just some generic stuff...