build: enable git-version-gen, automake silent rules, generate ChangeLog
authorJim Meyering <meyering@redhat.com>
Sun, 16 Aug 2009 08:35:56 +0000 (10:35 +0200)
committerJim Meyering <meyering@redhat.com>
Tue, 18 Aug 2009 07:28:05 +0000 (09:28 +0200)
* configure.ac (AC_INIT): Use git-version-gen.
Use AM_SILENT_RULES([yes]).
(AM_INIT_AUTOMAKE): Drop gnits; conflicts with git-version-gen versions.
* bootstrap.conf (gnulib_modules): Use getopt-gnu
Ensure ChangeLog exists, for automake.
rather than obsolete "getopt" module.
Add gitlog-to-changelog.
Add git-version-gen.
Add gnu-make, gnumakefile and maintainer-makefile.
* Makefile.am (dist-hook, gen-ChangeLog): New rules, to generate
ChangeLog and insert it into the distribution tarball.
(EXTRA_DIST): Add ChangeLog-2007.

.gitignore
Makefile.am
bootstrap.conf
configure.ac
m4/.gitignore

index accfd52ff88695cb3e6477206c0adfa37dbb83e4..785f8a738a32c3219824c2d0187bc153cee6be54 100644 (file)
@@ -30,3 +30,6 @@ zgrep
 zless
 zmore
 znew
+/GNUmakefile
+/maint.mk
+ChangeLog
index 6e168ab1f0c75fac5e7e6d1b819385005bcd7fc9..1ef6415558d85581a88689d9b08d45a26dbb9bea 100644 (file)
@@ -24,6 +24,7 @@ man_MANS = gunzip.1 gzexe.1 gzip.1 \
   zcat.1 zcmp.1 zdiff.1 zforce.1 zgrep.1 zless.1 zmore.1 znew.1
 
 EXTRA_DIST = $(ACINCLUDE_INPUTS) $(man_MANS) \
+  ChangeLog-2007 \
   algorithm.doc amiga/match.a amiga/Makefile.gcc amiga/Makefile.sasc \
   amiga/tailor.c amiga/utime.h atari/Makefile.st crypt.h \
   gunzip.in gzexe.in gzip.doc gzip.h lzw.h msdos/match.asm msdos/tailor.c \
@@ -61,6 +62,21 @@ SUFFIXES = .in
                $(srcdir)/$@.in >$@
        chmod a+x $@
 
+# Arrange so that .tarball-version appears only in the distribution
+# tarball, and never in a checked-out repository.
+dist-hook: gen-ChangeLog
+       $(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version
+
+gen_start_date = 2008-01-01
+.PHONY: gen-ChangeLog
+gen-ChangeLog:
+       $(AM_V_GEN)if test -d .git; then                                \
+         $(top_srcdir)/build-aux/gitlog-to-changelog                   \
+           --since=$(gen_start_date) > $(distdir)/cl-t;                \
+         rm -f $(distdir)/ChangeLog;                                   \
+         mv $(distdir)/cl-t $(distdir)/ChangeLog;                      \
+       fi
+
 # A simple test, just of gzip -- more of a sanity check than anything else.
 FILES_TO_CHECK = $(bin_SCRIPTS) $(gzip_LDADD) \
   $(top_srcdir)/ChangeLog $(top_srcdir)/configure $(top_srcdir)/gzip.c
index f44a1d17066aab580d3dc9919a51762dae45253f..a617bd7c1b1967041995aadfe86f6c899083f263 100644 (file)
@@ -1,6 +1,6 @@
 # Bootstrap configuration.
 
-# Copyright (C) 2006 Free Software Foundation, Inc.
+# Copyright (C) 2006, 2009 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -26,7 +26,12 @@ gnulib_modules='
        fcntl
        fcntl-safer
        fdl
-       getopt
+       getopt-gnu
+       git-version-gen
+       gitlog-to-changelog
+       gnu-make
+       gnumakefile
+       maintainer-makefile
        stat-time
        sys_stat
        time
@@ -44,3 +49,6 @@ gnulib_tool_option_extras="\
 
 # Create build-aux, since 'bootstrap' won't do that for us.
 mkdir -p build-aux
+
+# Automake requires that ChangeLog exist.
+touch ChangeLog
index d7f16baf2c5d966cd054f8479ab4bda5505aeeca..714cc876c060e85abefe21b597b2e349100dad50 100644 (file)
 # 02111-1307, USA.
 
 AC_PREREQ([2.60])
-AC_INIT([gzip], [1.3.12], [bug-gzip@gnu.org])
+AC_INIT([gzip],
+       m4_esyscmd([build-aux/git-version-gen .tarball-version]),
+       [bug-gzip@gnu.org])
+
 AC_CONFIG_SRCDIR(gzip.c)
 AC_CONFIG_AUX_DIR(build-aux)
 AC_CONFIG_HEADERS([lib/config.h:lib/config.hin])
-AM_INIT_AUTOMAKE([gnits])
+AM_INIT_AUTOMAKE
+AM_SILENT_RULES([yes]) # make --enable-silent-rules the default.
 
 AC_PROG_CC_STDC
 AM_PROG_CC_C_O
index 5fd774bcbeba1078ba049bc9b4f22324d715d85f..59a68c6f7f318952ac74b4b3ad76a5af4d63c536 100644 (file)
@@ -6,6 +6,7 @@ extensions.m4
 fcntl-safer.m4
 fcntl_h.m4
 getopt.m4
+gnu-make.m4
 gnulib-cache.m4
 gnulib-common.m4
 gnulib-comp.m4