diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-01-17 12:20:15 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-01-17 12:20:15 +0000 |
commit | f9a5a3adff68c1ff5933b141a5fb79aa73093704 (patch) | |
tree | ec1115e196293916646de9e149f6ae38d0327cfd | |
parent | cd7fbc20953e3c738dd31d61d26582b196d0af84 (diff) | |
download | ruby-f9a5a3adff68c1ff5933b141a5fb79aa73093704.tar.gz |
* 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
-rw-r--r-- | ChangeLog | 16 | ||||
-rw-r--r-- | configure.in | 4 | ||||
-rw-r--r-- | lib/mkmf.rb | 3 |
3 files changed, 22 insertions, 1 deletions
@@ -1,3 +1,19 @@ +Sun Jan 17 21:15:30 2016 NARUSE, Yui <naruse@ruby-lang.org> + + * 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 <duerst@it.aoyama.ac.jp> * 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 |