ruby-changes:24386
From: nobu <ko1@a...>
Date: Wed, 18 Jul 2012 16:18:01 +0900 (JST)
Subject: [ruby-changes:24386] nobu:r36437 (trunk): mkmf.rb: hack for -framework
nobu 2012-07-18 16:17:43 +0900 (Wed, 18 Jul 2012) New Revision: 36437 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=36437 Log: 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... Modified files: trunk/ChangeLog trunk/ext/tk/extconf.rb trunk/lib/mkmf.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 36436) +++ ChangeLog (revision 36437) @@ -1,3 +1,9 @@ +Wed Jul 18 16:17:40 2012 Nobuyoshi Nakada <nobu@r...> + + * 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@r...> * ext/curses/extconf.rb: support PDCurses. patched by Luis Lavena. Index: lib/mkmf.rb =================================================================== --- lib/mkmf.rb (revision 36436) +++ lib/mkmf.rb (revision 36437) @@ -1017,9 +1017,12 @@ 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 @@ 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) Index: ext/tk/extconf.rb =================================================================== --- ext/tk/extconf.rb (revision 36436) +++ ext/tk/extconf.rb (revision 36437) @@ -1995,7 +1995,7 @@ 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/