Skip to content

Commit 347d04d

Browse files
committed
Merge branch 'bw/no-python-autoconf'
* bw/no-python-autoconf: configure: Allow --without-python configure: Allow GIT_ARG_SET_PATH to handle --without-PROGRAM
2 parents d3b91fa + dc78250 commit 347d04d

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

configure.ac

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,32 @@ AC_DEFUN([GIT_CONF_APPEND_LINE],
2323
# GIT_ARG_SET_PATH(PROGRAM)
2424
# -------------------------
2525
# 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.
2628
AC_DEFUN([GIT_ARG_SET_PATH],
2729
[AC_ARG_WITH([$1],
2830
[AS_HELP_STRING([--with-$1=PATH],
2931
[provide PATH to $1])],
30-
[GIT_CONF_APPEND_PATH($1)],[])
32+
[GIT_CONF_APPEND_PATH($1,$2)],[])
3133
])# GIT_ARG_SET_PATH
3234
#
3335
# GIT_CONF_APPEND_PATH(PROGRAM)
3436
# ------------------------------
3537
# Parse --with-PROGRAM=PATH option to set PROGRAM_PATH=PATH
3638
# Used by GIT_ARG_SET_PATH(PROGRAM)
39+
# Optional second argument allows setting NO_PROGRAM=YesPlease if
40+
# --without-PROGRAM is used.
3741
AC_DEFUN([GIT_CONF_APPEND_PATH],
3842
[PROGRAM=m4_toupper($1); \
3943
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; \
4152
else \
4253
if test "$withval" = "yes"; then \
4354
AC_MSG_WARN([You should provide path for --with-$1=PATH]); \
@@ -277,7 +288,7 @@ GIT_ARG_SET_PATH(shell)
277288
GIT_ARG_SET_PATH(perl)
278289
#
279290
# Define PYTHON_PATH to provide path to Python.
280-
GIT_ARG_SET_PATH(python)
291+
GIT_ARG_SET_PATH(python, allow-without)
281292
#
282293
# Define ZLIB_PATH to provide path to zlib.
283294
GIT_ARG_SET_PATH(zlib)

0 commit comments

Comments
 (0)