Search code examples
buildconfigureautoconfautomake

Why is `config.status --recheck` being used at all? – because it doesn't *save* anything


I've just run ./config.status --recheck and it didn't take into account the changes that I've made to the configure script – i.e.: Makefiles haven't been regenerated.

This puzzles me… What is the use of this script, then? It automatically detects changes on make so that it then re-runs ./configure with all the options recalled and reused from the disk, but that's all that it does – the result of this operation isn't saved to the disk … What is the use of the I've had detected some changes to the build scripts then?


Solution

  • It automatically detects changes on make so that it then re-runs ./configure with all the options recalled and reused from the disk

    Which seems to be a very good use case.

    If you fixed something in the build system, and want to rebuild, chances are you want to keep all the options passed to configure when you last ran it.

    the result of this operation isn't saved to the disk

    This is not really true. ./config.status --recheck does run configure with the --no-create option, which says to "not create output files", but that's only half-true: It does update the config.status script itself.

    Typically you do not run config.status manually, but it gets invoked automatically by make. And make will then typically also invoke the just updated config.status (without the --recheck flag), which in turn will update your Makefile. And then it will build the project using the updated Makefile.