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

[PATCH 1/2] build: improve GIT_CONF_SUBST signature

From
Stefano Lattarini <stefano.lattarini@gmail.com>
Date
Sep 11, 2012, 15:45 UTC
Message-ID
<1be62f9a7bbe728e6422e668d982ddf313d016eb.1347378209.git.stefano.lattarini@gmail.com>
Now, in configure.ac, a call like:
    GIT_CONF_SUBST([FOO])
will be considered equivalent to:
    GIT_CONF_SUBST([FOO], [$FOO])

This is mostly a preparatory refactoring in view of future changes. No semantic change to the generated configure or config.mak.auto is intended.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
---
 configure.ac | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/configure.ac b/configure.ac
index df7e376..450bbe7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7,8 +7,9 @@
 # ------------------------
 # Cause the line "VAR=VAL" to be eventually appended to ${config_file}.
 AC_DEFUN([GIT_CONF_SUBST],
-   [AC_REQUIRE([GIT_CONF_SUBST_INIT])
-   config_appended_defs="$config_appended_defs${newline}$1=$2"])
+[AC_REQUIRE([GIT_CONF_SUBST_INIT])
+config_appended_defs="$config_appended_defs${newline}dnl
+$1=m4_if([$#],[1],[${$1}],[$2])"])
 
 # GIT_CONF_SUBST_INIT
 # -------------------
@@ -179,7 +180,7 @@ AC_ARG_WITH([lib],
   else
 	lib=$withval
 	AC_MSG_NOTICE([Setting lib to '$lib'])
-	GIT_CONF_SUBST([lib], [$withval])
+	GIT_CONF_SUBST([lib])
   fi])
 
 if test -z "$lib"; then
@@ -215,7 +216,7 @@ AC_ARG_ENABLE([jsmin],
 [
   JSMIN=$enableval;
   AC_MSG_NOTICE([Setting JSMIN to '$JSMIN' to enable JavaScript minifying])
-  GIT_CONF_SUBST([JSMIN], [$enableval])
+  GIT_CONF_SUBST([JSMIN])
 ])
 
 # Define option to enable CSS minification
@@ -225,7 +226,7 @@ AC_ARG_ENABLE([cssmin],
 [
   CSSMIN=$enableval;
   AC_MSG_NOTICE([Setting CSSMIN to '$CSSMIN' to enable CSS minifying])
-  GIT_CONF_SUBST([CSSMIN], [$enableval])
+  GIT_CONF_SUBST([CSSMIN])
 ])
 
 ## Site configuration (override autodetection)
@@ -265,8 +266,8 @@ AS_HELP_STRING([],           [ARG can be also prefix for libpcre library and hea
     else
 	USE_LIBPCRE=YesPlease
 	LIBPCREDIR=$withval
-	AC_MSG_NOTICE([Setting LIBPCREDIR to $withval])
-	GIT_CONF_SUBST([LIBPCREDIR], [$withval])
+	AC_MSG_NOTICE([Setting LIBPCREDIR to $LIBPCREDIR])
+	GIT_CONF_SUBST([LIBPCREDIR])
     fi)
 #
 # Define NO_CURL if you do not have curl installed.  git-http-pull and
-- 
1.7.12.317.g1c54b74
Next: Stefano Lattarini
Message 1 of 6 in “build: improve GIT_CONF_SUBST signature”
  1. 1/2 build: improve GIT_CONF_SUBST signatureStefano Lattarini, Sep 11, 2012
  2. 2/2 build: don't duplicate substitution of make variablesStefano Lattarini, Sep 11, 2012
  3. Junio C HamanoSep 11, 2012
  4. Stefano LattariniSep 11, 2012
  5. Junio C HamanoSep 11, 2012
  6. Stefano LattariniSep 11, 2012

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.