Skip to content

Commit 2e86f30

Browse files
jeffquejeremyevans
authored andcommitted
Actually, it seems I was wrong about this
It seems that `try_func` is indeed generating the right code
1 parent dc40319 commit 2e86f30

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ext/tk/extconf.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,11 @@ def libcheck_for_tclConfig(tcldir, tkdir, tclconf, tkconf)
691691
tklibs << " " << tcllibs if tcllibs
692692
tmp_tklibs = tklibs.dup
693693
$LIBPATH = libpath | [tkdir]
694-
have_header("tk.h") && have_library("tk", tkfunc, ["tcl.h", "tk.h"])
694+
try_func(tkfunc, tklibs, ["tcl.h", "tk.h"]) ||
695+
( try_func(tkfunc, tklibs << " " << tkconf['TK_LIBS'], ["tcl.h", "tk.h"]) if tkconf['TK_LIBS'] ) ||
696+
( try_func(tkfunc, (tklibs = tmp_tklibs.dup) << " " << tkconf['TK_XLIBSW'], ["tcl.h", "tk.h"]) if tkconf['TK_XLIBSW'] ) ||
697+
( try_func(tkfunc, tklibs << " " << tkconf['TK_LIBS'], ["tcl.h", "tk.h"]) if tkconf['TK_LIBS'] )
698+
695699
ensure
696700
mkmf_param = {
697701
'PATH' => file,

0 commit comments

Comments
 (0)