build: reconfigure automatically if configure.ac changes
This provides a reduced but still useful sibling of the Automake's "automatic Makefile rebuild" feature. It's important to note that we take care to enable the new rules only if the tree that has already be configured with './configure', so that users relying on manual configuration won't be negatively impacted. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Stefano Lattarini committed
Jul 19, 2012 at 09:50 UTC
8242ff470f2a34b5c0f193c4010cbf3d9b57f9bd
2 files changed
+14
Makefile
+12
@@ -2158,6 +2158,18 @@ configure: configure.ac GIT-VERSION-FILE
2158
autoconf -o $@ $<+ && \
2159
$(RM) $<+
2160
2161
+ifdef AUTOCONFIGURED
2162
+config.status: configure
2163
+ $(QUIET_GEN)if test -f config.status; then \
2164
+ ./config.status --recheck; \
2165
+ else \
2166
+ ./configure; \
2167
+ fi
2168
+reconfigure config.mak.autogen: config.status
2169
+ $(QUIET_GEN)./config.status
2170
+.PHONY: reconfigure # This is a convenience target.
2171
+endif
2172
+
2173
XDIFF_OBJS += xdiff/xdiffi.o
2174
XDIFF_OBJS += xdiff/xprepare.o
2175
XDIFF_OBJS += xdiff/xutils.o
configure.ac
+2
@@ -148,6 +148,8 @@ AC_CONFIG_SRCDIR([git.c])
148
config_file=config.mak.autogen
149
config_in=config.mak.in
150
151
+GIT_CONF_SUBST([AUTOCONFIGURED], [YesPlease])
152
+
153
# Directories holding "saner" versions of common or POSIX binaries.
154
AC_ARG_WITH([sane-tool-path],
155
[AS_HELP_STRING(