]> git.ipfire.org Git - thirdparty/autoconf.git/commit
autoheader: preserve hand-written template files master
authorZack Weinberg <zack@owlfolio.org>
Tue, 24 Feb 2026 21:00:03 +0000 (16:00 -0500)
committerZack Weinberg <zack@owlfolio.org>
Tue, 24 Feb 2026 21:10:47 +0000 (16:10 -0500)
commitdaea200ec4fabb4a0918b72129db70229da9abd7
treee9f2960de72c1550b1094788aba3f007dec8f4b1
parentc5c5109b24ef8add52e7855c753f6677028ef5d3
autoheader: preserve hand-written template files

Consistent with the existing behavior of autoreconf regarding
hand-maintained aclocal.m4, make both autoheader and autoreconf
check for the /* Generated from configure.ac by autoheader */
line that autoheader emits at the beginning of its generated
configuration header templates.  If the file exists but the
marker line is not there, they will now leave the file alone
unless given the new command line option --replace-handwritten.

Fixes <https://savannah.gnu.org/support/index.php?111388>.

I’m looking for feedback regarding whether the new option should
also cause autoreconf to clobber a hand-written aclocal.m4, or any
other files that _could_ be generated but aren’t always.  (aclocal.m4
in particular may need coordination with Automake, since the ‘aclocal’
tool belongs to them.)

* bin/autoheader.in: Add option --replace-handwritten.  If the
  primary template file already exists and doesn’t begin with a
  marker comment indicating it was generated by autoheader, don’t
  modify it unless --replace-handwritten was given.
* bin/autoreconf.in: Similarly.
* doc/autoconf.texi: Document new option for autoheader and
  autoreconf.
* tests/tools.at: Test new behavior.
NEWS
bin/autoheader.in
bin/autoreconf.in
doc/autoconf.texi
tests/tools.at