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

* lib/mkmf.rb (try_cppflags, try_cflags, try_ldflags): replace the

target flags if the given flag is accepted.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34828 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2012-02-27 01:54:23 +00:00
parent 8e683a8a97
commit ce2211bf04
2 changed files with 23 additions and 0 deletions

View file

@ -1,3 +1,8 @@
Mon Feb 27 10:54:20 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (try_cppflags, try_cflags, try_ldflags): replace the
target flags if the given flag is accepted.
Mon Feb 27 10:53:44 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
* test/rubygems/test_gem_specification.rb (test_self_from_yaml_syck_default_key_bug):

View file

@ -550,6 +550,12 @@ MSG
$CPPFLAGS = cppflags unless ret
end
def try_cppflags(flags)
with_cppflags(flags) do
try_header("int main() {return 0;}")
end
end
def with_cflags(flags)
cflags = $CFLAGS
$CFLAGS = flags
@ -558,6 +564,12 @@ MSG
$CFLAGS = cflags unless ret
end
def try_cflags(flags)
with_cflags(flags) do
try_compile("int main() {return 0;}")
end
end
def with_ldflags(flags)
ldflags = $LDFLAGS
$LDFLAGS = flags
@ -566,6 +578,12 @@ MSG
$LDFLAGS = ldflags unless ret
end
def try_ldflags(flags)
with_ldflags(flags) do
try_link("int main() {return 0;}")
end
end
def try_static_assert(expr, headers = nil, opt = "", &b)
headers = cpp_include(headers)
try_compile(<<SRC, opt, &b)