From 3a1d5202cd7313c32cec26ade8c36a26ed0fef49 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 16 Aug 2009 10:35:56 +0200 Subject: [PATCH] build: enable git-version-gen, automake silent rules, generate ChangeLog * 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 | 3 +++ Makefile.am | 16 ++++++++++++++++ bootstrap.conf | 12 ++++++++++-- configure.ac | 8 ++++++-- m4/.gitignore | 1 + 5 files changed, 36 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index accfd52..785f8a7 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,6 @@ zgrep zless zmore znew +/GNUmakefile +/maint.mk +ChangeLog diff --git a/Makefile.am b/Makefile.am index 6e168ab..1ef6415 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/bootstrap.conf b/bootstrap.conf index f44a1d1..a617bd7 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -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 diff --git a/configure.ac b/configure.ac index d7f16ba..714cc87 100644 --- a/configure.ac +++ b/configure.ac @@ -21,11 +21,15 @@ # 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 diff --git a/m4/.gitignore b/m4/.gitignore index 5fd774b..59a68c6 100644 --- a/m4/.gitignore +++ b/m4/.gitignore @@ -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 -- 2.47.2