diff --git a/lbtt/ChangeLog b/lbtt/ChangeLog index acb40cd74..47c2c737b 100644 --- a/lbtt/ChangeLog +++ b/lbtt/ChangeLog @@ -1,3 +1,12 @@ +2009-06-12 Guillaume Sadegh + + Adjust to support the Intel compiler (icpc). + + * configure.ac: Adjust to call... + * m4/intel.m4: ...this new macro. + * Makefile.am: Add the directory `m4' as an includedir of + autoconf's macros. + 2009-05-31 Alexandre Duret-Lutz Adjust parser to Bison 2.4.1. diff --git a/lbtt/Makefile.am b/lbtt/Makefile.am index 1af203b06..041e990b8 100644 --- a/lbtt/Makefile.am +++ b/lbtt/Makefile.am @@ -1 +1,2 @@ SUBDIRS = doc src +ACLOCAL_AMFLAGS = -I m4 diff --git a/lbtt/configure.ac b/lbtt/configure.ac index e96844b1e..21cdee004 100644 --- a/lbtt/configure.ac +++ b/lbtt/configure.ac @@ -17,7 +17,7 @@ AC_PROG_CXX AC_PROG_CXXCPP AM_PROG_LEX AC_PROG_YACC - +lbtt_INTEL # Check whether the user has explicitly disabled support for the GNU readline diff --git a/lbtt/m4/intel.m4 b/lbtt/m4/intel.m4 new file mode 100644 index 000000000..635ecae47 --- /dev/null +++ b/lbtt/m4/intel.m4 @@ -0,0 +1,50 @@ + +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], +[ 913 dnl Warn when multibyte character are used (for example "Büchi"). +]) # _INTEL_IGNORE_WARNINGS + +dnl Add extra flags when icpc is used. +AC_DEFUN([lbtt_INTEL], +[_AC_LANG_COMPILER_INTEL +AC_CACHE_CHECK([to add extra CXXFLAGS for the INTEL C++ compiler], + [ac_cv_intel_cxxflags], +[ dnl + if test x"$ac_compiler_intel" = x"yes"; then + # -W does not exist for icpc in CXXFLAGS. + CXXFLAGS=`echo "$CXXFLAGS" | 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_CXXFLAGS="-w1 -Werror -wd${disabled_warnings}" + + # Even if the icpc preprocessor defines __GNUC__, it is not a GNU compiler. + GXX= + CXXFLAGS="$CXXFLAGS $INTEL_CXXFLAGS" + + [ac_cv_intel_cxxflags="$INTEL_CXXFLAGS"] + else + [ac_cv_intel_cxxflags="no extra flags"] + fi]) + AC_SUBST([INTEL_CXXFLAGS]) +]) # lbtt_INTEL