From: Eric Blake Date: Tue, 4 Mar 2008 22:26:02 +0000 (-0700) Subject: Pull in recent maintainer improvements from coreutils. X-Git-Tag: v2.62~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6f8e57e72fe10c124fb6af600e23220d36708556;p=thirdparty%2Fautoconf.git Pull in recent maintainer improvements from coreutils. * GNUmakefile (_is-dist-target): 'make distclean' should not trigger autoreconf. (_dummy): Change directories before removing autom4te.cache. (check dist distcheck install) [!_have-Makefile]: Provide nicer diagnostics. * configure.ac (AC_CONFIG_LINKS): Copy GNUmakefile into VPATH builds, after initial bootstrap. * Makefile.am (distclean-local): Work around current automake bug. * Makefile.maint (ME): Allow VPATH usage. Signed-off-by: Eric Blake --- diff --git a/ChangeLog b/ChangeLog index 3ebb0059..2a73baa8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2008-03-04 Eric Blake + Pull in recent maintainer improvements from coreutils. + * GNUmakefile (_is-dist-target): 'make distclean' should not + trigger autoreconf. + (_dummy): Change directories before removing autom4te.cache. + (check dist distcheck install) [!_have-Makefile]: Provide nicer + diagnostics. + * configure.ac (AC_CONFIG_LINKS): Copy GNUmakefile into VPATH + builds, after initial bootstrap. + * Makefile.am (distclean-local): Work around current automake bug. + * Makefile.maint (ME): Allow VPATH usage. + Use git-merge-changelog when available. * .gitattributes: New file. * README-hacking: Document use of git-merge-changelog. diff --git a/GNUmakefile b/GNUmakefile index e6444b68..e22015b8 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -47,15 +47,17 @@ include Makefile # for others: rerunning autoconf and recompiling everything isn't cheap. # Remove the autoreconf-provided INSTALL, so that we regenerate it. ifeq (0,$(MAKELEVEL)) - _is-dist-target = $(filter dist% alpha beta major,$(MAKECMDGOALS)) + _is-dist-target = $(filter-out %clean, \ + $(filter dist% alpha beta major,$(MAKECMDGOALS))) ifneq (,$(_is-dist-target)) _curr-ver := $(shell cd $(srcdir) && ./build-aux/git-version-gen \ $(srcdir)/.tarball-version) ifneq ($(_curr-ver),$(VERSION)) $(info INFO: running autoreconf for new version string: $(_curr-ver)) _dummy := $(shell \ - rm -rf autom4te.cache; \ - (cd $(srcdir) && autoreconf -i -v) \ + cd $(srcdir) \ + && rm -rf autom4te.cache \ + && autoreconf -i -v \ && rm -f INSTALL) endif endif @@ -71,6 +73,8 @@ all: @echo "You must run ./configure before running \`make'." 1>&2 @exit 1 +check dist distcheck install: all + endif # Tell version 3.79 and up of GNU make to not build goals in this diff --git a/Makefile.am b/Makefile.am index fb086518..57e75094 100644 --- a/Makefile.am +++ b/Makefile.am @@ -92,3 +92,8 @@ autom4te-update: # never in a checked-out repository. dist-hook: echo $(VERSION) > $(distdir)/.tarball-version + +# Arrange to remove the symlink to GNUmakefile in VPATH builds. +# TODO remove this once automake vs. AC_CONFIG_LINKS issue is fixed. +distclean-local: + if test x"$(VPATH)" != x ; then rm -f GNUmakefile ; fi diff --git a/Makefile.maint b/Makefile.maint index 3a4fe7a0..71bb6b22 100644 --- a/Makefile.maint +++ b/Makefile.maint @@ -2,7 +2,7 @@ # This Makefile fragment is shared between the coreutils, # CPPI, Bison, and Autoconf. -# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Free Software +# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2008 Free Software # Foundation, Inc. # # This program is free software: you can redistribute it and/or modify @@ -20,7 +20,7 @@ # This is reported not to work with make-3.79.1 # ME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) -ME := Makefile.maint +ME := $(srcdir)/Makefile.maint # Do not save the original name or timestamp in the .tar.gz file. # Use --rsyncable if available. @@ -391,8 +391,8 @@ writable-files: mkdir $(release_archive_dir); \ fi for file in $(distdir).tar.gz $(xd-delta) \ - $(release_archive_dir)/$(distdir).tar.gz \ - $(release_archive_dir)/$(xd-delta); do \ + $(release_archive_dir)/$(distdir).tar.gz \ + $(release_archive_dir)/$(xd-delta); do \ test -e $$file || continue; \ test -w $$file \ || { echo ERROR: $$file is not writable; fail=1; }; \ diff --git a/configure.ac b/configure.ac index 99ba100c..13e48ab7 100644 --- a/configure.ac +++ b/configure.ac @@ -152,6 +152,20 @@ AC_PROG_SED ## Conclusion. ## ## ------------ ## +dnl Allow maintainer rules under GNU make even in VPATH builds. This does +dnl not work in autoconf 2.61 or earlier, but we don't want to require +dnl unreleased autoconf during bootstrap, hence the version test. +dnl TODO remove the version check once we depend on autoconf 2.62. +dnl Meanwhile, we must use a shell variable so that we bypass automake's +dnl attempts to remove the sole copy of GNUmakefile in a non-VPATH build +dnl during 'make distclean'. +dnl TODO avoid the shell variable once automake is fixed. +GNUmakefile=GNUmakefile +m4_if(m4_version_compare([2.61a.100], + m4_defn([m4_PACKAGE_VERSION])), [1], [], + [AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [], + [GNUmakefile=$GNUmakefile])]) + AC_CONFIG_FILES([Makefile doc/Makefile lib/Makefile lib/Autom4te/Makefile lib/autoscan/Makefile lib/m4sugar/Makefile