@matheusbsbs / matheus-bagliano / commits / 81b63c707e
Fork 0

Add --with-tcltk and --without-tcltk to configure.

--with-tcltk enables the search of the Tcl/Tk interpreter. If no interpreter is found then Tcl/Tk dependend parts are disabled. --without-tcltk unconditionally disables Tcl/Tk dependent parts. The original behaviour is not changed: bare './configure' just installs the Tcl/Tk part doing no checks for the interpreter. Signed-off-by: Eygene Ryabinkin <rea-git@codelabs.ru>

Eygene Ryabinkin committed Mar 28, 2007 at 04:12 UTC 81b63c707ed5962d45bd575c946a7127c19a3e35
3 files changed +38 -1
Makefile
+11 -1
@@ -112,6 +112,10 @@ all::
112 #
113 # Define NO_TCLTK if you do not want Tcl/Tk GUI.
114 #
115 +# The TCLTK_PATH variable governs the location of the Tck/Tk interpreter.
116 +# If not set it defaults to the bare 'wish'. If it is set to the empty
117 +# string then NO_TCLTK will be forced (this is used by configure script).
118 +#
119
120 GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
121 @$(SHELL_PATH) ./GIT-VERSION-GEN
@@ -161,6 +165,7 @@ AR = ar
165 TAR = tar
166 INSTALL = install
167 RPMBUILD = rpmbuild
168 +TCLTK_PATH = wish
169
170 # sparse is architecture-neutral, which means that we need to tell it
171 # explicitly what architecture to check for. Fix this up for yours..
@@ -616,6 +621,10 @@ ifdef NO_PERL_MAKEMAKER
621 export NO_PERL_MAKEMAKER
622 endif
623
624 +ifeq ($(TCLTK_PATH),)
625 +NO_TCLTK=NoThanks
626 +endif
627 +
628 QUIET_SUBDIR0 = $(MAKE) -C # space to separate -C and subdir
629 QUIET_SUBDIR1 =
630
@@ -654,6 +663,7 @@ prefix_SQ = $(subst ','\'',$(prefix))
663
664 SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
665 PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH))
666 +TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH))
667
668 LIBS = $(GITLIBS) $(EXTLIBS)
669
@@ -676,7 +686,7 @@ endif
686
687 all::
688 ifndef NO_TCLTK
679 - $(QUIET_SUBDIR0)git-gui $(QUIET_SUBDIR1) all
689 + $(QUIET_SUBDIR0)git-gui TCLTK_PATH='$(TCLTK_PATH_SQ)' $(QUIET_SUBDIR1) all
690 endif
691 $(QUIET_SUBDIR0)perl $(QUIET_SUBDIR1) PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' all
692 $(QUIET_SUBDIR0)templates $(QUIET_SUBDIR1)
config.mak.in
+1
@@ -6,6 +6,7 @@ CFLAGS = @CFLAGS@
6 AR = @AR@
7 TAR = @TAR@
8 #INSTALL = @INSTALL@ # needs install-sh or install.sh in sources
9 +TCLTK_PATH = @TCLTK_PATH@
10
11 prefix = @prefix@
12 exec_prefix = @exec_prefix@
configure.ac
+26
@@ -75,6 +75,14 @@ GIT_ARG_SET_PATH(shell)
75 # Define PERL_PATH to provide path to Perl.
76 GIT_ARG_SET_PATH(perl)
77 #
78 +# Declare the with-tcltk/without-tcltk options.
79 +AC_ARG_WITH(tcltk,
80 +AS_HELP_STRING([--with-tcltk],[use Tcl/Tk GUI (default is YES)])
81 +AS_HELP_STRING([],[ARG is the full path to the Tcl/Tk interpreter.])
82 +AS_HELP_STRING([],[Bare --with-tcltk will make the GUI part only if])
83 +AS_HELP_STRING([],[Tcl/Tk interpreter will be found in a system.]),\
84 +GIT_PARSE_WITH(tcltk))
85 +#
86
87
88 ## Checks for programs.
@@ -84,6 +92,24 @@ AC_PROG_CC([cc gcc])
92 #AC_PROG_INSTALL # needs install-sh or install.sh in sources
93 AC_CHECK_TOOL(AR, ar, :)
94 AC_CHECK_PROGS(TAR, [gtar tar])
95 +# TCLTK_PATH will be set to some value if we want Tcl/Tk
96 +# or will be empty otherwise.
97 +if test -z "$NO_TCLTK"; then
98 + if test "$with_tcltk" = ""; then
99 + # No Tcl/Tk switches given. Do not check for Tcl/Tk, use bare 'wish'.
100 + TCLTK_PATH=wish
101 + AC_SUBST(TCLTK_PATH)
102 + elif test "$with_tcltk" = "yes"; then
103 + # Tcl/Tk check requested.
104 + AC_CHECK_PROGS(TCLTK_PATH, [wish], )
105 + elif test -x "$with_tcltk"; then
106 + AC_MSG_RESULT([Using Tcl/Tk interpreter $with_tcltk])
107 + TCLTK_PATH="$with_tcltk"
108 + AC_SUBST(TCLTK_PATH)
109 + else
110 + AC_MSG_ERROR([Tcl/Tk interpreter was not found in $with_tcltk])
111 + fi
112 +fi
113
114 ## Checks for libraries.
115 AC_MSG_NOTICE([CHECKS for libraries])