From: Florian Krohm Date: Fri, 24 Oct 2014 07:42:19 +0000 (+0000) Subject: Use AC_GCC_WARNING_COND to figure out whether the compiler X-Git-Tag: svn/VALGRIND_3_11_0~885 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e34eb41e96211e6b6a1521f37aec48008709c248;p=thirdparty%2Fvalgrind.git Use AC_GCC_WARNING_COND to figure out whether the compiler supports -Wcast-qual. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14663 --- diff --git a/configure.ac b/configure.ac index 4b3edd0dd4..06b9709329 100644 --- a/configure.ac +++ b/configure.ac @@ -1736,25 +1736,8 @@ AC_MSG_RESULT([-Wextra]) CFLAGS=$safe_CFLAGS # does this compiler support -Wcast-qual ? -AC_MSG_CHECKING([if gcc accepts -Wcast-qual]) - -safe_CFLAGS=$CFLAGS -CFLAGS="-Wcast-qual" - -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ - return 0; -]])], [ -cast_qual=yes -AC_MSG_RESULT([yes]) -], [ -cast_qual=no -AC_MSG_RESULT([no]) -]) -CFLAGS=$safe_CFLAGS - -AM_CONDITIONAL(HAS_CAST_QUAL_WARNING, test x$cast_qual = xyes) - -if test x$cast_qual = xyes; then +AC_GCC_WARNING_COND([cast-qual], [HAS_CAST_QUAL_WARNING]) +if test $has_warning_flag = yes; then CFLAGS="$CFLAGS -Wcast-qual" CXXFLAGS="$CXXFLAGS -Wcast-qual" fi