From aceb11dff4b3c05d027df664986515a89be1aac6 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 10 Apr 2015 13:29:23 +0000 Subject: mkmf.rb: fix werror option * lib/mkmf.rb (try_compile): pass the given werror flag to try_do to check if stderr is empty. * lib/mkmf.rb (try_cflags, try_ldflags): default werror to true. * win32/Makefile.sub (WERRORFLAG): remove useless option. VC does not make warnings of unknown command option an error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/mkmf.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/mkmf.rb') diff --git a/lib/mkmf.rb b/lib/mkmf.rb index ba3240d0a3..eb95beb2c3 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -568,7 +568,7 @@ MSG # [+src+] a String which contains a C source # [+opt+] a String which contains compiler options def try_compile(src, opt="", *opts, &b) - with_werror(opt, *opts) {|_opt, *_opts| try_do(src, cc_command(_opt), *_opts, &b)} and + with_werror(opt, *opts) {|_opt, *| try_do(src, cc_command(_opt), *opts, &b)} and File.file?("#{CONFTEST}.#{$OBJEXT}") ensure MakeMakefile.rm_f "#{CONFTEST}*" @@ -621,8 +621,8 @@ MSG $CFLAGS = cflags unless ret end - def try_cflags(flags, *opts) - try_compile(MAIN_DOES_NOTHING, flags, *opts) + def try_cflags(flags, opts = {}) + try_compile(MAIN_DOES_NOTHING, flags, {:werror => true}.update(opts)) end def with_ldflags(flags) @@ -633,8 +633,8 @@ MSG $LDFLAGS = ldflags unless ret end - def try_ldflags(flags) - try_link(MAIN_DOES_NOTHING, flags) + def try_ldflags(flags, opts = {}) + try_link(MAIN_DOES_NOTHING, flags, {:werror => true}.update(opts)) end def try_static_assert(expr, headers = nil, opt = "", &b) -- cgit v1.2.3