From d79d9e13375c43b8774b193ce725ac6c05b3865e Mon Sep 17 00:00:00 2001 From: Ben Walton Date: Wed, 4 Nov 2009 13:05:59 -0500 Subject: [PATCH 1/2] configure: add macro to set arbitrary make variables Add macro GIT_PARSE_WITH_SET_MAKE_VAR to configure.ac to allow --with style options that set values for variables used during the make process. Arguments are the $name part of --with-$name, the name of the variable to set in the Makefile (config.mak.autogen) and the help text for the option. Signed-off-by: Ben Walton Signed-off-by: Junio C Hamano --- configure.ac | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/configure.ac b/configure.ac index b09b8e446..c48e7135e 100644 --- a/configure.ac +++ b/configure.ac @@ -68,6 +68,26 @@ else \ GIT_CONF_APPEND_LINE(${PACKAGE}DIR=$withval); \ fi \ ])# GIT_PARSE_WITH +# +# GIT_PARSE_WITH_SET_MAKE_VAR(WITHNAME, VAR, HELP_TEXT) +# --------------------- +# Set VAR to the value specied by --with-WITHNAME. +# No verification of arguments is performed, but warnings are issued +# if either 'yes' or 'no' is specified. +# HELP_TEXT is presented when --help is called. +# This is a direct way to allow setting variables in the Makefile. +AC_DEFUN([GIT_PARSE_WITH_SET_MAKE_VAR], +[AC_ARG_WITH([$1], + [AS_HELP_STRING([--with-$1=VALUE], $3)], + if test -n "$withval"; then \ + if test "$withval" = "yes" -o "$withval" = "no"; then \ + AC_MSG_WARN([You likely do not want either 'yes' or 'no' as] + [a value for $1 ($2). Maybe you do...?]); \ + fi; \ + \ + AC_MSG_NOTICE([Setting $2 to $withval]); \ + GIT_CONF_APPEND_LINE($2=$withval); \ + fi)])# GIT_PARSE_WITH_SET_MAKE_VAR dnl dnl GIT_CHECK_FUNC(FUNCTION, IFTRUE, IFFALSE) From 5ca5377da017311a08f625e32c58a0d118e7fda6 Mon Sep 17 00:00:00 2001 From: Ben Walton Date: Wed, 4 Nov 2009 13:06:00 -0500 Subject: [PATCH 2/2] configure: add settings for gitconfig, editor and pager Use the new GIT_PARSE_WITH_SET_MAKE_VAR macro to allow configuration settings for ETC_GITCONFIG, DEFAULT_PAGER and DEFAULT_EDITOR. Signed-off-by: Ben Walton Signed-off-by: Junio C Hamano --- configure.ac | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/configure.ac b/configure.ac index c48e7135e..4625b8672 100644 --- a/configure.ac +++ b/configure.ac @@ -246,6 +246,29 @@ GIT_PARSE_WITH(iconv)) # Define USE_STDEV below if you want git to care about the underlying device # change being considered an inode change from the update-index perspective. +# +# Allow user to set ETC_GITCONFIG variable +GIT_PARSE_WITH_SET_MAKE_VAR(gitconfig, ETC_GITCONFIG, + Use VALUE instead of /etc/gitconfig as the + global git configuration file. + If VALUE is not fully qualified it will be interpretted + as a path relative to the computed prefix at runtime.) + +# +# Allow user to set the default pager +GIT_PARSE_WITH_SET_MAKE_VAR(pager, DEFAULT_PAGER, + Use VALUE as the fall-back pager instead of 'less'. + This is used by things like 'git log' when the user + does not specify a pager to use through alternate + methods. eg: /usr/bin/pager) +# +# Allow user to set the default editor +GIT_PARSE_WITH_SET_MAKE_VAR(editor, DEFAULT_EDITOR, + Use VALUE as the fall-back editor instead of 'vi'. + This is used by things like 'git commit' when the user + does not specify a preferred editor through other + methods. eg: /usr/bin/editor) + # # Define SHELL_PATH to provide path to shell. GIT_ARG_SET_PATH(shell)