git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefano Lattarini <stefano.lattarini@gmail.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com
Subject: [PATCH 5/7] autoconf: use AC_CONFIG_COMMANDS instead of ad-hoc 'config.mak.append'
Date: Thu, 19 Jul 2012 00:35:00 +0200	[thread overview]
Message-ID: <ab3ac81e8e3d40a18390b5be4915a0f3ee24a73e.1342649928.git.stefano.lattarini@gmail.com> (raw)
In-Reply-To: <cover.1342649928.git.stefano.lattarini@gmail.com>
In-Reply-To: <cover.1342649928.git.stefano.lattarini@gmail.com>

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>
---
 configure.ac | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/configure.ac b/configure.ac
index 5fb9734..64eecbc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7,7 +7,21 @@
 # --------------------------
 # Append LINE to file ${config_append}
 AC_DEFUN([GIT_CONF_SUBST],
-         [echo "$1=$2" >> "${config_append}"])
+   [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 +147,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 +1052,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}"
-- 
1.7.10.2.1067.g553d16e

  parent reply	other threads:[~2012-07-18 22:35 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-18 22:34 [PATCH 0/7] build system: support automatic reconfiguration for autotools user Stefano Lattarini
2012-07-18 22:34 ` [PATCH 1/7] autoconf: GIT_CONF_APPEND_LINE: change signature Stefano Lattarini
2012-07-18 22:34 ` [PATCH 2/7] autoconf: GIT_CONF_APPEND_LINE -> GIT_CONF_SUBST Stefano Lattarini
2012-07-19  0:13   ` Junio C Hamano
2012-07-19  7:32     ` Stefano Lattarini
2012-07-18 22:34 ` [PATCH 3/7] autoconf: remove some redundant shell indirections Stefano Lattarini
2012-07-19  0:29   ` Junio C Hamano
2012-07-19  7:30     ` Stefano Lattarini
2012-07-19 17:24       ` Junio C Hamano
2012-07-19 17:50         ` Stefano Lattarini
2012-07-18 22:34 ` [PATCH 4/7] autoconf: remove few redundant semicolons Stefano Lattarini
2012-07-18 22:35 ` Stefano Lattarini [this message]
2012-07-18 22:35 ` [PATCH 6/7] build: "make clean" should not remove configure-generated files Stefano Lattarini
2012-07-19  6:56   ` Matthieu Moy
2012-07-19  7:30     ` Stefano Lattarini
2012-07-19  7:43       ` Matthieu Moy
2012-07-19  7:59         ` Stefano Lattarini
2012-07-19 17:27       ` Junio C Hamano
2012-07-18 22:35 ` [PATCH 7/7] build: reconfigure automatically if configure.ac changes Stefano Lattarini
2012-07-19  0:36 ` [PATCH 0/7] build system: support automatic reconfiguration for autotools user Junio C Hamano
2012-07-19  7:49   ` [PATCH v2 " Stefano Lattarini
2012-07-19  7:49     ` [PATCH v2 1/7] autoconf: GIT_CONF_APPEND_LINE: change signature Stefano Lattarini
2012-07-19  7:49     ` [PATCH v2 2/7] autoconf: GIT_CONF_APPEND_LINE -> GIT_CONF_SUBST Stefano Lattarini
2012-07-19  7:49     ` [PATCH v2 3/7] autoconf: remove some redundant shell indirections Stefano Lattarini
2012-07-19  7:49     ` [PATCH v2 4/7] autoconf: remove few redundant semicolons Stefano Lattarini
2012-07-19  7:50     ` [PATCH v2 5/7] autoconf: use AC_CONFIG_COMMANDS instead of ad-hoc 'config.mak.append' Stefano Lattarini
2012-07-19  7:50     ` [PATCH v2 6/7] build: "make clean" should not remove configure-generated files Stefano Lattarini
2012-07-23 23:15       ` Stefano Lattarini
2012-07-23 23:28         ` Junio C Hamano
2012-07-19  7:50     ` [PATCH v2 7/7] build: reconfigure automatically if configure.ac changes Stefano Lattarini
2012-07-23 23:16       ` Stefano Lattarini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ab3ac81e8e3d40a18390b5be4915a0f3ee24a73e.1342649928.git.stefano.lattarini@gmail.com \
    --to=stefano.lattarini@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).