Eric Blake wrote:
Automate the reuse of autogen.sh, rather than just erroring out.
* cfg.mk (_update_required): Run autogen.sh, rather than just
warning about it.
(_autogen): New target.
---
> > Hmm, as long as make is smart enough to warn, and now that running
> > ./autogen.sh with no arguments is reliable at maintaining an
> > existing setup, I could even submit a followup patch to have make
> > blindly run ./autogen.sh instead of dying with the error that the
> > user has to run it. Any interest in such a followup?
>
> I have a slight preference for automating it.
>
> The current failure+instructions do serve to tell the user that something
> unusual (and time-consuming) is about to happen, but it's easy
> to print a warning to that effect while automating the job.
This automates it. It took me a while to figure out how to cause the
automation without losing output - the idea in GNUmakefile of using a
$(shell) to do a recursive make is not too good, because stdout is
consumed and the user can't see any progress. But the trick of adding
a dependency on Makefile works nicely, so maybe I should rewrite
GNUmakefile upstream in gnulib to use the same trick.
Yes ;-)
To test the patch, I temporarily added a newline to bootstrap.conf,
then ran 'make' twice; autogen.sh reran only on the first run of the
two. (Of course, reverting the temporary newline caused autogen.sh to
rerun again - you can save yourselves that hassle by saving off
.git-module-status before you test, and restoring it back when you
revert bootstrap.conf back to normal).
...
- $(error gnulib update required; run ./autogen.sh first)
+ $(info INFO: gnulib update required; running ./autogen.sh first)
+Makefile: _autogen
endif
endif
+.PHONY: _autogen
+_autogen:
+ $(srcdir)/autogen.sh
+
# Exempt @...@ uses of these symbols.
_makefile_at_at_check_exceptions = ' && !/(SCHEMA|SYSCONF)DIR/'
Thanks! I like it.
I've confirmed that this works as advertised.