[libgdata] build: Use AX_GENERATE_CHANGELOG to generate the changelog



commit 11b72839bf4b54140b14a563fd84dc6ae392d146
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Tue Jul 12 13:37:45 2016 +0100

    build: Use AX_GENERATE_CHANGELOG to generate the changelog
    
    This should fix building the ChangeLog when srcdir ≠ builddir.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=768278

 ChangeLog    |    2 ++
 Makefile.am  |   20 ++------------------
 configure.ac |    1 +
 3 files changed, 5 insertions(+), 18 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..5b589b3
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,2 @@
+This is a placeholder ChangeLog; the real one is generated from `git log` at
+dist time.
diff --git a/Makefile.am b/Makefile.am
index 71f2371..e2ff442 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -856,23 +856,7 @@ EXTRA_DIST += libgdata.pc.in \
        gdata/gdata-version.h.in
 
 # 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 7d642e1..546813d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -29,6 +29,7 @@ AC_PROG_CXX
 AM_PROG_CC_C_O
 LT_INIT([])
 PKG_PROG_PKG_CONFIG
+AX_GENERATE_CHANGELOG
 
 AC_PATH_PROG([GLIB_GENMARSHAL],[glib-genmarshal])
 AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]