summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorLibravatar Stefano Lattarini <stefano.lattarini@gmail.com>2012-07-19 09:50:00 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2012-07-19 10:30:26 -0700
commitac5fc1c57f2a964e1b5480a25b6fd447ab18b9b9 (patch)
tree7e817d60ebce2a6a412561ab00ccf422c609c1cb /configure.ac
parentautoconf: remove few redundant semicolons (diff)
downloadtgif-ac5fc1c57f2a964e1b5480a25b6fd447ab18b9b9.tar.xz
autoconf: use AC_CONFIG_COMMANDS instead of ad-hoc 'config.mak.append'
This will allow "./config.status --recheck; ./config.status" to work correctly as a mean of reconfiguring the tree with the same configure argument used in the previous "./configure" invocation. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac28
1 files changed, 17 insertions, 11 deletions
diff --git a/configure.ac b/configure.ac
index b453ba5eb9..a63fe77b82 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,9 +5,22 @@
# GIT_CONF_SUBST(VAL, VAR)
# ------------------------
-# Append the line "VAR=VAL" to file ${config_append}
-AC_DEFUN([GIT_CONF_APPEND_LINE],
- [echo "$1=$2" >> "${config_append}"])
+# 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"])
+
+# GIT_CONF_SUBST_INIT
+# -------------------
+# Prepare shell variables and autoconf machine required by later calls
+# to GIT_CONF_SUBST.
+AC_DEFUN([GIT_CONF_SUBST_INIT],
+ [config_appended_defs=; newline='
+'
+ AC_CONFIG_COMMANDS([$config_file],
+ [echo "$config_appended_defs" >> "$config_file"],
+ [config_file=$config_file
+ config_appended_defs="$config_appended_defs"])])
# GIT_ARG_SET_PATH(PROGRAM)
# -------------------------
@@ -133,11 +146,8 @@ AC_INIT([git], [@@GIT_VERSION@@], [git@vger.kernel.org])
AC_CONFIG_SRCDIR([git.c])
config_file=config.mak.autogen
-config_append=config.mak.append
config_in=config.mak.in
-echo "# ${config_append}. Generated by configure." > "${config_append}"
-
# Directories holding "saner" versions of common or POSIX binaries.
AC_ARG_WITH([sane-tool-path],
[AS_HELP_STRING(
@@ -1041,9 +1051,5 @@ AC_SUBST(PTHREAD_LIBS)
AC_SUBST(NO_PTHREADS)
## Output files
-AC_CONFIG_FILES(["${config_file}":"${config_in}":"${config_append}"])
+AC_CONFIG_FILES(["${config_file}":"${config_in}"])
AC_OUTPUT
-
-
-## Cleanup
-rm -f "${config_append}"