Properly detect the Intel C++ compiler (ticket #154).
authorAkos Ladanyi <ladanyi@tmit.bme.hu>
Sun, 05 Oct 2008 12:36:26 +0200
changeset 2969768e60aa4e1
parent 294 cbe3ec2d59d2
child 297 92b193385702
Properly detect the Intel C++ compiler (ticket #154).
configure.ac
     1.1 --- a/configure.ac	Wed Oct 01 13:56:40 2008 +0200
     1.2 +++ b/configure.ac	Sun Oct 05 12:36:26 2008 +0200
     1.3 @@ -21,6 +21,9 @@
     1.4  
     1.5  lx_cmdline_cxxflags_set=${CXXFLAGS+set}
     1.6  
     1.7 +dnl Do compilation tests using the C++ compiler.
     1.8 +AC_LANG([C++])
     1.9 +
    1.10  dnl Checks for programs.
    1.11  AC_PROG_CXX
    1.12  AC_PROG_CXXCPP
    1.13 @@ -31,8 +34,19 @@
    1.14  AC_CHECK_PROG([doxygen_found],[doxygen],[yes],[no])
    1.15  AC_CHECK_PROG([gs_found],[gs],[yes],[no])
    1.16  
    1.17 +dnl Detect Intel compiler.
    1.18 +AC_MSG_CHECKING([whether we are using the Intel C++ compiler])
    1.19 +AC_COMPILE_IFELSE([#ifndef __INTEL_COMPILER
    1.20 +choke me
    1.21 +#endif], [ICC=[yes]], [ICC=[no]])
    1.22 +if test x"$ICC" = x"yes"; then
    1.23 +  AC_MSG_RESULT([yes])
    1.24 +else
    1.25 +  AC_MSG_RESULT([no])
    1.26 +fi
    1.27 +
    1.28  dnl Set custom compiler flags when using g++.
    1.29 -if test x"$lx_cmdline_cxxflags_set" != x"set" -a "$GXX" = yes; then
    1.30 +if test x"$lx_cmdline_cxxflags_set" != x"set" -a "$GXX" = yes -a "$ICC" = no; then
    1.31    CXXFLAGS="$CXXFLAGS -Wall -W -Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -Woverloaded-virtual -ansi -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas"
    1.32  fi
    1.33