1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

merge revision(s) 49482,49487: [Backport #10821]

* lib/mkmf.rb (try_cppflags, try_cflags, try_ldflags): get rid of
	  interference by modifying global variables in have_devel? method.
	  [ruby-core:67962] [Bug #10821]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@49581 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2015-02-13 05:00:23 +00:00
parent f037541071
commit 19424d0b51
5 changed files with 42 additions and 11 deletions

View file

@ -1,3 +1,9 @@
Fri Feb 13 13:59:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (try_cppflags, try_cflags, try_ldflags): get rid of
interference by modifying global variables in have_devel? method.
[ruby-core:67962] [Bug #10821]
Fri Feb 13 03:13:05 2015 Scott Francis <scott.francis@shopify.com>
* thread_pthread.c (reserve_stack): fix intermittent SIGBUS on

View file

@ -610,9 +610,7 @@ MSG
end
def try_cppflags(flags)
with_cppflags(flags) do
try_header("int main() {return 0;}")
end
try_header(MAIN_DOES_NOTHING, flags)
end
def with_cflags(flags)
@ -624,9 +622,7 @@ MSG
end
def try_cflags(flags)
with_cflags(flags) do
try_compile("int main() {return 0;}")
end
try_compile(MAIN_DOES_NOTHING, flags)
end
def with_ldflags(flags)
@ -638,9 +634,7 @@ MSG
end
def try_ldflags(flags)
with_ldflags(flags) do
try_link("int main() {return 0;}")
end
try_link(MAIN_DOES_NOTHING, flags)
end
def try_static_assert(expr, headers = nil, opt = "", &b)

View file

@ -49,7 +49,9 @@ class TestMkmf < Test::Unit::TestCase
@buffer << s if @out
end
end
end
module TestMkmf::Base
attr_reader :stdout
def mkmflog(msg)
@ -84,7 +86,7 @@ class TestMkmf < Test::Unit::TestCase
@tmpdir = Dir.mktmpdir
@curdir = Dir.pwd
@mkmfobj = Object.new
@stdout = Capture.new
@stdout = TestMkmf::Capture.new
Dir.chdir(@tmpdir)
@quiet, Logging.quiet = Logging.quiet, true
init_mkmf
@ -127,3 +129,11 @@ class TestMkmf < Test::Unit::TestCase
nil
end
end
class TestMkmf
include TestMkmf::Base
def assert_separately(args, src, *rest)
super(args + ["-r#{__FILE__}"], "extend TestMkmf::Base; setup\n#{src}", *rest)
end
end

View file

@ -31,5 +31,26 @@ class TestMkmf
$warnflags = warnflags
$extmk = val
end
def test_try_ldflag_invalid_opt
assert_separately([], <<-'end;') #do
assert(!try_ldflags("nosuch.c"), TestMkmf::MKMFLOG)
assert(have_devel?, TestMkmf::MKMFLOG)
end;
end
def test_try_cflag_invalid_opt
assert_separately([], <<-'end;') #do
assert(!try_cflags("nosuch.c"), TestMkmf::MKMFLOG)
assert(have_devel?, TestMkmf::MKMFLOG)
end;
end
def test_try_cppflag_invalid_opt
assert_separately([], <<-'end;') #do
assert(!try_cppflags("nosuch.c"), TestMkmf::MKMFLOG)
assert(have_devel?, TestMkmf::MKMFLOG)
end;
end
end
end

View file

@ -1,6 +1,6 @@
#define RUBY_VERSION "2.2.0"
#define RUBY_RELEASE_DATE "2015-02-13"
#define RUBY_PATCHLEVEL 44
#define RUBY_PATCHLEVEL 45
#define RUBY_RELEASE_YEAR 2015
#define RUBY_RELEASE_MONTH 2