autoconf: Add support for setting SHELL_PATH and PERL_PATH
authorJakub Narebski <jnareb@gmail.com>
Wed, 2 Aug 2006 22:38:11 +0000 (00:38 +0200)
committerJunio C Hamano <junkio@cox.net>
Thu, 3 Aug 2006 00:16:40 +0000 (17:16 -0700)
This patch adds support for setting SHELL_PATH and PERL_PATH to
autoconf generated ./configure script via --with-shell=PATH and
--with-perl=PATH options.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
configure.ac

index c1f7751e6f8af39e812fb14963174ef8cb83d29f..1669e40e26ddf0f86f5b62e9ba3c0d53cb49748b 100644 (file)
@@ -19,17 +19,47 @@ echo "# ${config_append}.  Generated by configure." > "${config_append}"
 # Append LINE to file ${config_append}
 AC_DEFUN([GIT_CONF_APPEND_LINE],
 [echo "$1" >> "${config_append}"])# GIT_CONF_APPEND_LINE
+#
+# GIT_ARG_SET_PATH(PROGRAM)
+# -------------------------
+# Provide --with-PROGRAM=PATH option to set PATH to PROGRAM
+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_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)
+AC_DEFUN([GIT_CONF_APPEND_PATH],
+[PROGRAM=m4_toupper($1); \
+if test "$withval" = "no"; then \
+       AC_MSG_WARN([You cannot use git without $1]); \
+else \
+       if test "$withval" = "yes"; then \
+               AC_MSG_WARN([You should provide path for --with-$1=PATH]); \
+       else \
+               GIT_CONF_APPEND_LINE(${PROGRAM}_PATH=$withval); \
+       fi; \
+fi; \
+]) # GIT_CONF_APPEND_PATH
 
 
 ## Checks for programs.
 AC_MSG_NOTICE([CHECKS for programs])
 #
+GIT_ARG_SET_PATH(shell)
+GIT_ARG_SET_PATH(perl)
+#
+# Define NO_PYTHON if you want to lose all benefits of the recursive merge.
+# Define PYTHON_PATH to provide path to Python.
 AC_PROG_CC
 #AC_PROG_INSTALL               # needs install-sh or install.sh in sources
 AC_CHECK_TOOL(AR, ar, :)
 AC_CHECK_PROGS(TAR, [gtar tar])
-#
-# Define NO_PYTHON if you want to lose all benefits of the recursive merge.
 
 
 ## Checks for libraries.
@@ -127,6 +157,7 @@ AC_CHECK_FUNC(setenv,[],
 
 ## Site configuration
 ## --with-PACKAGE[=ARG] and --without-PACKAGE
+#
 # Define NO_SVN_TESTS if you want to skip time-consuming SVN interopability
 # tests.  These tests take up a significant amount of the total test time
 # but are not needed unless you plan to talk to SVN repos.