From 36be15fc5599b05d5ac83782bc5ddcf14376209d Mon Sep 17 00:00:00 2001 From: Vincent Torri Date: Tue, 18 Aug 2009 20:04:19 +0000 Subject: [PATCH] don't suppose that gcc is the only compiler that can be used. Check if -Wall and -fno-strict-aliasing are supported by the compiler SVN revision: 41863 --- legacy/eina/configure.ac | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/legacy/eina/configure.ac b/legacy/eina/configure.ac index 0b8f407585..19401b2f97 100644 --- a/legacy/eina/configure.ac +++ b/legacy/eina/configure.ac @@ -246,13 +246,31 @@ if test "x$enable_coverage" = "xyes" ; then EINA_CFLAGS="${EINA_CFLAGS} ${EFL_DEBUG_CFLAGS}" fi -if ! test "${VMIC}" = "x" ; then - EINA_CFLAGS="${EINA_CFLAGS} -Wall -W" # -Werror +if ! test "x${VMIC}" = "x" ; then + CFLAGS_save="${CFLAGS}" + CFLAGS="${CFLAGS} -Wall -W" + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[]])], + [have_Wall="yes"], + [have_Wall="no"]) + AC_MSG_CHECKING([whether the compiler supports -Wall]) + AC_MSG_RESULT([${have_Wall}]) + CFLAGS="${CFLAGS_save}" + if test "x${have_Wall}" = "xyes" ; then + EINA_CFLAGS="${EINA_CFLAGS} -Wall -W" # -Werror + fi fi -GCC_MAJOR_VERSION=`$CC -dumpversion | sed "s/\..*//"` - -if test "$GCC_MAJOR_VERSION" = "3" ; then +CFLAGS_save="${CFLAGS}" +CFLAGS="${CFLAGS} -fno-strict-aliasing" +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[]])], + [have_no_strict_aliasing="yes"], + [have_no_strict_aliasing="no"]) +AC_MSG_CHECKING([whether the compiler supports -fno-strict-aliasing]) +AC_MSG_RESULT([${have_no_strict_aliasing}]) +CFLAGS="${CFLAGS_save}" +if test "x${have_no_strict_aliasing}" = "xyes" ; then EINA_CFLAGS="${EINA_CFLAGS} -fno-strict-aliasing" fi