Skip to content

Commit

Permalink
build: reconfigure automatically if configure.ac changes
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
slattarini authored and gitster committed Jul 19, 2012
1 parent dc7ace5 commit 8242ff4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2158,6 +2158,18 @@ configure: configure.ac GIT-VERSION-FILE
autoconf -o $@ $<+ && \
$(RM) $<+

ifdef AUTOCONFIGURED
config.status: configure
$(QUIET_GEN)if test -f config.status; then \
./config.status --recheck; \
else \
./configure; \
fi
reconfigure config.mak.autogen: config.status
$(QUIET_GEN)./config.status
.PHONY: reconfigure # This is a convenience target.
endif

XDIFF_OBJS += xdiff/xdiffi.o
XDIFF_OBJS += xdiff/xprepare.o
XDIFF_OBJS += xdiff/xutils.o
Expand Down
2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ AC_CONFIG_SRCDIR([git.c])
config_file=config.mak.autogen
config_in=config.mak.in

GIT_CONF_SUBST([AUTOCONFIGURED], [YesPlease])

# Directories holding "saner" versions of common or POSIX binaries.
AC_ARG_WITH([sane-tool-path],
[AS_HELP_STRING(
Expand Down

0 comments on commit 8242ff4

Please sign in to comment.