summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorBen Walton <bwalton@artsci.utoronto.ca>2009-11-04 18:05:59 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-11-04 19:29:46 (GMT)
commitd79d9e13375c43b8774b193ce725ac6c05b3865e (patch)
treef9c2289e14e9eb0dec7a61f5f384d71fb83d2daa /configure.ac
parent8cc62c1677c99c5e204d2b51269b47b7557a79e0 (diff)
downloadgit-d79d9e13375c43b8774b193ce725ac6c05b3865e.zip
git-d79d9e13375c43b8774b193ce725ac6c05b3865e.tar.gz
git-d79d9e13375c43b8774b193ce725ac6c05b3865e.tar.bz2
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 <bwalton@artsci.utoronto.ca> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac20
1 files changed, 20 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index b09b8e4..c48e713 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)