summaryrefslogtreecommitdiff
path: root/lib/mkmf.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-30 16:17:55 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-30 16:17:55 +0000
commit8a22a0530e5095b11a52dfc820cef4016c55e3ff (patch)
tree09fedee402ff510de2bf36b4986e3802485a8587 /lib/mkmf.rb
parente3230f154c874917f9c4384498558da3fdaba432 (diff)
mkmf.rb: try without -ObjC option
* lib/mkmf.rb (have_framework): try without -ObjC option first as MacPorts GCCs do not support it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/mkmf.rb')
-rw-r--r--lib/mkmf.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index bc93fec6c4..6177e04f56 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -1092,11 +1092,11 @@ SRC
checking_for fw do
src = cpp_include("#{fw}/#{header}") << "\n" "int main(void){return 0;}"
opt = " -framework #{fw}"
- if try_link(src, "-ObjC#{opt}", &b)
+ if try_link(src, opt, &b) or (objc = try_link(src, "-ObjC#{opt}", &b))
$defs.push(format("-DHAVE_FRAMEWORK_%s", fw.tr_cpp))
# TODO: non-worse way than this hack, to get rid of separating
# option and its argument.
- $LDFLAGS << " -ObjC" unless /(\A|\s)-ObjC(\s|\z)/ =~ $LDFLAGS
+ $LDFLAGS << " -ObjC" if objc and /(\A|\s)-ObjC(\s|\z)/ !~ $LDFLAGS
$LIBS << opt
true
else