diff --git a/ext/extmk.rb b/ext/extmk.rb index 9293ecaf87..069465e77f 100755 --- a/ext/extmk.rb +++ b/ext/extmk.rb @@ -260,7 +260,7 @@ def extmake(target) unless $mswin $extflags = ($extflags.split | $DLDFLAGS.split | $LDFLAGS.split).join(" ") end - $extlibs = merge_libs($extlibs, $libs.split, $LOCAL_LIBS.split) + $extlibs = merge_libs($extlibs, $libs.split(/\s+(?=-|\z)/), $LOCAL_LIBS.split(/\s+(?=-|\z)/)) $extpath |= $LIBPATH end ensure diff --git a/ext/tk/extconf.rb b/ext/tk/extconf.rb index 155a92f6ab..6d34f1a492 100644 --- a/ext/tk/extconf.rb +++ b/ext/tk/extconf.rb @@ -1463,7 +1463,7 @@ end 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"] diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 1430aa30ef..c42bab9f4f 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -1010,7 +1010,7 @@ 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, opt = "-ObjC -framework #{fw}", &b) $defs.push(format("-DHAVE_FRAMEWORK_%s", fw.tr_cpp)) $LDFLAGS << " " << opt true