# [PATCH 1/2] configure: Allow GIT_ARG_SET_PATH to handle --without-PROGRAM

5 messages from 2010-02-01 to 2010-02-01. Participants: Ben Walton, Junio C Hamano.
Thread: https://gitlist.dev/t/22463

## Ben Walton, 2010-02-01 02:15

Subject: [PATCH 0/2] configure tweaks for NO_PYTHON
Message-ID: <1264990505-29578-1-git-send-email-bwalton@artsci.utoronto.ca>
URL: https://gitlist.dev/e/1264990505-29578-1-git-send-email-bwalton%40artsci.utoronto.ca

```
The following patches enable a user to ./configure git with python
disabled.  There is nothing using the remote helper libraries yet.  I
noticed this missing capability after the recent rpm .spec thread.

Ben Walton (2):
  configure: Allow GIT_ARG_SET_PATH to handle --without-PROGRAM
  configure: Allow --without-python

 configure.ac |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

```

## Ben Walton, 2010-02-01 02:15

Subject: [PATCH 1/2] configure: Allow GIT_ARG_SET_PATH to handle --without-PROGRAM
Message-ID: <1264990505-29578-2-git-send-email-bwalton@artsci.utoronto.ca>
URL: https://gitlist.dev/e/1264990505-29578-2-git-send-email-bwalton%40artsci.utoronto.ca
In-Reply-To: <1264990505-29578-1-git-send-email-bwalton@artsci.utoronto.ca>

```
Add an optional second argument to both GIT_ARG_SET_PATH and
GIT_CONF_APPEND_PATH such that any value of the second argument will
enable configure to set NO_$PROGRAM in addition to an empty
$PROGRAM_PATH.  This is initially useful for allowing configure to
disable the use of python, as the remote helper code has nothing
leveraging it yet.

The Makefile already recognizes NO_PYTHON, but configure provided no
way to set it appropriately.

Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
---
 configure.ac |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 229140e..9eaae7d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,21 +23,32 @@ AC_DEFUN([GIT_CONF_APPEND_LINE],
 # GIT_ARG_SET_PATH(PROGRAM)
 # -------------------------
 # Provide --with-PROGRAM=PATH option to set PATH to PROGRAM
+# Optional second argument allows setting NO_PROGRAM=YesPlease if
+# --without-PROGRAM version used.
 AC_DEFUN([GIT_ARG_SET_PATH],
 [AC_ARG_WITH([$1],
  [AS_HELP_STRING([--with-$1=PATH],
                  [provide PATH to $1])],
- [GIT_CONF_APPEND_PATH($1)],[])
+ [GIT_CONF_APPEND_PATH($1,$2)],[])
 ])# GIT_ARG_SET_PATH
 #
 # GIT_CONF_APPEND_PATH(PROGRAM)
 # ------------------------------
 # Parse --with-PROGRAM=PATH option to set PROGRAM_PATH=PATH
 # Used by GIT_ARG_SET_PATH(PROGRAM)
+# Optional second argument allows setting NO_PROGRAM=YesPlease if
+# --without-PROGRAM is used.
 AC_DEFUN([GIT_CONF_APPEND_PATH],
 [PROGRAM=m4_toupper($1); \
 if test "$withval" = "no"; then \
-	AC_MSG_ERROR([You cannot use git without $1]); \
+	if test -n "$2"; then \
+		m4_toupper($1)_PATH=$withval; \
+		AC_MSG_NOTICE([Disabling use of ${PROGRAM}]); \
+		GIT_CONF_APPEND_LINE(NO_${PROGRAM}=YesPlease); \
+		GIT_CONF_APPEND_LINE(${PROGRAM}_PATH=); \
+	else \
+		AC_MSG_ERROR([You cannot use git without $1]); \
+	fi; \
 else \
 	if test "$withval" = "yes"; then \
 		AC_MSG_WARN([You should provide path for --with-$1=PATH]); \
-- 
1.6.5.3

```

## Ben Walton, 2010-02-01 02:15

Subject: [PATCH 2/2] configure: Allow --without-python
Message-ID: <1264990505-29578-3-git-send-email-bwalton@artsci.utoronto.ca>
URL: https://gitlist.dev/e/1264990505-29578-3-git-send-email-bwalton%40artsci.utoronto.ca
In-Reply-To: <1264990505-29578-2-git-send-email-bwalton@artsci.utoronto.ca>

```
This patch allows someone to use configure to build git while at the
same time disabling the python remote helper code.  It leverages the
ability of GIT_ARG_SET_PATH to accept an optional second argument
indicating that --without-$PROGRAM is acceptable.

Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
---
 configure.ac |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index 9eaae7d..914ae57 100644
--- a/configure.ac
+++ b/configure.ac
@@ -288,7 +288,7 @@ GIT_ARG_SET_PATH(shell)
 GIT_ARG_SET_PATH(perl)
 #
 # Define PYTHON_PATH to provide path to Python.
-GIT_ARG_SET_PATH(python)
+GIT_ARG_SET_PATH(python, allow-without)
 #
 # Define ZLIB_PATH to provide path to zlib.
 GIT_ARG_SET_PATH(zlib)
-- 
1.6.5.3

```

## Junio C Hamano, 2010-02-01 21:14

Subject: Re: [PATCH 1/2] configure: Allow GIT_ARG_SET_PATH to handle --without-PROGRAM
Message-ID: <7vwrywu08v.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vwrywu08v.fsf%40alter.siamese.dyndns.org
In-Reply-To: <1264990505-29578-2-git-send-email-bwalton@artsci.utoronto.ca>

```
Ben Walton <bwalton@artsci.utoronto.ca> writes:

> Add an optional second argument to both GIT_ARG_SET_PATH and
> GIT_CONF_APPEND_PATH such that any value of the second argument will
> enable configure to set NO_$PROGRAM in addition to an empty
> $PROGRAM_PATH.  This is initially useful for allowing configure to
> disable the use of python, as the remote helper code has nothing
> leveraging it yet.
>
> The Makefile already recognizes NO_PYTHON, but configure provided no
> way to set it appropriately.
>
> Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
> ---

Interesting.

I noticed that even without this patch we seem to honor --without-tcltk
just fine and wondered why.  It turns out that we already do the right
thing when TCLTK_PATH is empty to set NO_TCLTK in our Makefile, but we at
the same time have a long custom code in configure.ac to support tcltk.

Perhaps we can clean-up with-/without-tcltk part in configure.ac using
this?

```

## Ben Walton, 2010-02-01 21:23

Subject: Re: [PATCH 1/2] configure: Allow GIT_ARG_SET_PATH to handle --without-PROGRAM
Message-ID: <1265059258-sup-1123@ntdws12.chass.utoronto.ca>
URL: https://gitlist.dev/e/1265059258-sup-1123%40ntdws12.chass.utoronto.ca
In-Reply-To: <7vwrywu08v.fsf@alter.siamese.dyndns.org>

```
Excerpts from Junio C Hamano's message of Mon Feb 01 16:14:40 -0500 2010:

> Perhaps we can clean-up with-/without-tcltk part in configure.ac using
> this?

Sure and I'd be happy to do this.

I noticed (after I sent the patches) that NO_PYTHON is set in the
Makefile automatically if --with-python= is used (leaving PYTHON_PATH
set to null).  I prefer the nicer --without-python personally.

I'll fix up the tcltk option and scan for others that might need
similar treatment.

Thanks
-Ben
-- 
Ben Walton
Systems Programmer - CHASS
University of Toronto
C:416.407.5610 | W:416.978.4302


```
