summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-18 07:17:43 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-18 07:17:43 +0000
commit5a03c2569046f9b3919429088f230b01e719360f (patch)
tree11bae103ca5b52f66804686d9ff3554bd92207ce
parent5d743d7662abaf99577d2d6dd4264ea02ba87087 (diff)
mkmf.rb: hack for -framework
* lib/mkmf.rb (have_framework): get rid of separating -framework option and its argument and dealing with the argument as a library or an object name. if $LDFLAGS were an array... git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--ext/tk/extconf.rb2
-rw-r--r--lib/mkmf.rb9
3 files changed, 13 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index c519741579..7bb3af9b8b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Wed Jul 18 16:17:40 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (have_framework): get rid of separating -framework
+ option and its argument and dealing with the argument as a library
+ or an object name. if $LDFLAGS were an array...
+
Wed Jul 18 16:09:10 2012 Shugo Maeda <shugo@ruby-lang.org>
* ext/curses/extconf.rb: support PDCurses. patched by Luis Lavena.
diff --git a/ext/tk/extconf.rb b/ext/tk/extconf.rb
index 6d34f1a492..778201c396 100644
--- a/ext/tk/extconf.rb
+++ b/ext/tk/extconf.rb
@@ -1995,7 +1995,7 @@ if TkLib_Config["tcltk-framework"]
end
end
end
- $LDFLAGS << ' ' << libs.gsub(/((?:\A|\s)-framework)\s/, '\1=')
+ $LDFLAGS << ' ' << libs.gsub(/((?:\A|\s)-framework)\s/, "\\1\0")
$libs << ' -ltk -ltcl'
setup_for_macosx_framework(tclver, tkver) if tcl_cfg_dir && tk_cfg_dir
end
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 85a372abaf..8dd36d3c3f 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -1017,9 +1017,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)
+ if try_link(src, "-ObjC -framework #{fw}", &b)
$defs.push(format("-DHAVE_FRAMEWORK_%s", fw.tr_cpp))
- $LDFLAGS << " " << opt
+ # TODO: non-worse way than this hack, to get rid of separating
+ # option and its argument.
+ opt = " -ObjC -framework\0#{fw}"
+ $LDFLAGS << opt
true
else
false
@@ -1794,7 +1797,7 @@ INCFLAGS = -I. #$INCFLAGS
DEFS = #{CONFIG['DEFS']}
CPPFLAGS = #{extconf_h}#{$CPPFLAGS}
CXXFLAGS = $(CFLAGS) #{CONFIG['CXXFLAGS']}
-ldflags = #{$LDFLAGS}
+ldflags = #{$LDFLAGS.tr!("\0", " ")}
dldflags = #{$DLDFLAGS} #{CONFIG['EXTDLDFLAGS']}
ARCH_FLAG = #{$ARCH_FLAG}
DLDFLAGS = $(ldflags) $(dldflags) $(ARCH_FLAG)