diff --git a/ext/tk/extconf.rb b/ext/tk/extconf.rb index 709e4d2..fa1bc80 100644 --- a/ext/tk/extconf.rb +++ b/ext/tk/extconf.rb @@ -615,7 +615,7 @@ def libcheck_for_tclConfig(tcldir, tkdir, tclconf, tkconf) $INCFLAGS << " -I" << File.join(File.dirname(File.dirname(file)),"include") if is_win32? else tcllibs = append_library($libs, libname) - tcllibs = "-L#{tcldir.quote} -Wl,-R#{tcldir.quote} " + tcllibs + tcllibs = "#{libpathflag(tcldir)} #{tcllibs}" # FIX ME: avoid pathname trouble (fail to find) on MinGW. $INCFLAGS << " -I" << File.join(File.dirname(tcldir),"include") if is_win32? @@ -657,7 +657,7 @@ def libcheck_for_tclConfig(tcldir, tkdir, tclconf, tkconf) else tklibs = append_library("", libname) #tklibs = append_library("", $1) - tklibs = "-L#{tkdir.quote} -Wl,-R#{tkdir.quote} " + tklibs + tklibs = "#{libpathflag(tkdir)} #{tklibs}" # FIX ME: avoid pathname trouble (fail to find) on MinGW. $INCFLAGS << " -I" << File.join(File.dirname(tcldir),"include") if is_win32? @@ -1126,7 +1126,7 @@ def find_tcl(tcllib, stubs, version, *opt_paths) tcllibs = libs_param + " -DSTATIC_BUILD " + fname.quote else tcllibs = append_library($libs, lib_w_sufx) - tcllibs = "-L#{path.quote} -Wl,-R#{path.quote} " + tcllibs + tcllibs = "#{libpathflag(path)} #{tcllibs}" end if try_func(func, tcllibs, ["tcl.h"]) return [true, path, nil, tcllibs, *inc] @@ -1265,7 +1265,7 @@ def find_tk(tklib, stubs, version, *opt_paths) tklibs = libs_param + " -DSTATIC_BUILD " + fname.quote else tklibs = append_library($libs, lib_w_sufx) - tklibs = "-L#{path.quote} -Wl,-R#{path.quote} " + tklibs + tklibs = "#{libpathflag(path)} #{tklibs}" end if try_func(func, tklibs, ["tcl.h", "tk.h"]) return [true, path, nil, tklibs, *inc]