aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2011-02-10 01:05:48 +0000
committerJohannes Schickel2011-02-10 01:05:48 +0000
commit9f6dc040ff56d6e1b4f77275acb3a1d4750a38e6 (patch)
treeb2ae909a56ad6e8403e7a7213d191f1c6be50ab9
parentece050e26c8397e32038662fcdc451bfa6e28351 (diff)
downloadscummvm-rg350-9f6dc040ff56d6e1b4f77275acb3a1d4750a38e6.tar.gz
scummvm-rg350-9f6dc040ff56d6e1b4f77275acb3a1d4750a38e6.tar.bz2
scummvm-rg350-9f6dc040ff56d6e1b4f77275acb3a1d4750a38e6.zip
CONFIGURE: Add basic support for ICC.
svn-id: r55862
-rw-r--r--Makefile7
-rw-r--r--common/scummsys.h4
-rwxr-xr-xconfigure27
3 files changed, 37 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index e8c8a17291..844a063f8f 100644
--- a/Makefile
+++ b/Makefile
@@ -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
diff --git a/common/scummsys.h b/common/scummsys.h
index 385fedcf1d..b0f514cdd1 100644
--- a/common/scummsys.h
+++ b/common/scummsys.h
@@ -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)
diff --git a/configure b/configure
index 64d9506afa..b0d02e9609 100755
--- a/configure
+++ b/configure
@@ -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)
;;
*)
- CXXFLAGS="$CXXFLAGS -pedantic"
+ # ICC does not support pedantic
+ if test "$have_icc" = no ; then
+ CXXFLAGS="$CXXFLAGS -pedantic"
+ fi
;;
esac