ruby-changes:23618
From: nobu <ko1@a...>
Date: Thu, 17 May 2012 10:39:31 +0900 (JST)
Subject: [ruby-changes:23618] nobu:r35669 (trunk): fix static-linked-ext
nobu 2012-05-17 10:37:08 +0900 (Thu, 17 May 2012) New Revision: 35669 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=35669 Log: fix static-linked-ext * lib/mkmf.rb (MakeMakefile#have_framework): combine -framework option and its argument with an equal sign not to be separated in merge_libs. * ext/tk/extconf.rb: ditto. Modified files: trunk/ChangeLog trunk/ext/tk/extconf.rb trunk/lib/mkmf.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 35668) +++ ChangeLog (revision 35669) @@ -1,5 +1,10 @@ -Thu May 17 10:34:35 2012 Nobuyoshi Nakada <nobu@r...> +Thu May 17 10:37:07 2012 Nobuyoshi Nakada <nobu@r...> + * lib/mkmf.rb (MakeMakefile#have_framework): combine -framework option + and its argument with an equal sign not to be separated in merge_libs. + + * ext/tk/extconf.rb: ditto. + * ext/extmk.rb: EXTLDFLAGS also needs to be passed. Wed May 16 15:44:22 2012 Yuki Yugui Sonoda <yugui@g...> Index: lib/mkmf.rb =================================================================== --- lib/mkmf.rb (revision 35668) +++ lib/mkmf.rb (revision 35669) @@ -1010,7 +1010,7 @@ 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, opt = "-ObjC -framework=#{fw}", &b) $defs.push(format("-DHAVE_FRAMEWORK_%s", fw.tr_cpp)) $LDFLAGS << " " << opt true Index: ext/tk/extconf.rb =================================================================== --- ext/tk/extconf.rb (revision 35668) +++ ext/tk/extconf.rb (revision 35669) @@ -1463,7 +1463,7 @@ def setup_for_macosx_framework(tclver, tkver) # use framework, but no tclConfig.sh unless $LDFLAGS && $LDFLAGS.include?('-framework') - ($LDFLAGS ||= "") << ' -framework Tk -framework Tcl' + ($LDFLAGS ||= "") << ' -framework=Tk -framework=Tcl' end if TkLib_Config["tcl-framework-header"] @@ -1947,53 +1947,55 @@ puts("Use MacOS X Frameworks.") ($LDFLAGS ||= "") << " -L#{TkLib_Config["tcl-build-dir"].quote} -Wl,-R#{TkLib_Config["tcl-build-dir"].quote}" if TkLib_Config["tcl-build-dir"] + libs = '' if tcl_cfg_dir TclConfig_Info['TCL_LIBS'] ||= "" ($INCFLAGS ||= "") << ' ' << TclConfig_Info['TCL_INCLUDE_SPEC'] - $LDFLAGS << ' ' << TclConfig_Info['TCL_LIBS'] + libs << ' ' << TclConfig_Info['TCL_LIBS'] if stubs if TkLib_Config["tcl-build-dir"] && TclConfig_Info['TCL_BUILD_STUB_LIB_SPEC'] && !TclConfig_Info['TCL_BUILD_STUB_LIB_SPEC'].strip.empty? - $LDFLAGS << ' ' << TclConfig_Info['TCL_BUILD_STUB_LIB_SPEC'] + libs << ' ' << TclConfig_Info['TCL_BUILD_STUB_LIB_SPEC'] else - $LDFLAGS << ' ' << TclConfig_Info['TCL_STUB_LIB_SPEC'] + libs << ' ' << TclConfig_Info['TCL_STUB_LIB_SPEC'] end else if TkLib_Config["tcl-build-dir"] && TclConfig_Info['TCL_BUILD_LIB_SPEC'] && !TclConfig_Info['TCL_BUILD_LIB_SPEC'].strip.empty? - $LDFLAGS << ' ' << TclConfig_Info['TCL_BUILD_LIB_SPEC'] + libs << ' ' << TclConfig_Info['TCL_BUILD_LIB_SPEC'] else - $LDFLAGS << ' ' << TclConfig_Info['TCL_LIB_SPEC'] + libs << ' ' << TclConfig_Info['TCL_LIB_SPEC'] end end end - $LDFLAGS << " -L#{TkLib_Config["tk-build-dir"].quote} -Wl,-R#{TkLib_Config["tk-build-dir"].quote}" if TkLib_Config["tk-build-dir"] + libs << " -L#{TkLib_Config["tk-build-dir"].quote} -Wl,-R#{TkLib_Config["tk-build-dir"].quote}" if TkLib_Config["tk-build-dir"] if tk_cfg_dir TkConfig_Info['TK_LIBS'] ||= "" ($INCFLAGS ||= "") << ' ' << TkConfig_Info['TK_INCLUDE_SPEC'] - $LDFLAGS << ' ' << TkConfig_Info['TK_LIBS'] + libs << ' ' << TkConfig_Info['TK_LIBS'] if stubs if TkLib_Config["tk-build-dir"] && TclConfig_Info['TK_BUILD_STUB_LIB_SPEC'] && !TclConfig_Info['TK_BUILD_STUB_LIB_SPEC'].strip.empty? - $LDFLAGS << ' ' << TkConfig_Info['TK_BUILD_STUB_LIB_SPEC'] + libs << ' ' << TkConfig_Info['TK_BUILD_STUB_LIB_SPEC'] else - $LDFLAGS << ' ' << TkConfig_Info['TK_STUB_LIB_SPEC'] + libs << ' ' << TkConfig_Info['TK_STUB_LIB_SPEC'] end else if TkLib_Config["tk-build-dir"] && TclConfig_Info['TK_BUILD_LIB_SPEC'] && !TclConfig_Info['TK_BUILD_LIB_SPEC'].strip.empty? - $LDFLAGS << ' ' << TkConfig_Info['TK_BUILD_LIB_SPEC'] + libs << ' ' << TkConfig_Info['TK_BUILD_LIB_SPEC'] else - $LDFLAGS << ' ' << TkConfig_Info['TK_LIB_SPEC'] + libs << ' ' << TkConfig_Info['TK_LIB_SPEC'] end end end + $LDFLAGS << ' ' << libs.gsub(/((?:\A|\s)-framework)\s/, '\1=') << ' -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/