Merge branch 'jn/less-reconfigure'
authorJunio C Hamano <gitster@pobox.com>
Mon, 25 Feb 2013 16:27:13 +0000 (08:27 -0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 25 Feb 2013 16:27:13 +0000 (08:27 -0800)
A change made on v1.8.1.x maintenance track had a nasty regression
to break the build when autoconf is used.

* jn/less-reconfigure:
Makefile: avoid infinite loop on configure.ac change

Makefile
index ba8e243425f1d013538fddf9a9552b96812cef4f..7c75e3b1081b2bb5a93245eb960ead6f0b67c3b5 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1821,12 +1821,14 @@ $(patsubst %.py,%,$(SCRIPT_PYTHON)): % : unimplemented.sh
        mv $@+ $@
 endif # NO_PYTHON
 
+CONFIGURE_RECIPE = $(RM) configure configure.ac+ && \
+                  sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
+                       configure.ac >configure.ac+ && \
+                  autoconf -o configure configure.ac+ && \
+                  $(RM) configure.ac+
+
 configure: configure.ac GIT-VERSION-FILE
-       $(QUIET_GEN)$(RM) $@ $<+ && \
-       sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
-           $< > $<+ && \
-       autoconf -o $@ $<+ && \
-       $(RM) $<+
+       $(QUIET_GEN)$(CONFIGURE_RECIPE)
 
 ifdef AUTOCONFIGURED
 # We avoid depending on 'configure' here, because it gets rebuilt
@@ -1835,7 +1837,7 @@ ifdef AUTOCONFIGURED
 # do want to recheck when the platform/environment detection logic
 # changes, hence this depends on configure.ac.
 config.status: configure.ac
-       $(QUIET_GEN)$(MAKE) configure && \
+       $(QUIET_GEN)$(CONFIGURE_RECIPE) && \
        if test -f config.status; then \
          ./config.status --recheck; \
        else \