threads / patch / 22463

patch, 2 partsconfigure: Allow GIT_ARG_SET_PATH to handle --without-PROGRAM

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

## tl;dr

5 messages between Feb 1, 2010 and Feb 1, 2010. Diffs are folded; open one to read it.

replies: 4people: 2as markdown or json

Ben Walton· Feb 1, 2010, 02:15 UTC · lore

[PATCH 0/2] configure tweaks for NO_PYTHON

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· Feb 1, 2010, 02:15 UTC · re: Ben Walton · lore

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(-)
Show changes to configure.ac +13 −2
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· Feb 1, 2010, 02:15 UTC · re: Ben Walton · lore

[PATCH 2/2] configure: Allow --without-python

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(-)
Show changes to configure.ac +1 −1
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· Feb 1, 2010, 21:14 UTC · re: Ben Walton · lore

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

Ben Walton <bwalton@artsci.utoronto.ca> writes:
Show 12 quoted lines
> 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· Feb 1, 2010, 21:23 UTC · re: Junio C Hamano · lore

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

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

← back to recent threads