From 42b2ca997a70cd70604ea6dbdf8aca9bccf00dca Mon Sep 17 00:00:00 2001
From: Philip Withnall <philip.withnall@collabora.co.uk>
Date: Wed, 16 Nov 2016 08:23:33 +0000
Subject: [PATCH] build: Use AX_GENERATE_CHANGELOG to generate ChangeLog

This removes some Makefile.am rules and simplifies the build system a
bit.

Signed-off-by: Philip Withnall <philip.withnall@collabora.co.uk>
Reviewed-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Differential Revision: https://phabricator.apertis.org/D4912
---
 ChangeLog             |  2 ++
 Makefile.am           | 20 ++------------------
 configure.ac          |  1 +
 debian/source/options |  2 +-
 4 files changed, 6 insertions(+), 19 deletions(-)
 create mode 100644 ChangeLog

diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..92bcb9b
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,2 @@
+The ChangeLog is auto-generated when releasing.
+If you are seeing this, use 'git log' for a detailed list of changes.
diff --git a/Makefile.am b/Makefile.am
index 5bae0d8..d4a6c12 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -754,23 +754,7 @@ EXTRA_DIST += \
 	$(NULL)
 
 # ChangeLog
-ChangeLog: $(srcdir)/ChangeLog
-$(srcdir)/ChangeLog:
-	@echo Creating $@
-	@if test -d "$(srcdir)/.git"; then \
-	  (GIT_DIR=$(top_srcdir)/.git ./build-aux/missing --run \
-	   git log --stat) | fmt --split-only > $@.tmp \
-	  && mv -f $@.tmp $@ \
-	  || ($(RM) $@.tmp; \
-	      echo Failed to generate ChangeLog, your ChangeLog may be outdated >&2; \
-	      (test -f $@ || echo git-log is required to generate this file >> $@)); \
-	else \
-	  test -f $@ || \
-	  (echo A git checkout and git-log is required to generate ChangeLog >&2 && \
-	  echo A git checkout and git-log is required to generate this file >> $@); \
-	fi
-.PHONY: $(srcdir)/ChangeLog
-
-MAINTAINERCLEANFILES += ChangeLog
+@GENERATE_CHANGELOG_RULES@
+dist-hook: dist-ChangeLog
 
 -include $(top_srcdir)/git.mk
diff --git a/configure.ac b/configure.ac
index bb64d72..6e511f9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -146,6 +146,7 @@ AX_CODE_COVERAGE
 # General macros
 AX_COMPILER_FLAGS
 AX_VALGRIND_CHECK
+AX_GENERATE_CHANGELOG
 
 GOBJECT_INTROSPECTION_CHECK([0.9.7])
 
diff --git a/debian/source/options b/debian/source/options
index 561f830..1d1cf60 100644
--- a/debian/source/options
+++ b/debian/source/options
@@ -1 +1 @@
-extend-diff-ignore = ^git\.mk$|^\.arcconfig$
+extend-diff-ignore = ^git\.mk$|^\.arcconfig$|^ChangeLog$
-- 
GitLab