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

Re: Makefile dependency from 'configure' to 'GIT-VERSION-FILE'

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Jan 2, 2013, 07:21 UTC
Message-ID
<20130102072141.GB18974@elie.Belkin>
In-Reply-To
<CANiSa6jt7_ixi7L6U9sfpV2mvT_7zgYV+m+sLiXjkDsFehAuwA@mail.gmail.com>
Hi Martin,
Martin von Zweigbergk wrote:
Show 5 quoted lines
> I use autoconf with git.git. I have noticed lately, especially when
> doing things like "git rebase -i --exec make", that ./configure is run
> every time. If I understand correctly, this is because of 8242ff4
> (build: reconfigure automatically if configure.ac changes,
> 2012-07-19).
How about this patch (untested)?
-- >8 --
Subject: build: do not automatically reconfigure unless configure.ac changed

Starting with v1.7.12-rc0~4^2 (build: reconfigure automatically if configure.ac changes, 2012-07-19), "config.status --recheck" is automatically run every time the "configure" script changes. In particular, that means the configuration procedure repeats whenever the version number changes (since the configure script changes to support "./configure --version" and "./configure --help"), making bisecting painfully slow.

The intent was to make the reconfiguration process only trigger for changes to configure.ac's logic. Tweak the Makefile rule to match that intent by depending on configure.ac instead of configure.

Reported-by: Martin von Zweigbergk <martinvonz@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
[...]
Show 8 quoted lines
> --- a/Makefile
> +++ b/Makefile
> @@ -2267,12 +2267,9 @@ $(patsubst %.py,%,$(SCRIPT_PYTHON)): % : unimplemented.sh
>         mv $@+ $@
>  endif # NO_PYTHON
> 
> -configure: configure.ac GIT-VERSION-FILE
> +configure: configure.ac
[...]
Show 11 quoted lines
> --- a/configure.ac
> +++ b/configure.ac
> @@ -142,7 +142,10 @@ fi
>  ## Configure body starts here.
> 
>  AC_PREREQ(2.59)
> -AC_INIT([git], [@@GIT_VERSION@@], [git@vger.kernel.org])
> +AC_INIT([git],
> +       m4_esyscmd([ ./GIT-VERSION-GEN &&
> +                    { sed -ne 's/GIT_VERSION = //p' GIT-VERSION-FILE | xargs echo -n; } ]),
> +       [git@vger.kernel.org])

I don't think that would warrant dropping the GIT-VERSION-FILE dependency, since the resulting configure script still hard-codes the version number.

Sane?
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 736ecd45..2a22041f 100644
--- a/Makefile
+++ b/Makefile
@@ -2275,7 +2275,7 @@ configure: configure.ac GIT-VERSION-FILE
 	$(RM) $<+
 
 ifdef AUTOCONFIGURED
-config.status: configure
+config.status: configure.ac
 	$(QUIET_GEN)if test -f config.status; then \
 	  ./config.status --recheck; \
 	else \
-- 
1.8.1
Previous: Martin von ZweigbergkNext: Martin von Zweigbergk
Message 2 of 13 in “Makefile dependency from 'configure' to 'GIT-VERSION-FILE'”
  1. Martin von ZweigbergkJan 2, 2013
  2. Jonathan NiederJan 2, 2013
  3. Martin von ZweigbergkJan 2, 2013
  4. build: do not automatically reconfigure unless configure.ac changedJonathan Nieder, Jan 2, 2013
  5. Jeff KingJan 2, 2013
  6. Jonathan NiederJan 2, 2013
  7. Stefano LattariniJan 2, 2013
  8. Junio C HamanoJan 2, 2013
  9. Martin von ZweigbergkJan 2, 2013
  10. Stefano LattariniJan 2, 2013
  11. Junio C HamanoJan 2, 2013
  12. Stefano LattariniJan 2, 2013
  13. Jonathan NiederJan 2, 2013

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.