Skip to content

Commit 651fbba

Browse files
committed
git-gui: Default TCL_PATH to same location as TCLTK_PATH
Most users set TCLTK_PATH to tell git-gui where to find wish, but they fail to set TCL_PATH to the same Tcl installation. We use the non-GUI tclsh during builds so headless systems are still able to create an index file and create message files without GNU msgfmt. So it matters to us that we find a working TCL_PATH at build time. If TCL_PATH hasn't been set yet we can take a better guess about what tclsh executable to use by replacing 'wish' in the executable path with 'tclsh'. We only do this replacement on the filename part of the path, just in case the string "wish" appears in the directory paths. Most of the time the tclsh will be installed alongside wish so this replacement is a sensible and safe default. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
1 parent 85ec3e7 commit 651fbba

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,12 @@ ifndef V
9292
REMOVE_F1 = && echo ' ' REMOVE `basename "$$dst"` && $(RM_RF) "$$dst"
9393
endif
9494

95-
TCL_PATH ?= tclsh
9695
TCLTK_PATH ?= wish
96+
ifeq (./,$(dir $(TCLTK_PATH)))
97+
TCL_PATH ?= $(subst wish,tclsh,$(TCLTK_PATH))
98+
else
99+
TCL_PATH ?= $(dir $(TCLTK_PATH))$(notdir $(subst wish,tclsh,$(TCLTK_PATH)))
100+
endif
97101

98102
ifeq ($(uname_S),Darwin)
99103
TKFRAMEWORK = /Library/Frameworks/Tk.framework/Resources/Wish.app

0 commit comments

Comments
 (0)