summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 85ec3e7)
raw | patch | inline | side by side (parent: 85ec3e7)
author | Shawn O. Pearce <spearce@spearce.org> | |
Fri, 22 Feb 2008 00:17:27 +0000 (19:17 -0500) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Fri, 22 Feb 2008 06:35:44 +0000 (01:35 -0500) |
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>
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>
Makefile | patch | blob | history |
diff --git a/Makefile b/Makefile
index 081d7550a7dbc91d8360822a4da3ca51c66a33a2..1ba0e788f9a99980b4ab3a35f213f0a4ffcbaa1e 100644 (file)
--- a/Makefile
+++ b/Makefile
REMOVE_F1 = && echo ' ' REMOVE `basename "$$dst"` && $(RM_RF) "$$dst"
endif
-TCL_PATH ?= tclsh
TCLTK_PATH ?= wish
+ifeq (./,$(dir $(TCLTK_PATH)))
+ TCL_PATH ?= $(subst wish,tclsh,$(TCLTK_PATH))
+else
+ TCL_PATH ?= $(dir $(TCLTK_PATH))$(notdir $(subst wish,tclsh,$(TCLTK_PATH)))
+endif
ifeq ($(uname_S),Darwin)
TKFRAMEWORK = /Library/Frameworks/Tk.framework/Resources/Wish.app