summaryrefslogtreecommitdiff
path: root/lib/mkmf.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-09-11 00:44:30 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-09-11 00:44:30 +0000
commit9445ab2d9864dd2c53fce6468e4ff15f40761914 (patch)
tree224e3253992a27bfcc14f623e16a993f4bd96d34 /lib/mkmf.rb
parentf228a4b20949997c139cbb33434099bd71b81578 (diff)
mkmf.rb: fix $LDFLAGS
* lib/mkmf.rb (have_framework): insert a space between options. add just one -ObjC option. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/mkmf.rb')
-rw-r--r--lib/mkmf.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 5a0d2743d1..b499eeb954 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -1022,10 +1022,12 @@ SRC
def have_framework(fw, &b)
checking_for fw do
src = cpp_include("#{fw}/#{fw}.h") << "\n" "int main(void){return 0;}"
- if try_link(src, opt = "-ObjC -framework #{fw}", &b)
+ opt = " -framework #{fw}"
+ if 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 << opt
true
else