@matheusbsbs / matheus-bagliano / commits / f22cd7fcc5
Fork 0

configure: Allow GIT_ARG_SET_PATH to handle --without-PROGRAM

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> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ben Walton committed Jan 31, 2010 at 21:15 UTC f22cd7fcc54a98277b3d2b82f1bb0b593658925c
1 file changed +13 -2
configure.ac
+13 -2
@@ -23,21 +23,32 @@ AC_DEFUN([GIT_CONF_APPEND_LINE],
23 # GIT_ARG_SET_PATH(PROGRAM)
24 # -------------------------
25 # Provide --with-PROGRAM=PATH option to set PATH to PROGRAM
26 +# Optional second argument allows setting NO_PROGRAM=YesPlease if
27 +# --without-PROGRAM version used.
28 AC_DEFUN([GIT_ARG_SET_PATH],
29 [AC_ARG_WITH([$1],
30 [AS_HELP_STRING([--with-$1=PATH],
31 [provide PATH to $1])],
30 - [GIT_CONF_APPEND_PATH($1)],[])
32 + [GIT_CONF_APPEND_PATH($1,$2)],[])
33 ])# GIT_ARG_SET_PATH
34 #
35 # GIT_CONF_APPEND_PATH(PROGRAM)
36 # ------------------------------
37 # Parse --with-PROGRAM=PATH option to set PROGRAM_PATH=PATH
38 # Used by GIT_ARG_SET_PATH(PROGRAM)
39 +# Optional second argument allows setting NO_PROGRAM=YesPlease if
40 +# --without-PROGRAM is used.
41 AC_DEFUN([GIT_CONF_APPEND_PATH],
42 [PROGRAM=m4_toupper($1); \
43 if test "$withval" = "no"; then \
40 - AC_MSG_ERROR([You cannot use git without $1]); \
44 + if test -n "$2"; then \
45 + m4_toupper($1)_PATH=$withval; \
46 + AC_MSG_NOTICE([Disabling use of ${PROGRAM}]); \
47 + GIT_CONF_APPEND_LINE(NO_${PROGRAM}=YesPlease); \
48 + GIT_CONF_APPEND_LINE(${PROGRAM}_PATH=); \
49 + else \
50 + AC_MSG_ERROR([You cannot use git without $1]); \
51 + fi; \
52 else \
53 if test "$withval" = "yes"; then \
54 AC_MSG_WARN([You should provide path for --with-$1=PATH]); \