Commit bf925aae authored by Guillaume Sadegh's avatar Guillaume Sadegh
Browse files

[buddy] Adjust to support the Intel compiler (icc).

    * configure.ac: Adjust to call...
    * m4/intel.m4: ...this new macro.
parent 7ac816f3
2009-06-12 Guillaume Sadegh <sadegh@lrde.epita.fr>
Adjust to support the Intel compiler (icc).
* configure.ac: Adjust to call...
* m4/intel.m4: ...this new macro.
2008-03-13 Alexandre Duret-Lutz <adl@lrde.epita.fr>
* src/bddtest.cxx: Include <cstdlib> to compile with g++-4.3.
......
......@@ -13,6 +13,7 @@ AC_PROG_CXX
AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
buddy_INTEL
buddy_DEBUG_FLAGS
AC_CONFIG_HEADERS([config.h])
......
dnl Adapted from the predefined _AC_LANG_COMPILER_GNU.
m4_define([_AC_LANG_COMPILER_INTEL],
[AC_CACHE_CHECK([whether we are using the INTEL _AC_LANG compiler],
[ac_cv_[]_AC_LANG_ABBREV[]_compiler_intel],
[
_AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[#ifndef __INTEL_COMPILER
choke me
#endif
]])],
[ac_compiler_intel=yes],
[ac_compiler_intel=no])
ac_cv_[]_AC_LANG_ABBREV[]_compiler_intel=$ac_compiler_intel
])])# _AC_LANG_COMPILER_INTEL
dnl The list of warnings that must be disabled.
m4_define([_INTEL_IGNORE_WARNINGS],
[ 522 dnl Remark ``redeclared "inline" after being called''
981 dnl Remark ``operands are evaluated in unspecified order''
383 dnl Remark ``value copied to temporary, reference to temporary used''
279 dnl Remark ``controlling expression is constant''
]) # _INTEL_IGNORE_WARNINGS
dnl Add extra flags when icc is used.
AC_DEFUN([buddy_INTEL],
[_AC_LANG_COMPILER_INTEL
AC_CACHE_CHECK([to add extra CFLAGS for the INTEL C compiler],
[ac_cv_intel_cflags],
[ dnl
if test x"$ac_compiler_intel" = x"yes"; then
# -W does not exist for icc in CFLAGS.
CFLAGS=`echo "$CFLAGS" | sed 's/-W[[[:space:]]]//g;s/-W$//'`
disabled_warnings=''
for warning in _INTEL_IGNORE_WARNINGS; do
disabled_warnings="$disabled_warnings,$warning"
done
# Remove the extra "," and extra whitespaces.
disabled_warnings=`echo "$disabled_warnings" | sed "s/^,//;s/[[[:space:]]]//g"`
INTEL_CFLAGS="-w1 -Werror -wd${disabled_warnings}"
CFLAGS="$CFLAGS $INTEL_CFLAGS"
CXXFLAGS="$CFLAGS $INTEL_CFLAGS"
[ac_cv_intel_cflags="$INTEL_CFLAGS"]
else
[ac_cv_intel_cflags="no extra flags"]
fi])
AC_SUBST([INTEL_CFLAGS])
]) # buddy_INTEL
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment