[Scummvm-cvs-logs] SF.net SVN: scummvm:[55862] scummvm/trunk
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Thu Feb 10 02:05:49 CET 2011
Revision: 55862
http://scummvm.svn.sourceforge.net/scummvm/?rev=55862&view=rev
Author: lordhoto
Date: 2011-02-10 01:05:48 +0000 (Thu, 10 Feb 2011)
Log Message:
-----------
CONFIGURE: Add basic support for ICC.
Modified Paths:
--------------
scummvm/trunk/Makefile
scummvm/trunk/common/scummsys.h
scummvm/trunk/configure
Modified: scummvm/trunk/Makefile
===================================================================
--- scummvm/trunk/Makefile 2011-02-09 20:52:46 UTC (rev 55861)
+++ scummvm/trunk/Makefile 2011-02-10 01:05:48 UTC (rev 55862)
@@ -48,6 +48,13 @@
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
Modified: scummvm/trunk/common/scummsys.h
===================================================================
--- scummvm/trunk/common/scummsys.h 2011-02-09 20:52:46 UTC (rev 55861)
+++ scummvm/trunk/common/scummsys.h 2011-02-10 01:05:48 UTC (rev 55862)
@@ -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)
Modified: scummvm/trunk/configure
===================================================================
--- scummvm/trunk/configure 2011-02-09 20:52:46 UTC (rev 55861)
+++ scummvm/trunk/configure 2011-02-10 01:05:48 UTC (rev 55862)
@@ -1299,6 +1299,21 @@
#
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 @@
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 @@
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 @@
android | gamecube | psp | wii)
;;
*)
- CXXFLAGS="$CXXFLAGS -pedantic"
+ # ICC does not support pedantic
+ if test "$have_icc" = no ; then
+ CXXFLAGS="$CXXFLAGS -pedantic"
+ fi
;;
esac
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list