summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-10 13:29:23 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-10 13:29:23 +0000
commitaceb11dff4b3c05d027df664986515a89be1aac6 (patch)
treefff95e29bbaa3314d11154f8e743edad70fcd084
parent6f636adad0b0e8c8aabf9739673df7c48b446099 (diff)
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
-rw-r--r--ChangeLog10
-rw-r--r--ext/date/extconf.rb2
-rw-r--r--lib/mkmf.rb10
-rw-r--r--win32/Makefile.sub2
4 files changed, 17 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 0e786ae..b06cdb0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Fri Apr 10 22:29:21 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * 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.
+
Fri Apr 10 19:34:24 2015 Tanaka Akira <akr@fsij.org>
* test/ruby/test_file_exhaustive.rb: Test socket.
diff --git a/ext/date/extconf.rb b/ext/date/extconf.rb
index cb346df..6f479ea 100644
--- a/ext/date/extconf.rb
+++ b/ext/date/extconf.rb
@@ -1,5 +1,5 @@
require 'mkmf'
-if try_cflags("-std=iso9899:1999", :werror => true)
+if try_cflags("-std=iso9899:1999")
$CFLAGS += " " << "-std=iso9899:1999"
end
create_makefile('date_core')
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index ba3240d..eb95beb 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)
diff --git a/win32/Makefile.sub b/win32/Makefile.sub
index 02ec002..b8bd25b 100644
--- a/win32/Makefile.sub
+++ b/win32/Makefile.sub
@@ -208,7 +208,7 @@ WARNFLAGS = -W2 -wd4996 -we4028 -we4142
WARNFLAGS = -W2
!endif
!endif
-WERRORFLAG = -WX -we9002
+WERRORFLAG = -WX
!if !defined(CFLAGS)
CFLAGS = $(RUNTIMEFLAG) $(DEBUGFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(PROCESSOR_FLAG) $(COMPILERFLAG)
!endif