Autoconf, that's the thing that spends time making sure that my software can be built on BeOS and A/UX?
These days I just use Rust instead.
Might I suggest “got-restore-mtime” for this, upstream in Debian and Ubuntu already.
Did you really spend hours on this?
Also I think it took quite a while to even realize the mtimes were the issue from an error messages, as I was not very knowledgeable about autoconf / automake.