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

autoconf: Add support for setting PYTHON_PATH or NO_PYTHON

This patch adds support for setting either PYTHON_PATH or NO_PYTHON to autoconf generated ./configure script via --with-python=PATH (sets PYTHON_PATH) or --without-python (sets NO_PYTHON). Autodetect PYTHON_PATH via AC_PATH_PROGS. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>

Jakub Narebski committed Aug 3, 2006 at 00:40 UTC eb858c56cb9dcced05d61d47c0351b4f8768d379
1 file changed +22
configure.ac
+22
@@ -103,6 +103,18 @@ AC_MSG_NOTICE([CHECKS for programs])
103 #
104 GIT_ARG_SET_PATH(shell)
105 GIT_ARG_SET_PATH(perl)
106 +AC_ARG_WITH(python,[AS_HELP_STRING([--with-python=PATH], [provide PATH to python])
107 +AS_HELP_STRING([--no-python], [don't use python scripts])],
108 + [if test "$withval" = "no"; then \
109 + NO_PYTHON=YesPlease; \
110 + elif test "$withval" != "yes"; then \
111 + PYTHON_PATH=$withval; \
112 + fi; \
113 + ])
114 +AC_SUBST(NO_PYTHON)
115 +AC_SUBST(PYTHON_PATH)
116 +
117 +
118 #
119 # Define NO_PYTHON if you want to lose all benefits of the recursive merge.
120 # Define PYTHON_PATH to provide path to Python.
@@ -110,6 +122,16 @@ AC_PROG_CC
122 #AC_PROG_INSTALL # needs install-sh or install.sh in sources
123 AC_CHECK_TOOL(AR, ar, :)
124 AC_CHECK_PROGS(TAR, [gtar tar])
125 +if test -z "$NO_PYTHON"; then
126 + AC_PATH_PROGS(PYTHON_PATH, [python2.4 python2.3 python2 python])
127 + if test -n "$PYTHON_PATH"; then
128 + GIT_CONF_APPEND_LINE([PYTHON_PATH=@PYTHON_PATH@])
129 + else
130 + GIT_CONF_APPEND_LINE([NO_PYTHON=@NO_PYTHON@])
131 + fi
132 +else
133 + GIT_CONF_APPEND_LINE([NO_PYTHON=@NO_PYTHON@])
134 +fi
135
136
137 ## Checks for libraries.