From 9bed6e8e8effae57dd1c6797429429213eaddabd Mon Sep 17 00:00:00 2001 From: naruse Date: Sun, 17 Jan 2016 12:20:15 +0000 Subject: * configure.in: improve ICC (Intel C Compiler) support. * configure.in (CXX): The name of icc's c++ compiler is `icpc`. * configure.in (warnings): Add `-diag-disable=2259` to suppress noisy warnings: "non-pointer conversion from "..." to "..." may lose significant bits". * configure.in (optflags): Add `-fp-model precise` like -fno-fast-math. * lib/mkmf.rb: icc supports -Werror=division-by-zero and -Werror=deprecated-declarations, but doesn't support -Wdivision-by-zero and -Wdeprecated-declarations. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53566 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 16 ++++++++++++++++ configure.in | 4 +++- lib/mkmf.rb | 3 +++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b95be78b6f..89eadaa781 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +Sun Jan 17 21:15:30 2016 NARUSE, Yui + + * configure.in: improve ICC (Intel C Compiler) support. + + * configure.in (CXX): The name of icc's c++ compiler is `icpc`. + + * configure.in (warnings): Add `-diag-disable=2259` to suppress + noisy warnings: "non-pointer conversion from "..." to "..." may + lose significant bits". + + * configure.in (optflags): Add `-fp-model precise` like -fno-fast-math. + + * lib/mkmf.rb: icc supports -Werror=division-by-zero + and -Werror=deprecated-declarations, but doesn't support + -Wdivision-by-zero and -Wdeprecated-declarations. + Sun Jan 17 20:40:10 2016 Martin Duerst * string.c: Any kind of option is now taking the new code path for diff --git a/configure.in b/configure.in index 25585f6852..ca19530e7b 100644 --- a/configure.in +++ b/configure.in @@ -265,6 +265,7 @@ AS_CASE(["$build_os"], [xgcc-4.2|x/usr/bin/gcc-4.2], [: ${CXX=g++-4.2}], [xgcc|x/usr/bin/gcc], [: ${CXX=g++}], [xcc|x/usr/bin/cc], [: ${CXX=c++}], + [xicc], [: ${CXX=icpc}], [xclang|x/usr/bin/clang], [: ${CXX=clang++}]) ]) test -z "$CC" || ac_cv_prog_CC="$CC" @@ -812,6 +813,7 @@ if test "$GCC:${warnflags+set}:no" = yes::no; then extra_warning="$extra_warning -Wno-maybe-uninitialized" fi for wflag in -Wno-unused-parameter -Wno-parentheses -Wno-long-long \ + -diag-disable=2259 \ -Wno-missing-field-initializers \ -Wunused-variable \ -Werror=pointer-arith \ @@ -952,7 +954,7 @@ if test "$GCC" = yes; then ]) # disable fast-math - for oflag in -fno-fast-math; do + for oflag in -fno-fast-math -fp-model\ precise; do RUBY_TRY_CFLAGS($oflag, [RUBY_APPEND_OPTION(optflags, $oflag)]) done fi diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 1a22889671..924ca2f019 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -2484,6 +2484,9 @@ site-install-rb: install-rb if $warnflags = CONFIG['warnflags'] and CONFIG['GCC'] == 'yes' # turn warnings into errors only for bundled extensions. config['warnflags'] = $warnflags.gsub(/(\A|\s)-Werror[-=]/, '\1-W') + if /icc\z/ =~ config['CC'] + config['warnflags'].gsub!(/(\A|\s)-W(?:division-by-zero|deprecated-declarations)/, '\1') + end RbConfig.expand(rbconfig['warnflags'] = config['warnflags'].dup) config.each do |key, val| RbConfig.expand(rbconfig[key] = val.dup) if /warnflags/ =~ val -- cgit v1.2.3