Import the gitlog-to-changelog script from gnulib and add rules to
generate an up-to-date changelog from the git history, if available,
when running 'make dist'.
The ChangeLog is otherwise taken from srcdir as usual, so that
modified versions can be prepared from a release tarball without
requiring the full git history. In this scenario, the ChangeLog
would have to be manually edited.
In case the ChangeLog generation fails, a distcheck-hook is added to
hopefully catch issues before releasing tarballs with a broken
ChangeLog.