Re: [PATCH] Added options NO_TCLTK, WITH_P4IMPORT and --with-tcltk/--without-tcltk.

5 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] Added options NO_TCLTK, WITH_P4IMPORT and --with-tcltk/--without-tcltk.

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:43:01

Jakub Narebski [off-list ref] writes:
Thanks a lot for the patch, but...

Eygene Ryabinkin wrote:
quoted
Internal make option TCLTK was added: it governs the location of
the Tcl/Tk interpreter, so user can specify its own binary location
either with './configure --with-tcltk=/path/to/binary' or
'TCLTK=/path/to/binary make'.
...shouldn't it be TCLTK_PATH?
Thanks for sanity checking.  That means that the absense of
tcltk would make it impossible to munge the scripts to point at
the wish binary, so makes the NO_TCLTK stuff easier to swallow.

Re: [PATCH] Added options NO_TCLTK, WITH_P4IMPORT and --with-tcltk/--without-tcltk.

From: Eygene Ryabinkin <hidden>
Date: 2016-06-15 22:43:01

Jakub, Junio,

Mon, Mar 26, 2007 at 01:36:49AM -0700, Junio C Hamano wrote:
Jakub Narebski [off-list ref] writes:
quoted
Thanks a lot for the patch, but...

Eygene Ryabinkin wrote:
quoted
Internal make option TCLTK was added: it governs the location of
the Tcl/Tk interpreter, so user can specify its own binary location
either with './configure --with-tcltk=/path/to/binary' or
'TCLTK=/path/to/binary make'.
...shouldn't it be TCLTK_PATH?
Yes, probably is should be TCLTK_PATH.
Thanks for sanity checking.  That means that the absense of
tcltk would make it impossible to munge the scripts to point at
the wish binary, so makes the NO_TCLTK stuff easier to swallow.
Sorry, did not get the point. The TCLTK is initialized to the 'wish'
by 'TCLTK ?= wish', so TCLTK will always be here and initialized
to the wish by-default.
-- 
Eygene

Re: [PATCH] Added options NO_TCLTK, WITH_P4IMPORT and --with-tcltk/--without-tcltk.

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:43:01

Eygene Ryabinkin [off-list ref] writes:
Mon, Mar 26, 2007 at 01:36:49AM -0700, Junio C Hamano wrote:
...
quoted
Thanks for sanity checking.  That means that the absense of
tcltk would make it impossible to munge the scripts to point at
the wish binary, so makes the NO_TCLTK stuff easier to swallow.
Sorry, did not get the point. The TCLTK is initialized to the 'wish'
by 'TCLTK ?= wish', so TCLTK will always be here and initialized
to the wish by-default.
Earlier I said I did not see a reason for not building wish
applications on a build system that lack them.  I am stating
that you could argue that your rewriting the path to wish is a
good reason (I would say it is half-good, as you can still tell
the build procedure where wish will be on the deployed system
without having it on your build system) for not building wish
applications in a build that lacks wish installation.

Re: [PATCH] Added options NO_TCLTK, WITH_P4IMPORT and --with-tcltk/--without-tcltk.

From: Eygene Ryabinkin <hidden>
Date: 2016-06-15 22:43:01

Junio, good day.

Mon, Mar 26, 2007 at 09:12:17PM -0700, Junio C Hamano wrote:
Eygene Ryabinkin [off-list ref] writes:
quoted
Mon, Mar 26, 2007 at 01:36:49AM -0700, Junio C Hamano wrote:
...
quoted
Thanks for sanity checking.  That means that the absense of
tcltk would make it impossible to munge the scripts to point at
the wish binary, so makes the NO_TCLTK stuff easier to swallow.
Sorry, did not get the point. The TCLTK is initialized to the 'wish'
by 'TCLTK ?= wish', so TCLTK will always be here and initialized
to the wish by-default.
Earlier I said I did not see a reason for not building wish
applications on a build system that lack them.  I am stating
that you could argue that your rewriting the path to wish is a
good reason (I would say it is half-good, as you can still tell
the build procedure where wish will be on the deployed system
without having it on your build system) for not building wish
applications in a build that lacks wish installation.
OK, so, probably, I should modify the behaviour of the --with-tcltk
and configure to look for the Tcl/Tk interpreter _only_ if
--with-tcltk[=PATH] was given and to leave the things unmodified
in the case of absence of that option. But still, --without-tcltk
will disable Tcl/Tk dependant parts. Will people be happy with such
behaviour?
-- 
Eygene

[PATCH] Added configure options --with-tcltk/--without-tcltk.

From: Eygene Ryabinkin <hidden>
Date: 2016-06-15 22:43:01

Configure's options --with-tcltk and --without-tcltk were added and
configure script teached to search for the Tcl/Tk interpreter.

The default behaviour to install Tcl/Tk dependant parts is left
intact: Tcl/Tk detection will be enabled only if --with-tcltk option
is given to configure.

Makefiles got two external options:
- TCLTK_PATH: the path to the Tcl/Tk interpreter.
- NO_TCLCK: disables the installation of Tcl/Tk dependend parts.

Signed-off-by: Eygene Ryabinkin <redacted>
---
 Makefile         |   30 ++++++++++++++++++++++++++++--
 config.mak.in    |    1 +
 configure.ac     |   26 ++++++++++++++++++++++++++
 git-gui/Makefile |    3 +++
 4 files changed, 58 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index a294ec8..06b6c6b 100644
--- a/Makefile
+++ b/Makefile
@@ -112,6 +112,11 @@ all::
 #
 # Define WITH_P4IMPORT to build and install Python git-p4import script.
 #
+# Define NO_TCLTK if you do not want Tcl/Tk GUI.
+#
+# The TCLTK_PATH variable governs the location of the Tck/Tk interpreter.
+# If not set it defaults to the bare 'wish'.
+#
 
 GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
 	@$(SHELL_PATH) ./GIT-VERSION-GEN
@@ -161,6 +166,7 @@ AR = ar
 TAR = tar
 INSTALL = install
 RPMBUILD = rpmbuild
+TCLTK_PATH ?= wish
 
 # sparse is architecture-neutral, which means that we need to tell it
 # explicitly what architecture to check for. Fix this up for yours..
@@ -624,6 +630,10 @@ ifdef NO_PERL_MAKEMAKER
 	export NO_PERL_MAKEMAKER
 endif
 
+ifeq ($(TCLTK_PATH),)
+NO_TCLTK=YesPlease
+endif
+
 QUIET_SUBDIR0  = $(MAKE) -C # space to separate -C and subdir
 QUIET_SUBDIR1  =
 
@@ -684,7 +694,9 @@ ifneq (,$X)
 endif
 
 all::
+ifndef NO_TCLTK
 	$(QUIET_SUBDIR0)git-gui $(QUIET_SUBDIR1) all
+endif
 	$(QUIET_SUBDIR0)perl $(QUIET_SUBDIR1) PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' all
 	$(QUIET_SUBDIR0)templates $(QUIET_SUBDIR1)
 
@@ -918,10 +930,16 @@ install: all
 	$(INSTALL) -d -m755 '$(DESTDIR_SQ)$(bindir_SQ)'
 	$(INSTALL) -d -m755 '$(DESTDIR_SQ)$(gitexecdir_SQ)'
 	$(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(gitexecdir_SQ)'
-	$(INSTALL) git$X gitk '$(DESTDIR_SQ)$(bindir_SQ)'
+	$(INSTALL) git$X '$(DESTDIR_SQ)$(bindir_SQ)'
+ifndef NO_TCLTK
+	sed -i .bak -e'1,3s|^exec .* "$$0"|exec '"$(TCLTK_PATH)"' "$$0"|' gitk && rm -f gitk.bak
+	$(INSTALL) gitk '$(DESTDIR_SQ)$(bindir_SQ)'
+endif
 	$(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install
 	$(MAKE) -C perl prefix='$(prefix_SQ)' install
-	$(MAKE) -C git-gui install
+ifndef NO_TCLTK
+	$(MAKE) -C git-gui TCLTK_PATH='$(TCLTK_PATH)' install
+endif
 	if test 'z$(bindir_SQ)' != 'z$(gitexecdir_SQ)'; \
 	then \
 		ln -f '$(DESTDIR_SQ)$(bindir_SQ)/git$X' \
@@ -955,11 +973,17 @@ dist: git.spec git-archive
 	@mkdir -p $(GIT_TARNAME)
 	@cp git.spec $(GIT_TARNAME)
 	@echo $(GIT_VERSION) > $(GIT_TARNAME)/version
+ifndef NO_TCLTK
 	@$(MAKE) -C git-gui TARDIR=../$(GIT_TARNAME)/git-gui dist-version
 	$(TAR) rf $(GIT_TARNAME).tar \
 		$(GIT_TARNAME)/git.spec \
 		$(GIT_TARNAME)/version \
 		$(GIT_TARNAME)/git-gui/version
+else
+	$(TAR) rf $(GIT_TARNAME).tar \
+		$(GIT_TARNAME)/git.spec \
+		$(GIT_TARNAME)/version
+endif
 	@rm -rf $(GIT_TARNAME)
 	gzip -f -9 $(GIT_TARNAME).tar
 
@@ -1000,7 +1024,9 @@ clean:
 	rm -f gitweb/gitweb.cgi
 	$(MAKE) -C Documentation/ clean
 	$(MAKE) -C perl clean
+ifndef NO_TCLTK
 	$(MAKE) -C git-gui clean
+endif
 	$(MAKE) -C templates/ clean
 	$(MAKE) -C t/ clean
 	rm -f GIT-VERSION-FILE GIT-CFLAGS
diff --git a/config.mak.in b/config.mak.in
index 9a57840..eb9d7a5 100644
--- a/config.mak.in
+++ b/config.mak.in
@@ -6,6 +6,7 @@ CFLAGS = @CFLAGS@
 AR = @AR@
 TAR = @TAR@
 #INSTALL = @INSTALL@		# needs install-sh or install.sh in sources
+TCLTK_PATH = @TCLTK_PATH@
 
 prefix = @prefix@
 exec_prefix = @exec_prefix@
diff --git a/configure.ac b/configure.ac
index 3a8e778..43a6769 100644
--- a/configure.ac
+++ b/configure.ac
@@ -75,6 +75,14 @@ GIT_ARG_SET_PATH(shell)
 # Define PERL_PATH to provide path to Perl.
 GIT_ARG_SET_PATH(perl)
 #
+# Declare the with-tcltk/without-tcltk options.
+AC_ARG_WITH(tcltk,
+AS_HELP_STRING([--with-tcltk],[use Tcl/Tk GUI (default is YES)])
+AS_HELP_STRING([],[ARG is the full path to the Tcl/Tk interpreter.])
+AS_HELP_STRING([],[Bare --with-tcltk will make the GUI part only if])
+AS_HELP_STRING([],[Tcl/Tk interpreter will be found in a system.]),\
+GIT_PARSE_WITH(tcltk))
+#
 
 
 ## Checks for programs.
@@ -84,6 +92,24 @@ AC_PROG_CC([cc gcc])
 #AC_PROG_INSTALL		# needs install-sh or install.sh in sources
 AC_CHECK_TOOL(AR, ar, :)
 AC_CHECK_PROGS(TAR, [gtar tar])
+# TCLTK_PATH will be set to some value if we want Tcl/Tk
+# or will be empty otherwise.
+if test -z "$NO_TCLTK"; then
+  if test "$with_tcltk" = ""; then
+  # No Tcl/Tk switches given. Do not check for Tcl/Tk, use bare 'wish'.
+    TCLTK_PATH=wish
+    AC_SUBST(TCLTK_PATH)
+  elif test "$with_tcltk" = "yes"; then
+  # Tcl/Tk check requested.
+    AC_CHECK_PROGS(TCLTK_PATH, [wish], )
+  elif ! test -x "$with_tcltk"; then
+    AC_MSG_ERROR([Tcl/Tk interpreter was not found in $with_tcltk])
+  else
+    AC_MSG_RESULT([Using Tcl/Tk interpreter $with_tcltk])
+    TCLTK_PATH="$with_tcltk"
+    AC_SUBST(TCLTK_PATH)
+  fi
+fi
 
 ## Checks for libraries.
 AC_MSG_NOTICE([CHECKS for libraries])
diff --git a/git-gui/Makefile b/git-gui/Makefile
index b82789e..2316b24 100644
--- a/git-gui/Makefile
+++ b/git-gui/Makefile
@@ -28,6 +28,8 @@ ifndef V
 	QUIET_BUILT_IN = @echo '   ' BUILTIN $@;
 endif
 
+TCLTK_PATH ?= wish
+
 ifeq ($(findstring $(MAKEFLAGS),s),s)
 QUIET_GEN =
 QUIET_BUILT_IN =
@@ -55,6 +57,7 @@ all:: $(ALL_PROGRAMS)
 
 install: all
 	$(INSTALL) -d -m755 '$(DESTDIR_SQ)$(gitexecdir_SQ)'
+	sed -i .bak -e'1,3s|^exec .* "$$0"|exec '"$(TCLTK_PATH)"' "$$0"|' git-gui && rm git-gui.bak
 	$(INSTALL) git-gui '$(DESTDIR_SQ)$(gitexecdir_SQ)'
 	$(foreach p,$(GITGUI_BUILT_INS), rm -f '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' && ln '$(DESTDIR_SQ)$(gitexecdir_SQ)/git-gui' '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' ;)
 
-- 
1.5.0.3-dirty
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help