diff options
author | Jim Meyering <meyering@redhat.com> | 2008-03-18 22:06:31 +0100 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2008-03-18 22:06:31 +0100 |
commit | 02ba2fb91f395e29f00201163728ad698e57eefc (patch) | |
tree | cb6bd37b42e1dbf1d33babae40717093de6b1a04 | |
parent | a016e88bcdcabe947bfb9dea474df5fbe2081b65 (diff) | |
download | idutils-02ba2fb91f395e29f00201163728ad698e57eefc.tar.gz idutils-02ba2fb91f395e29f00201163728ad698e57eefc.tar.bz2 idutils-02ba2fb91f395e29f00201163728ad698e57eefc.zip |
Update from coreutils.
* GNUmakefile: Likewise.
* Makefile.maint: Likewise.
* configure.ac: Likewise.
-rw-r--r-- | GNUmakefile | 15 | ||||
-rw-r--r-- | Makefile.maint | 113 | ||||
-rw-r--r-- | configure.ac | 14 |
3 files changed, 73 insertions, 69 deletions
diff --git a/GNUmakefile b/GNUmakefile index ff5de94..8bbd6c8 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -40,19 +40,22 @@ export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner include Makefile -_curr-ver := $(VERSION) +# Some projects override e.g., _autoreconf here. +-include $(srcdir)/GNUmakefile.cfg + +_autoreconf ?= autoreconf # Ensure that $(VERSION) is up to date for dist-related targets, but not -# for others: running autoreconf and recompiling everything isn't cheap. +# for others: rerunning autoreconf and recompiling everything isn't cheap. 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)) - _created_version_file = 1 + _dummy := $(shell cd $(srcdir) && rm -rf autom4te.cache && $(_autoreconf))) endif endif endif @@ -67,6 +70,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.maint b/Makefile.maint index ba3c55e..a79b278 100644 --- a/Makefile.maint +++ b/Makefile.maint @@ -30,7 +30,7 @@ GZIP_ENV = '--no-name --best $(gzip_rsyncable)' CVS = cvs GIT = git VC = $(GIT) -VC-tag = git-tag -s -m '$(VERSION)' +VC-tag = git tag -s -m '$(VERSION)' CVS_LIST = build-aux/vc-list-files @@ -38,7 +38,7 @@ CVS_LIST_EXCEPT = \ $(CVS_LIST) | if test -f .x-$@; then grep -vEf .x-$@; else grep -v ChangeLog; fi ifeq ($(origin prev_version_file), undefined) - prev_version_file = .prev-version + prev_version_file = $(srcdir)/.prev-version endif PREV_VERSION := $(shell cat $(prev_version_file)) @@ -56,7 +56,6 @@ endif my_distdir = $(PACKAGE)-$(VERSION) # Old releases are stored here. -# Used for diffs and xdeltas. release_archive_dir ?= ../release # Prevent programs like 'sort' from considering distinct strings to be equal. @@ -69,20 +68,14 @@ export LC_ALL = C ## Sanity checks. ## ## --------------- ## -# FIXME: add a check to prohibit definition in src/*.c of symbols defined -# in system.h. E.g. today I removed from tail.c a useless definition of -# ENOSYS. It was useless because system.h ensures it's defined. - # Collect the names of rules starting with `sc_'. -syntax-check-rules := $(shell sed -n 's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' $(ME)) +syntax-check-rules := $(shell sed -n 's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' \ + $(srcdir)/$(ME)) .PHONY: $(syntax-check-rules) -# Checks that don't require cvs. -# Run `changelog-check' last, as previous test may reveal problems requiring -# new ChangeLog entries. local-checks-available = \ po-check copyright-check m4-check author_mark_check \ - changelog-check patch-check strftime-check $(syntax-check-rules) \ + patch-check strftime-check $(syntax-check-rules) \ makefile_path_separator_check \ makefile-check check-AUTHORS .PHONY: $(local-checks-available) @@ -101,6 +94,13 @@ syntax-check: $(local-check) # exit 1; } || : # FIXME: don't allow `#include .strings\.h' anywhere +sc_avoid_if_before_free: + @$(srcdir)/build-aux/useless-if-before-free \ + $(useless_free_options) \ + $$($(CVS_LIST_EXCEPT)) && \ + { echo '$(ME): found useless "if" before "free" above' 1>&2; \ + exit 1; } || : + sc_cast_of_argument_to_free: @grep -nE '\<free \(\(' $$($(CVS_LIST_EXCEPT)) && \ { echo '$(ME): don'\''t cast free argument' 1>&2; \ @@ -166,41 +166,36 @@ sc_require_config_h: else :; \ fi +# To use this "command" macro, you must first define two shell variables: +# h: the header, enclosed in <> or "" +# re: a regular expression that matches IFF something provided by $h is used. +define _header_without_use + h_esc=`echo "$$h"|sed 's/\./\\./'`; \ + if $(CVS_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \ + files=$$(grep -l '^# *include '"$$h_esc" \ + $$($(CVS_LIST_EXCEPT) | grep '\.c$$')) && \ + grep -LE "$$re" $$files | grep . && \ + { echo "$(ME): the above files include $$h but don't use it" \ + 1>&2; exit 1; } || :; \ + else :; \ + fi +endef + # Prohibit the inclusion of assert.h without an actual use of assert. sc_prohibit_assert_without_use: - @if $(CVS_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \ - files=$$(grep -l '# *include <assert\.h>' \ - $$($(CVS_LIST_EXCEPT) | grep '\.c$$')) && \ - grep -L '\<assert (' $$files \ - | grep . && \ - { echo "$(ME): the above files include <assert.h> but don't use it" \ - 1>&2; exit 1; } || :; \ - else :; \ - fi + @h='<assert.h>' re='\<assert \(' $(_header_without_use) + +# Prohibit the inclusion of getopt.h without an actual use. +sc_prohibit_getopt_without_use: + @h='<getopt.h>' re='\<getopt(_long)? \(' $(_header_without_use) # Don't include quotearg.h unless you use one of its functions. sc_prohibit_quotearg_without_use: - @if $(CVS_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \ - files=$$(grep -l '# *include "quotearg\.h"' \ - $$($(CVS_LIST_EXCEPT) | grep '\.c$$')) && \ - grep -LE '\<quotearg(_[^ ]+)? \(' $$files \ - | grep . && \ - { echo "$(ME): the above files include "quotearg.h" but don't use it" \ - 1>&2; exit 1; } || :; \ - else :; \ - fi + @h='"quotearg.h"' re='\<quotearg(_[^ ]+)? \(' $(_header_without_use) # Don't include quote.h unless you use one of its functions. sc_prohibit_quote_without_use: - @if $(CVS_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \ - files=$$(grep -l '# *include "quote\.h"' \ - $$($(CVS_LIST_EXCEPT) | grep '\.c$$')) && \ - grep -LE '\<quote(_n)? \(' $$files \ - | grep . && \ - { echo "$(ME): the above files include "quote.h" but don't use it" \ - 1>&2; exit 1; } || :; \ - else :; \ - fi + @h='"quote.h"' re='\<quote(_n)? \(' $(_header_without_use) sc_obsolete_symbols: @grep -nE '\<(HAVE''_FCNTL_H|O''_NDELAY)\>' \ @@ -246,7 +241,7 @@ sc_root_tests: @if test -d tests \ && grep check-root tests/Makefile.am>/dev/null 2>&1; then \ t1=sc-root.expected; t2=sc-root.actual; \ - grep -nl '^PRIV_CHECK_ARG=require-root' \ + grep -nl '^require_root_$$' \ $$($(CVS_LIST) tests) |sed s,tests,., |sort > $$t1; \ sed -n 's, cd \([^ ]*\) .*MAKE..check TESTS=\(.*\),./\1/\2,p' \ $(srcdir)/tests/Makefile.am |sort > $$t2; \ @@ -477,16 +472,14 @@ makefile_path_separator_check: # Check that `make alpha' will not fail at the end of the process. writable-files: if test -d $(release_archive_dir); then :; else \ - mkdir $(release_archive_dir); \ + for file in $(distdir).tar.gz \ + $(release_archive_dir)/$(distdir).tar.gz; do \ + test -e $$file || continue; \ + test -w $$file \ + || { echo ERROR: $$file is not writable; fail=1; }; \ + done; \ + test "$$fail" && exit 1 || : fi - for file in $(distdir).tar.gz $(xd-delta) \ - $(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; }; \ - done; \ - test "$$fail" && exit 1 || : v_etc_file = lib/version-etc.c sample-test = tests/sample-test @@ -565,7 +558,7 @@ write_loser = printf '\#!%s\necho $$0: bad path 1>&2; exit 1\n' '$(SHELL)' # Note that "false" itself is a symlink to true, so it too will malfunction. TMPDIR ?= /tmp t=$(TMPDIR)/$(PACKAGE)/test -my-distcheck: $(local-check) $(release_archive_dir)/$(prev-tgz) check +my-distcheck: $(local-check) check -rm -rf $(t) mkdir -p $(t) GZIP=$(GZIP_ENV) $(AMTAR) -C $(t) -zxf $(distdir).tar.gz @@ -616,13 +609,7 @@ rel-check: echo "$(md5) -" > $$md5_tmp; \ md5sum -c $$md5_tmp < $$tarz -prev-tgz = $(PACKAGE)-$(PREV_VERSION).tar.gz - -# FIXME: stop distributing xdelta files in 2008, unless someone speaks up. -# So far, not one person has said they'd miss this. -xd-delta = $(PACKAGE)-$(PREV_VERSION)-$(VERSION).xdelta - -rel-files = $(xd-delta) $(DIST_ARCHIVES) +rel-files = $(DIST_ARCHIVES) gnulib-version = $$(cd $(gnulib_dir) && git describe) @@ -658,9 +645,6 @@ emit_upload_commands: @echo ===================================== @echo ===================================== -$(xd-delta): $(release_archive_dir)/$(prev-tgz) $(distdir).tar.gz - xdelta delta -9 $^ $@ || : - .PHONY: alpha beta major alpha beta major: $(local-check) writable-files test $@ = major \ @@ -668,11 +652,12 @@ alpha beta major: $(local-check) writable-files || { echo "invalid version string: $(VERSION)" 1>&2; exit 1;};}\ || : $(MAKE) vc-dist - $(MAKE) news-date-check changelog-check - $(MAKE) $(xd-delta) + $(MAKE) news-date-check $(MAKE) -s announcement RELEASE_TYPE=$@ > /tmp/announce-$(my_distdir) - ln $(rel-files) $(release_archive_dir) - chmod a-w $(rel-files) + if test -d $(release_archive_dir); then \ + ln $(rel-files) $(release_archive_dir); \ + chmod a-w $(rel-files); \ + fi $(MAKE) -s emit_upload_commands RELEASE_TYPE=$@ echo $(VERSION) > $(prev_version_file) $(VC) commit -m \ diff --git a/configure.ac b/configure.ac index a4fcb35..ac1f85d 100644 --- a/configure.ac +++ b/configure.ac @@ -44,6 +44,20 @@ AC_CHECK_TYPES(ptrdiff_t) AM_GNU_GETTEXT([external], [need-formatstring-macros]) AM_GNU_GETTEXT_VERSION([0.15]) +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 non-maintainers to use unreleased autoconf, hence the version test. +dnl TODO remove the version check once autoconf 2.62 is released. +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([ po/Makefile.in doc/Makefile |