CONFIGURE: Add basic support for ICC.

svn-id: r55862
This commit is contained in:
Johannes Schickel 2011-02-10 01:05:48 +00:00
parent ece050e26c
commit 9f6dc040ff
3 changed files with 37 additions and 1 deletions

View file

@ -48,6 +48,13 @@ ifeq "$(HAVE_CLANG)" "1"
CXXFLAGS+= -Wno-conversion -Wno-shorten-64-to-32 -Wno-sign-compare -Wno-four-char-constants
endif
ifeq "$(HAVE_ICC)" "1"
# Disable some warnings:
# 161: unrecognized #pragma
# 1899: multicharacter character literal (potential portability problem)
CXXFLAGS+= -diag-disable 161,1899
endif
# Warn if global constructors are used. Only available in GCC with LLVM backend
# (and maybe clang?), hence off by default.
#CXXFLAGS+= -Wglobal-constructors

View file

@ -372,6 +372,10 @@
#if !defined(FORCEINLINE) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
#define FORCEINLINE inline __attribute__((__always_inline__))
#endif
#elif defined(__INTEL_COMPILER)
#define NORETURN_POST __attribute__((__noreturn__))
#define PACKED_STRUCT __attribute__((__packed__))
#define GCC_PRINTF(x,y) __attribute__((__format__(printf, x, y)))
#else
#define PACKED_STRUCT
#define GCC_PRINTF(x,y)

25
configure vendored
View file

@ -1299,6 +1299,21 @@ LD=$CXX
#
echocheck "compiler version"
# We first check whether we have an Intel compiler here, since the Intel compiler
# can also fake itself as an gcc (to ease compatibility with common Linux etc.
# programs).
have_icc=no
cc_check_define __INTEL_COMPILER && have_icc=yes
if test "$have_icc" = yes; then
add_line_to_config_mk 'HAVE_ICC = 1'
# Make ICC error our on unknown command line options instead of printing
# a warning. This is for example required to make the -Wglobal-destructors
# detection work correctly.
CXXFLAGS="$CXXFLAGS -diag-error 10006,10148"
fi
have_gcc=no
cc_check_define __GNUC__ && have_gcc=yes
@ -1320,6 +1335,11 @@ if test "$have_gcc" = yes; then
cxx_version="$cxx_version, bad"
cxx_verc_fail=yes
fi
elif test "$have_icc" = yes; then
cxx_version="`( $CXX -dumpversion ) 2>/dev/null`"
_cxx_major="`echo "${cxx_version}" | sed -ne 's/\([0-9][0-9]*\)\..*/\1/gp'`"
_cxx_minor="`echo "${cxx_version}" | sed -ne 's/[0-9][0-9]*\.\([0-9][0-9]*\)/\1/gp'`"
cxx_version="ICC $cxx_version, ok"
else
# TODO: Big scary warning about unsupported compilers
cxx_version=`( $CXX -version ) 2>&1`
@ -3057,6 +3077,8 @@ if test "$have_gcc" = yes ; then
else
CXXFLAGS="$CXXFLAGS -Wconversion"
fi;
elif test "$have_icc" = yes ; then
add_line_to_config_mk 'CXX_UPDATE_DEP_FLAG = -MMD -MF "$(*D)/$(DEPDIR)/$(*F).d" -MQ "$@" -MP'
fi;
# Some platforms use certain GNU extensions in header files
@ -3064,7 +3086,10 @@ case $_host_os in
android | gamecube | psp | wii)
;;
*)
# ICC does not support pedantic
if test "$have_icc" = no ; then
CXXFLAGS="$CXXFLAGS -pedantic"
fi
;;
esac