git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/2] configure: add function to directly set Makefile variables

From
Ben Walton <bwalton@artsci.utoronto.ca>
Date
Oct 31, 2009, 20:41 UTC
Message-ID
<1257021695-21260-2-git-send-email-bwalton@artsci.utoronto.ca>
In-Reply-To
<1257021695-21260-1-git-send-email-bwalton@artsci.utoronto.ca>

Add function GIT_WITH_MAKE_VAR to provide an easy way to allow user input to directly specify values for variables in the Makefile.

An example use is: GIT_WITH_MAKE_VAR(gitconfig, ETC_GITCONFIG)

This would allow the user to add --with-gitconfig=/etc/mysiteconf to their ./configure command line to add ETC_GITCONFIG=/etc/mysiteconf to the config.mak.autogen file.

Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
---
 configure.ac |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/configure.ac b/configure.ac
index 84b6cf4..2829dbb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -68,6 +68,20 @@ else \
 	GIT_CONF_APPEND_LINE(${PACKAGE}DIR=$withval); \
 fi \
 ])# GIT_PARSE_WITH
+dnl
+dnl GIT_WITH_MAKE_VAR(withname, VAR)
+dnl ---------------------
+dnl Set VAR to the value specied by --with-$withname if --with-$withname
+dnl is specified.  This is a direct way to allow setting variables in the
+dnl Makefile.
+AC_DEFUN([GIT_WITH_MAKE_VAR],
+[AC_ARG_WITH([$1],
+ [AS_HELP_STRING([--with-$1=VALUE],
+		 [provide value for $2])],
+ if test -n "$withval"; then \
+    AC_MSG_NOTICE([Setting $2 to $withval]); \
+    GIT_CONF_APPEND_LINE($2=$withval); \
+ fi)])# GIT_WITH_MAKE_VAR
 
 dnl
 dnl GIT_CHECK_FUNC(FUNCTION, IFTRUE, IFFALSE)
-- 
1.6.5
Previous: Ben WaltonNext: Ben Walton
Message 2 of 15 in “Set Makefile variables from configure”
  1. 0/2 Set Makefile variables from configureBen Walton, Oct 31, 2009
  2. 1/2 configure: add function to directly set Makefile variablesBen Walton, Oct 31, 2009
  3. 2/2 configure: allow user to set gitconfig, pager and editorBen Walton, Oct 31, 2009
  4. Ben WaltonNov 3, 2009
  5. Jonathan NiederNov 3, 2009
  6. Jonathan NiederNov 3, 2009
  7. 0/2 Set Makefile variables from configureBen Walton, Nov 4, 2009
  8. 1/2 configure: add macro to set arbitrary make variablesBen Walton, Nov 4, 2009
  9. 2/2 configure: add settings for gitconfig, editor and pagerBen Walton, Nov 4, 2009
  10. Junio C HamanoNov 4, 2009
  11. Ben WaltonNov 4, 2009
  12. Junio C HamanoNov 4, 2009
  13. Ben WaltonNov 4, 2009
  14. Jonathan NiederNov 4, 2009
  15. Ben WaltonNov 4, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.