git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eygene Ryabinkin <rea-git@codelabs.ru>
To: git@vger.kernel.org
Subject: [PATCH] Introduce file with the common default build-time items.
Date: Wed, 13 Jun 2007 09:43:16 +0400	[thread overview]
Message-ID: <20070613054316.GN86872@void.codelabs.ru> (raw)

Words 'wish' and 'tclsh' are scattered across at least three files,
but they are tied to the same entities.  To ease the maintenance
and remove errors, these configuration items were gathered into the
separate file named 'common-make-vars.def'.

Signed-off-by: Eygene Ryabinkin <rea-git@codelabs.ru>
---
 Makefile             |   17 +++++++++++------
 common-make-vars.def |   11 +++++++++++
 configure.ac         |    4 +++-
 git-gui/Makefile     |    6 ++++--
 4 files changed, 29 insertions(+), 9 deletions(-)
 create mode 100644 common-make-vars.def

diff --git a/Makefile b/Makefile
index 6cd9ea2..e98f16b 100644
--- a/Makefile
+++ b/Makefile
@@ -116,16 +116,21 @@ all::
 #
 # The TCL_PATH variable governs the location of the Tcl interpreter
 # used to optimize git-gui for your system.  Only used if NO_TCLTK
-# is not set.  Defaults to the bare 'tclsh'.
+# is not set.  Defaults to the value of the __GIT_DEFAULT_TCLSH_NAME
+# from common-make-vars.def.
 #
-# The TCLTK_PATH variable governs the location of the Tcl/Tk interpreter.
-# 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 TCLTK_PATH variable governs the location of the Tcl/Tk
+# interpreter.  If not set it defaults to the value of the
+# __GIT_DEFAULT_TCLTK_NAME from common-make-vars.def.  If it is set
+# to the empty string then NO_TCLTK will be forced (this is used
+# by configure script).
 #
 
 GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
 	@$(SHELL_PATH) ./GIT-VERSION-GEN
 -include GIT-VERSION-FILE
+# Default values
+-include common-make-vars.def
 
 uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
 uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not')
@@ -177,8 +182,8 @@ AR ?= ar
 TAR ?= tar
 INSTALL ?= install
 RPMBUILD ?= rpmbuild
-TCL_PATH ?= tclsh
-TCLTK_PATH ?= wish
+TCL_PATH ?= $(__GIT_DEFAULT_TCLSH_NAME)
+TCLTK_PATH ?= $(__GIT_DEFAULT_TCLTK_NAME)
 
 export TCL_PATH TCLTK_PATH
 
diff --git a/common-make-vars.def b/common-make-vars.def
new file mode 100644
index 0000000..43a3a8b
--- /dev/null
+++ b/common-make-vars.def
@@ -0,0 +1,11 @@
+# This file is meant to be sourced from the autoconf script
+# and included from the Makefile.  It carries the default values
+# to eliminate their redundancy across the files.  The syntax
+# is 'name=value' without extra spaces across the '=' sign to
+# make shell happy.  Symbols '#' are starting comments ;))
+
+# Default Tcl/Tk interpreter name
+__GIT_DEFAULT_TCLTK_NAME=wish
+
+# Default Tcl interpreter name
+__GIT_DEFAULT_TCLSH_NAME=tclsh
diff --git a/configure.ac b/configure.ac
index 50d2b85..fd1d241 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12,6 +12,8 @@ config_in=config.mak.in
 
 echo "# ${config_append}.  Generated by configure." > "${config_append}"
 
+## Defaults
+source common-make-vars.def
 
 ## Definitions of macros
 # GIT_CONF_APPEND_LINE(LINE)
@@ -97,7 +99,7 @@ AC_CHECK_PROGS(TAR, [gtar tar])
 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
+    TCLTK_PATH=${__GIT_DEFAULT_TCLTK_NAME}
     AC_SUBST(TCLTK_PATH)
   elif test "$with_tcltk" = "yes"; then
   # Tcl/Tk check requested.
diff --git a/git-gui/Makefile b/git-gui/Makefile
index 3de0de1..654641a 100644
--- a/git-gui/Makefile
+++ b/git-gui/Makefile
@@ -6,6 +6,8 @@ all::
 GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
 	@$(SHELL_PATH) ./GIT-VERSION-GEN
 -include GIT-VERSION-FILE
+# Default values
+-include ../common-make-vars.def
 
 SCRIPT_SH = git-gui.sh
 GITGUI_BUILT_INS = git-citool
@@ -36,8 +38,8 @@ ifndef V
 	QUIET_2DEVNULL = 2>/dev/null
 endif
 
-TCL_PATH   ?= tclsh
-TCLTK_PATH ?= wish
+TCL_PATH   ?= $(__GIT_DEFAULT_TCLSH_NAME)
+TCLTK_PATH ?= $(__GIT_DEFAULT_TCLTK_NAME}
 
 ifeq ($(findstring $(MAKEFLAGS),s),s)
 QUIET_GEN =
-- 
1.5.2.1

             reply	other threads:[~2007-06-13  6:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-13  5:43 Eygene Ryabinkin [this message]
2007-06-14  4:36 ` [PATCH] Introduce file with the common default build-time items Shawn O. Pearce
2007-06-14  9:56   ` Eygene Ryabinkin
2007-06-14 15:09     ` Shawn O. Pearce
2007-06-14 19:07       ` [CORRECTED PATCH] " Eygene Ryabinkin
2007-06-15  3:22         ` Shawn O. Pearce
2007-06-15  5:40           ` Eygene Ryabinkin
2007-06-15  5:58             ` Shawn O. Pearce
2007-06-15  6:07               ` Eygene Ryabinkin
2007-06-15  7:15             ` Johannes Sixt
2007-06-15 10:28               ` Eygene Ryabinkin

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=20070613054316.GN86872@void.codelabs.ru \
    --to=rea-git@codelabs.ru \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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.
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 NNTP newsgroup(s).