From: Petr Baudis Date: Thu, 17 May 2007 02:14:48 GMT Subject: [PATCH] git-gui: Build even if tclsh is not available Message-ID: <20070517021448.24022.8282.stgit@rover> In-Reply-To: <20070517020616.4722.33946.stgit@rover> As of now, git fails to build with default config if tclsh is not available, thus requiring manual config tweaking just because of some optimizations done at build time; this is a needless hassle when building git on any kind of a server. This patch makes git-gui's build process to handle this gracefully; unless TCL_PATH is explicitly set, if tclsh cannot be executed only a warning is printed and the build goes on. I have tested this only on that server with no tclsh, but hopefully it shouldn't break the build process with tclsh available either. Version 2, sorry - the previous version of the patch had the install hunk missing. And apologies for the duplicate submission... :-) Signed-off-by: Petr Baudis --- Makefile | 8 +++++--- git-gui/Makefile | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 07411ff..ed12577 100644 --- a/Makefile +++ b/Makefile @@ -178,10 +178,12 @@ AR = ar TAR = tar INSTALL = install RPMBUILD = rpmbuild -TCL_PATH = tclsh -TCLTK_PATH = wish -export TCL_PATH TCLTK_PATH +# If TCL_PATH is not defined here, it will default to tclsh later +# with the exception that if tclsh cannot be executed, the optimization +# step is skipped. +# export TCL_PATH = tclsh +export 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.. diff --git a/git-gui/Makefile b/git-gui/Makefile index e73b645..be3cfbb 100644 --- a/git-gui/Makefile +++ b/git-gui/Makefile @@ -34,7 +34,7 @@ ifndef V QUIET_INDEX = @echo ' ' INDEX $(dir $@); endif -TCL_PATH ?= tclsh +TCL_PATH ?= tclsh || echo "Warning: Cannot execute tclsh, not optimizing git-gui" >&2 TCLTK_PATH ?= wish ifeq ($(findstring $(MAKEFLAGS),s),s) @@ -92,7 +92,7 @@ install: all $(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' ;) $(INSTALL) -d -m755 '$(DESTDIR_SQ)$(libdir_SQ)' - $(INSTALL) -m644 lib/tclIndex '$(DESTDIR_SQ)$(libdir_SQ)' + [ ! -e lib/tclIndex ] || $(INSTALL) -m644 lib/tclIndex '$(DESTDIR_SQ)$(libdir_SQ)' $(foreach p,$(ALL_LIBFILES), $(INSTALL) -m644 $p '$(DESTDIR_SQ)$(libdir_SQ)' ;) dist-version: