From 4a8fbca17339f2dcbe0f5aa2fd197b4278d54252 Mon Sep 17 00:00:00 2001 From: caro 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 git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@41863 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- configure.ac | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 0b8f407..19401b2 100644 --- a/configure.ac +++ b/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 -- 2.7.4