Merge branch 'bw/no-python-autoconf'
authorJunio C Hamano <gitster@pobox.com>
Wed, 3 Feb 2010 05:48:13 +0000 (21:48 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 3 Feb 2010 05:48:13 +0000 (21:48 -0800)
* bw/no-python-autoconf:
configure: Allow --without-python
configure: Allow GIT_ARG_SET_PATH to handle --without-PROGRAM

1  2 
configure.ac
diff --combined configure.ac
index 229140e6be0660f946c9e8601235cf0a4724262e,e6be739ebff7b90ea87ca32061977a246f3570de..914ae5759f6932c28ee39afec1e36d80c8e63cd9
@@@ -23,21 -23,32 +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]); \
@@@ -277,7 -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)
@@@ -762,9 -773,10 +773,9 @@@ AC_SUBST(NO_MKSTEMPS
  # Define NO_SYMLINK_HEAD if you never want .git/HEAD to be a symbolic link.
  # Enable it on Windows.  By default, symrefs are still used.
  #
 -# Define NO_PTHREADS if we do not have pthreads
 +# Define NO_PTHREADS if we do not have pthreads.
  #
 -# Define PTHREAD_LIBS to the linker flag used for Pthread support and define
 -# THREADED_DELTA_SEARCH if Pthreads are available.
 +# Define PTHREAD_LIBS to the linker flag used for Pthread support.
  AC_DEFUN([PTHREADTEST_SRC], [
  #include <pthread.h>
  
@@@ -781,6 -793,7 +792,6 @@@ dnl   [[pthread_mutex_t test_mutex;]
  dnl )])
  
  NO_PTHREADS=UnfortunatelyYes
 -THREADED_DELTA_SEARCH=
  PTHREAD_LIBS=
  
  if test -n "$USER_NOPTHREAD"; then
@@@ -796,6 -809,7 +807,6 @@@ elif test -z "$PTHREAD_CFLAGS"; the
        [AC_MSG_RESULT([yes])
                NO_PTHREADS=
                PTHREAD_LIBS="$opt"
 -              THREADED_DELTA_SEARCH=YesPlease
                break
        ],
        [AC_MSG_RESULT([no])])
@@@ -809,6 -823,7 +820,6 @@@ els
        [AC_MSG_RESULT([yes])
                NO_PTHREADS=
                PTHREAD_LIBS="$PTHREAD_CFLAGS"
 -              THREADED_DELTA_SEARCH=YesPlease
        ],
        [AC_MSG_RESULT([no])])
  
@@@ -819,6 -834,7 +830,6 @@@ CFLAGS="$old_CFLAGS
  
  AC_SUBST(PTHREAD_LIBS)
  AC_SUBST(NO_PTHREADS)
 -AC_SUBST(THREADED_DELTA_SEARCH)
  
  ## Output files
  AC_CONFIG_FILES(["${config_file}":"${config_in}":"${config_append}"])