mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Christian Couder <>
Cc: Junio C Hamano <>, Jeff King <>,
	Dominik Mahrer <>,, Todd Zullinger <>,
	Christian Couder <>
Subject: [PATCH] Makefile: check that tcl/tk is installed
Date: Mon, 20 Nov 2017 18:15:17 +0100	[thread overview]
Message-ID: <> (raw)

By default running `make install` in the root directory of the
project will set TCLTK_PATH to `wish` and then go into the "git-gui"
and "gitk-git" sub-directories to build and install these 2

When Tcl/Tk is not installed, the above will succeed if gettext
is installed, as Tcl/Tk is only required as a substitute for msgfmt
when msgfmt is not installed. But then running the installed gitk
and git-gui will fail.

If neither Tcl/Tk nor gettext are installed, then processing po
files will fail in the git-gui directory. The error message when
this happens is very confusing to new comers as it is difficult
to understand that we tried to use Tcl/Tk as a substitute for
msgfmt, and that the solution is to either install gettext or
Tcl/Tk, or to set both NO_GETTEXT and NO_TCLTK.

To improve the current behavior when Tcl/Tk is not installed,
let's just check that TCLTK_PATH points to something and error
out right away if this is not the case.

This should benefit people who actually want to install and use
git-gui or gitk as they will have to install Tcl/Tk anyway, and
it is better for them if they are told about installing it soon
in the build process, rather than if they have to debug it after

For people who don't want to use git-gui or gitk, this forces
them to specify NO_TCLTK. If they don't have gettext, this will
make it much easier to fix the problems they would have had to
fix anyway. If they have gettext, setting NO_TCLTK is a small
additional step they will have to make, but it might be a good
thing as it will not install what they don't want and it will
build a bit faster.

For packagers who want to build git-gui and gitk even if Tcl/Tk
is not installed, we provide the new BYPASS_TCLTK_CHECK variable.

Signed-off-by: Christian Couder <>
 Makefile | 13 +++++++++++++
 1 file changed, 13 insertions(+)

The changes compared to the previous version are related to the newly
introduced BYPASS_TCLTK_CHECK variable.

I agree that removing NO_TCLTK while introducing USE_TCLTK and not
building git-gui and gitk by default is perhaps simpler and probably
the right direction for the future, but I think it might be too big a
change for now or until the next major release (Git 3.0.0).

diff --git a/Makefile b/Makefile
index ee9d5eb11e..1637725780 100644
--- a/Makefile
+++ b/Makefile
@@ -318,6 +318,10 @@ all::
 # If not set it defaults to the bare 'wish'. If it is set to the empty
 # string then NO_TCLTK will be forced (this is used by configure script).
+# The BYPASS_TCLTK_CHECK variable can be used when you want to build
+# the Tcl/Tk GUI but don't want to install Tcl/Tk on the build
+# machine.
 # Define INTERNAL_QSORT to use Git's implementation of qsort(), which
 # is a simplified version of the merge sort used in glibc. This is
 # recommended if Git triggers O(n^2) behavior in your platform's qsort().
@@ -1636,6 +1640,15 @@ ifeq ($(TCLTK_PATH),)
 NO_TCLTK = NoThanks
+ifndef NO_TCLTK
+		has_tcltk := $(shell type $(TCLTK_PATH) 2>/dev/null)
+		ifndef has_tcltk
+$(error "Tcl/Tk is not installed ('$(TCLTK_PATH)' not found). Consider setting NO_TCLTK or installing Tcl/Tk")
+		endif
+	endif
 ifeq ($(PERL_PATH),)
 NO_PERL = NoThanks

             reply	other threads:[~2017-11-20 17:15 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-20 17:15 Christian Couder [this message]
2017-11-20 17:17 ` [PATCH] Makefile: check that tcl/tk is installed Christian Couder
2017-11-20 19:19 ` Jonathan Nieder
2017-11-20 23:58   ` Christian Couder
2017-11-26 19:15     ` Jeff King
2017-11-26 20:57       ` Christian Couder
2017-11-27 15:31         ` Jeff King
2017-11-27  1:13       ` Junio C Hamano
2017-11-27  4:31         ` Junio C Hamano
2017-11-27  4:35           ` Jeff King
2017-11-27  5:22             ` Todd Zullinger
2017-11-27  8:24             ` Christian Couder
2017-11-27 15:27               ` Jeff King
2017-11-27 23:42                 ` Junio C Hamano
2017-11-28  4:35                   ` Junio C Hamano
2017-11-28 14:37                     ` [PATCH] travis-ci: avoid new tcl/tk build requirement Todd Zullinger
2017-11-28 15:03                       ` Christian Couder
2017-11-28 16:02                         ` Todd Zullinger
2017-11-28 23:47                           ` Junio C Hamano
2017-11-27  9:08             ` [PATCH] Makefile: check that tcl/tk is installed Junio C Hamano
2017-11-25 20:46 ` Christian Couder
2017-11-26  3:53   ` Junio C Hamano
2017-11-26 14:00     ` Christian Couder
2017-11-26 17:43       ` Ramsay Jones
2017-11-26 18:34         ` Christian Couder
  -- strict thread matches above, loose matches on Subject: below --
2017-11-15 12:52 Christian Couder
2017-11-16  1:35 ` Junio C Hamano
2017-11-17 15:35   ` Christian Couder
2017-11-17 17:42     ` Todd Zullinger
2017-11-17 22:02       ` Jeff King
2017-11-20 17:25         ` Christian Couder
2017-11-20 18:12       ` Christian Couder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).