summaryrefslogtreecommitdiff
path: root/lib/mkmf.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-31 02:46:50 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-31 02:46:50 +0000
commit484e94a89c84cea432e4aad8ec365632ea913365 (patch)
tree3620ab0eef91c9c38db9b88bd506405b1fd9724e /lib/mkmf.rb
parentcf1cc4bd8b6afcd78d456036541759e520a4910a (diff)
* configure.in (warnflags), lib/mkmf.rb (configuration): turn
warnings into errors only for bundled extensions. [ruby-core:33815] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/mkmf.rb')
-rw-r--r--lib/mkmf.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index c25270dbc6..d7964d61cb 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -1658,6 +1658,10 @@ VPATH = #{vpath.join(CONFIG['PATH_SEPARATOR'])}
end
possible_command = (proc {|s| s if /top_srcdir/ !~ s} unless $extmk)
extconf_h = $extconf_h ? "-DRUBY_EXTCONF_H=\\\"$(RUBY_EXTCONF_H)\\\" " : $defs.join(" ") << " "
+ if warnflags = CONFIG['warnflags'] and CONFIG['GCC'] == 'yes' and !$extmk
+ # turn warnings into errors only for bundled extensions.
+ warnflags = warnflags.gsub(/(?:\A|\s)-Werror=/, '\1-W')
+ end
mk << %{
CC = #{CONFIG['CC']}
CXX = #{CONFIG['CXX']}
@@ -1672,7 +1676,7 @@ RUBY_EXTCONF_H = #{$extconf_h}
cflags = #{CONFIG['cflags']}
optflags = #{CONFIG['optflags']}
debugflags = #{CONFIG['debugflags']}
-warnflags = #{CONFIG['warnflags']}
+warnflags = #{warnflags}
CFLAGS = #{$static ? '' : CONFIG['CCDLFLAGS']} #$CFLAGS #$ARCH_FLAG
INCFLAGS = -I. #$INCFLAGS
DEFS = #{CONFIG['DEFS']}