[libvirt] [PATCH 6/8] Makefile.maint: sync from coreutils

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

 



You can ignore the patch numbering.
There was yet another one adjusting po/POTFILES.in
that I'm not bothering to post.

Probably not worth reviewing.
Some of it is just factorization.
Other bits reflect removal of coreutils-specific things (they're
migrating into coreutils' cfg.mk (was called Makefile.cfg).
On the other hand, a few are introduction of cu-specific bits,
but that are enabled only if certain coreutils-specific files
are present.  This is to make later merges easier.

I've made sure that "make syntax-check" still works.

>From 19d1ea009c2d1235a271915e55eac9e170e3530c Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@xxxxxxxxxx>
Date: Wed, 28 Jan 2009 16:45:18 +0100
Subject: [PATCH 6/8] * Makefile.maint: sync from coreutils

---
 Makefile.maint |  426 +++++++++++++++++++++++++++++++------------------------
 1 files changed, 240 insertions(+), 186 deletions(-)

diff --git a/Makefile.maint b/Makefile.maint
index 204370d..c50d100 100644
--- a/Makefile.maint
+++ b/Makefile.maint
@@ -25,9 +25,7 @@ syntax-check-rules := $(shell sed -n 's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' \
 .PHONY: $(syntax-check-rules)

 local-checks-available = \
-  po-check copyright-check m4-check author_mark_check \
-  patch-check strftime-check $(syntax-check-rules) \
-  makefile_path_separator_check \
+  patch-check $(syntax-check-rules) \
   makefile-check check-AUTHORS
 .PHONY: $(local-checks-available)

@@ -45,6 +43,17 @@ syntax-check: $(local-check)
 #	    exit 1; } || :
 # FIXME: don't allow `#include .strings\.h' anywhere

+# There are many rules below that prohibit constructs in this package.
+# If the offending construct can be matched with a grep-E-style regexp,
+# use this macro.  The shell variables "re" and "msg" must be defined.
+define _prohibit_regexp
+  dummy=; : so we do not need a semicolon before each use		\
+  test "x$$re" != x || { echo '$(ME): re not defined' 1>&2; exit 1; };	\
+  test "x$$msg" != x || { echo '$(ME): msg not defined' 1>&2; exit 1; };\
+  grep -nE "$$re" $$($(VC_LIST_EXCEPT)) &&				\
+    { echo '$(ME): '"$$msg" 1>&2; exit 1; } || :
+endef
+
 sc_avoid_if_before_free:
 	@$(srcdir)/build-aux/useless-if-before-free			\
 		$(useless_free_options)					\
@@ -64,40 +73,29 @@ sc_avoid_write:
 	fi

 sc_cast_of_argument_to_free:
-	@grep -nE '\<free *\( *\(' $$($(VC_LIST_EXCEPT)) &&		\
-	  { echo '$(ME): don'\''t cast free argument' 1>&2;		\
-	    exit 1; } || :
+	@re='\<free *\( *\(' msg='don'\''t cast free argument'		\
+	  $(_prohibit_regexp)

 sc_cast_of_x_alloc_return_value:
-	@grep -nE '\*\) *x(m|c|re)alloc\>' $$($(VC_LIST_EXCEPT)) &&	\
-	  { echo '$(ME): don'\''t cast x*alloc return value' 1>&2;	\
-	    exit 1; } || :
+	@re='\*\) *x(m|c|re)alloc\>'					\
+	msg='don'\''t cast x*alloc return value'			\
+	  $(_prohibit_regexp)

 sc_cast_of_alloca_return_value:
-	@grep -nE '\*\) *alloca\>' $$($(VC_LIST_EXCEPT)) &&		\
-	  { echo '$(ME): don'\''t cast alloca return value' 1>&2;	\
-	    exit 1; } || :
+	@re='\*\) *alloca\>' msg='don'\''t cast alloca return value'	\
+	  $(_prohibit_regexp)

 sc_space_tab:
-	@grep -n '[ ]	' $$($(VC_LIST_EXCEPT)) &&			\
-	  { echo '$(ME): found SPACE-TAB sequence; remove the SPACE'	\
-		1>&2; exit 1; } || :
-
-cvs_keywords = \
-  Author|Date|Header|Id|Name|Locker|Log|RCSfile|Revision|Source|State
-
-sc_prohibit_cvs_keyword:
-	@grep -nE '\$$($(cvs_keywords))\$$' $$($(VC_LIST_EXCEPT)) &&	\
-	  { echo '$(ME): do not use CVS keyword expansion '		\
-		1>&2; exit 1; } || :
+	@re='[ ]	' msg='found SPACE-TAB sequence; remove the SPACE' \
+	  $(_prohibit_regexp)

 # Don't use *scanf or the old ato* functions in `real' code.
 # They provide no error checking mechanism.
 # Instead, use strto* functions.
 sc_prohibit_atoi_atof:
-	@grep -nE '\<([fs]?scanf|ato([filq]|ll))\>' $$($(VC_LIST_EXCEPT)) && \
-	  { echo '$(ME): do not use *scan''f, ato''f, ato''i, ato''l, ato''ll, ato''q, or ss''canf'	\
-		1>&2; exit 1; } || :
+	@re='\<([fs]?scanf|ato([filq]|ll))\>'				\
+	msg='do not use *scan''f, ato''f, ato''i, ato''l, ato''ll or ato''q' \
+	  $(_prohibit_regexp)

 # Use STREQ rather than comparing strcmp == 0, or != 0.
 # Similarly, use STREQLEN or STRPREFIX rather than strncmp.
@@ -110,8 +108,9 @@ sc_prohibit_strcmp:

 # Use virAsprintf rather than a'sprintf since *strp is undefined on error.
 sc_prohibit_asprintf:
-	@grep -nE '\<[a]sprintf\>' $$($(VC_LIST_EXCEPT)) && \
-	  { echo '$(ME): use virAsprintf, not a'sprintf 1>&2; exit 1; } || :
+	@re='\<[a]sprintf\>'						\
+	msg='use virAsprintf, not a'sprintf				\
+	  $(_prohibit_regexp)

 sc_prohibit_nonreentrant:
 	@fail=0 ; \
@@ -227,120 +226,11 @@ sc_changelog:
 	  { echo '$(ME): found unexpected prefix in a ChangeLog' 1>&2;	\
 	    exit 1; } || :

-# Ensure that dd's definition of LONGEST_SYMBOL stays in sync
-# with the strings from the two affected variables.
-dd_c = $(srcdir)/src/dd.c
-sc_dd_max_sym_length:
-ifneq ($(wildcard $(dd_c)),)
-	@len=$$( (sed -n '/conversions\[\] =$$/,/^};/p' $(dd_c);\
-		 sed -n '/flags\[\] =$$/,/^};/p' $(dd_c) )	\
-		|sed -n '/"/s/^[^"]*"\([^"]*\)".*/\1/p'		\
-	      | wc --max-line-length);				\
-	max=$$(sed -n '/^#define LONGEST_SYMBOL /s///p' $(dd_c)	\
-	      |tr -d '"' | wc --max-line-length);		\
-	if test "$$len" = "$$max"; then :; else			\
-	  echo 'dd.c: LONGEST_SYMBOL is not longest' 1>&2;	\
-	  exit 1;						\
-	fi
-endif
-
-# Many m4 macros names once began with `jm_'.
-# On 2004-04-13, they were all changed to start with gl_ instead.
-# Make sure that none are inadvertently reintroduced.
-sc_prohibit_jm_in_m4:
-	@grep -nE 'jm_[A-Z]'						\
-		$$($(VC_LIST) m4 |grep '\.m4$$'; echo /dev/null) &&	\
-	    { echo '$(ME): do not use jm_ in m4 macro names'		\
-	      1>&2; exit 1; } || :
-
-# Ensure that each root-requiring test is run via the "check-root" rule.
-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 '^require_root_$$'					\
-	  $$($(VC_LIST) tests) |sed s,tests/,, |sort > $$t1;		\
-	sed -n '/^root_tests =[	 ]*\\$$/,/[^\]$$/p'			\
-	  $(srcdir)/tests/Makefile.am					\
-	    | sed 's/^  *//;/^root_tests =/d'				\
-	    | tr -s '\012\\' '  ' | fmt -1 | sort > $$t2;		\
-	diff -u $$t1 $$t2 || diff=1;					\
-	rm -f $$t1 $$t2;						\
-	test "$$diff"							\
-	  && { echo 'tests/Makefile.am: missing check-root action'>&2;	\
-	       exit 1; } || :;						\
-	fi
-
-headers_with_interesting_macro_defs = \
-  exit.h	\
-  fcntl_.h	\
-  fnmatch_.h	\
-  intprops.h	\
-  inttypes_.h	\
-  lchown.h	\
-  openat.h	\
-  stat-macros.h	\
-  stdint_.h
-
-# Create a list of regular expressions matching the names
-# of macros that are guaranteed by parts of gnulib to be defined.
-.re-defmac:
-	@(cd $(srcdir)/lib;						\
-	  for f in $(headers_with_interesting_macro_defs); do		\
-	    test -f $$f &&						\
-	      sed -n '/^# *define \([^_ (][^ (]*\)[ (].*/s//\1/p' $$f;	\
-	   done;							\
-	 ) | sort -u							\
-	   | grep -Ev 'ATTRIBUTE_NORETURN|SIZE_MAX'			\
-	   | sed 's/^/^# *define /'					\
-	  > $@-t
-	@mv $@-t $@
-
-# Don't define macros that we already get from gnulib header files.
-sc_always_defined_macros: .re-defmac
-	@if test -f $(srcdir)/src/system.h; then			\
-	  trap 'rc=$$?; rm -f .re-defmac; exit $$rc' 0 1 2 3 15;	\
-	  grep -f .re-defmac $$($(VC_LIST))				\
-	    && { echo '$(ME): define the above via some gnulib .h file'	\
-		  1>&2;  exit 1; } || :;				\
-	fi
-
-# Create a list of regular expressions matching the names
-# of files included from system.h.  Exclude a couple.
-.re-list:
-	@sed -n '/^# *include /s///p' $(srcdir)/src/system.h \
-	  | grep -Ev 'sys/(param|file)\.h' \
-	  | sed 's/ .*//;;s/^["<]/^# *include [<"]/;s/\.h[">]$$/\\.h[">]/' \
-	  > $@-t
-	@mv $@-t $@
-
-# Files in src/ should not include directly any of
-# the headers already included via system.h.
-sc_system_h_headers: .re-list
-	@if test -f $(srcdir)/src/system.h; then			\
-	  trap 'rc=$$?; rm -f .re-list; exit $$rc' 0 1 2 3 15;		\
-	  grep -nE -f .re-list						\
-	      $$($(VC_LIST) src |					\
-		 grep -Ev '((copy|system)\.h|parse-gram\.c)$$')		\
-	    && { echo '$(ME): the above are already included via system.h'\
-		  1>&2;  exit 1; } || :;				\
-	fi
-
-sc_sun_os_names:
-	@grep -nEi \
-	    'solaris[^[:alnum:]]*2\.(7|8|9|[1-9][0-9])|sunos[^[:alnum:]][6-9]' \
-	    $$($(VC_LIST_EXCEPT)) &&					\
-	  { echo '$(ME): found misuse of Sun OS version numbers' 1>&2;	\
-	    exit 1; } || :
-
 sc_the_the:
 	@grep -ni '\<the ''the\>' $$($(VC_LIST_EXCEPT)) &&		\
 	  { echo '$(ME): found use of "the ''the";' 1>&2;		\
 	    exit 1; } || :

-sc_tight_scope:
-	$(MAKE) -C src $@
-
 sc_trailing_blank:
 	@grep -n '[	 ]$$' $$($(VC_LIST_EXCEPT)) &&			\
 	  { echo '$(ME): found trailing blank(s)'			\
@@ -374,7 +264,7 @@ sc_two_space_separator_in_usage:
 	@grep -nE '^   *(-[A-Za-z],)? $(longopt_re) [^ ].*\\$$'		\
 	    $$($(VC_LIST_EXCEPT)) &&					\
 	  { echo "$(ME): help2man requires at least two spaces between"; \
-	    echo "$(ME): an option and its description"; \
+	    echo "$(ME): an option and its description";		\
 		1>&2; exit 1; } || :

 # Many of the function names below came from this filter:
@@ -460,15 +350,16 @@ sc_unmarked_diagnostics:
 	    exit 1; } || :

 sc_prohibit_virBufferAdd_with_string_literal:
-	@grep -nE '\<virBufferAdd *\([^,]+, *"[^"]' $$($(VC_LIST_EXCEPT)) && \
-	  { echo '$(ME): use virBufferAddLit, not virBufferAdd,' \
-	      'with a string literal' 1>&2; exit 1; } || :
+	@re='\<virBufferAdd *\([^,]+, *"[^"]'				\
+	msg='use virBufferAddLit, not virBufferAdd, with a string literal' \
+	  $(_prohibit_regexp)

 # Not only do they fail to deal well with ipv6, but the gethostby*
 # functions are also not thread-safe.
 sc_prohibit_gethostby:
-	@grep -nE '\<gethostby(addr|name2?) *\(' $$($(VC_LIST_EXCEPT)) && \
-	  { echo '$(ME): use getaddrinfo, not gethostby*' 1>&2; exit 1; } || :
+	@re='\<gethostby(addr|name2?) *\('				\
+	msg='use getaddrinfo, not gethostby*'				\
+	  $(_prohibit_regexp)

 # Avoid useless parentheses like those in this example:
 # #if defined (SYMBOL) || defined (SYM2)
@@ -482,6 +373,77 @@ sc_GPL_version:
 	@grep -n 'either ''version [^3]' $$($(VC_LIST_EXCEPT)) &&	\
 	  { echo '$(ME): GPL vN, N!=3' 1>&2; exit 1; } || :

+cvs_keywords = \
+  Author|Date|Header|Id|Name|Locker|Log|RCSfile|Revision|Source|State
+
+sc_prohibit_cvs_keyword:
+	@re='\$$($(cvs_keywords))\$$'					\
+	    msg='do not use CVS keyword expansion'			\
+	  $(_prohibit_regexp)
+
+# Make sure we don't use st_blocks.  Use ST_NBLOCKS instead.
+# This is a bit of a kludge, since it prevents use of the string
+# even in comments, but for now it does the job with no false positives.
+sc_prohibit_stat_st_blocks:
+	@re='[.>]st_blocks' msg='do not use st_blocks; use ST_NBLOCKS'	\
+	  $(_prohibit_regexp)
+
+# Make sure we don't define any S_IS* macros in src/*.c files.
+# They're already defined via gnulib's sys/stat.h replacement.
+sc_prohibit_S_IS_definition:
+	@re='^ *# *define  *S_IS'					\
+	msg='do not define S_IS* macros; include <sys/stat.h>'		\
+	  $(_prohibit_regexp)
+
+# Each program that uses proper_name_utf8 must link with
+# one of the ICONV libraries.
+sc_proper_name_utf8_requires_ICONV:
+	@progs=$$(grep -l 'proper_name_utf8 ''("' $$($(VC_LIST_EXCEPT)));\
+	if test "x$$progs" != x; then					\
+	  fail=0;							\
+	  for p in $$progs; do						\
+	    dir=$$(dirname "$$p");					\
+	    base=$$(basename "$$p" .c);					\
+	    grep "$${base}_LDADD.*ICONV)" $$dir/Makefile.am > /dev/null	\
+	      || { fail=1; echo 1>&2 "$(ME): $$p uses proper_name_utf8"; }; \
+	  done;								\
+	  test $$fail = 1 &&						\
+	    { echo 1>&2 '$(ME): the above do not link with any ICONV library'; \
+	      exit 1; } || :;						\
+	fi
+
+# Warn about "c0nst struct Foo const foo[]",
+# but not about "char const *const foo" or "#define const const".
+sc_redundant_const:
+	@grep -E '\bconst\b[[:space:][:alnum:]]{2,}\bconst\b'		\
+		$$($(VC_LIST_EXCEPT)) &&				\
+	    { echo 1>&2 '$(ME): redundant "const" in declarations';	\
+	      exit 1; } || :
+
+sc_const_long_option:
+	@grep '^ *static.*struct option ' $$($(VC_LIST_EXCEPT))		\
+	  | grep -Ev 'const struct option|struct option const' && {	\
+	      echo 1>&2 '$(ME): add "const" to the above declarations'; \
+	      exit 1; } || :
+
+NEWS_hash = \
+  $$(sed -n '/^\*.* $(PREV_VERSION_REGEXP) ([0-9-]*)/,$$p' \
+     $(srcdir)/NEWS | md5sum -)
+
+# Ensure that we don't accidentally insert an entry into an old NEWS block.
+sc_immutable_NEWS:
+	@if test -f $(srcdir)/NEWS; then				\
+	  test "$(NEWS_hash)" = '$(old_NEWS_hash)' && : ||		\
+	    { echo '$(ME): you have modified old NEWS' 1>&2; exit 1; };	\
+	fi
+
+# Update the hash stored above.  Do this after each release and
+# for any corrections to old entries.
+update-NEWS-hash: NEWS
+	perl -pi -e 's/^(old_NEWS_hash = ).*/$${1}'"$(NEWS_hash)/" \
+	  $(srcdir)/cfg.mk
+
+epoch_date = 1970-01-01 00:00:00.000000000 +0000
 # Ensure that the c99-to-c89 patch applies cleanly.
 patch-check:
 	rm -rf src-c89 $@.1 $@.2
@@ -507,21 +469,6 @@ patch-check:
 	test "$$msg" = ok && rm -rf src-c89 $@.1 $@.2 || echo "$$msg" 1>&2; \
 	test "$$msg" = ok

-# Ensure that date's --help output stays in sync with the info
-# documentation for GNU strftime.  The only exception is %N,
-# which date accepts but GNU strftime does not.
-extract_char = sed 's/^[^%][^%]*%\(.\).*/\1/'
-strftime-check:
-	@if test -f $(srcdir)/src/date.c; then				\
-	  grep '^  %.  ' $(srcdir)/src/date.c | sort			\
-	    | $(extract_char) > $@-src;					\
-	  { echo N;							\
-	    info libc date calendar format | grep '^    `%.'\'		\
-	      | $(extract_char); } | sort > $@-info;			\
-	  diff -u $@-src $@-info || exit 1;				\
-	  rm -f $@-src $@-info;						\
-	fi
-
 check-AUTHORS:
 	$(MAKE) -C src $@

@@ -551,9 +498,10 @@ changelog-check:
 	  exit 1;							\
 	fi

-m4-check:
-	@grep -n 'AC_DEFUN([^[]' $(srcdir)/m4/*.m4 \
-	  && { echo '$(ME): quote the first arg to AC_DEFUN' 1>&2; \
+sc_m4_quote_check:
+	@grep -nE '(AC_DEFINE(_UNQUOTED)?|AC_DEFUN)\([^[]'		\
+	    $$($(VC_LIST_EXCEPT) | grep -E '(^configure\.ac|\.m4)$$')	\
+	  && { echo '$(ME): quote the first arg to AC_DEF*' 1>&2;	\
 	       exit 1; } || :

 fix_po_file_diag = \
@@ -562,7 +510,7 @@ apply the above patch\n'

 # Verify that all source files using _() are listed in po/POTFILES.in.
 po_file = po/POTFILES.in
-po-check:
+sc_po_check:
 	@if test -f $(po_file); then					\
 	  grep -E -v '^(#|$$)' $(po_file)				\
 	    | grep -v '^src/false\.c$$' | sort > $@-1;			\
@@ -587,14 +535,6 @@ po-check:
 	  rm -f $@-1 $@-2;						\
 	fi

-# In a definition of #define AUTHORS "... and ..." where the RHS contains
-# the English word `and', the string must be marked with `N_ (...)' so that
-# gettext recognizes it as a string requiring translation.
-author_mark_check:
-	@grep -n '^# *define AUTHORS "[^"]* and ' src/*.c |grep -v ' N_ (' && \
-	  { echo '$(ME): enclose the above strings in N_ (...)' 1>&2; \
-	    exit 1; } || :
-
 # Sometimes it is useful to change the PATH environment variable
 # in Makefiles.  When doing so, it's better not to use the Unix-centric
 # path separator of `:', but rather the automake-provided `@PATH_SEPARATOR@'.
@@ -602,7 +542,7 @@ author_mark_check:
 # and there probably aren't many projects with so many Makefile.am files
 # that we'd have to worry about limits on command line length.
 msg = '$(ME): Do not use `:'\'' above; use @PATH_SEPARATOR@ instead'
-makefile_path_separator_check:
+sc_makefile_path_separator_check:
 	@grep -n 'PATH=.*:' `find $(srcdir) -name Makefile.am` \
 	  && { echo $(msg) 1>&2; exit 1; } || :

@@ -623,24 +563,24 @@ sample-test = tests/sample-test
 texi = doc/$(PACKAGE).texi
 # Make sure that the copyright date in $(v_etc_file) is up to date.
 # Do the same for the $(sample-test) and the main doc/.texi file.
-copyright-check:
-	@if test -f $(v_etc_file); then \
+sc_copyright_check:
+	@if test -f $(v_etc_file); then					\
 	  grep 'enum { COPYRIGHT_YEAR = '$$(date +%Y)' };' $(v_etc_file) \
-	    >/dev/null \
+	    >/dev/null							\
 	  || { echo 'out of date copyright in $(v_etc_file); update it' 1>&2; \
-	       exit 1; }; \
+	       exit 1; };						\
 	fi
-	@if test -f $(sample-test); then \
-	  grep '# Copyright (C) '$$(date +%Y)' Free' $(sample-test) \
-	    >/dev/null \
+	@if test -f $(sample-test); then				\
+	  grep '# Copyright (C) '$$(date +%Y)' Free' $(sample-test)	\
+	    >/dev/null							\
 	  || { echo 'out of date copyright in $(sample-test); update it' 1>&2; \
-	       exit 1; }; \
+	       exit 1; };						\
 	fi
-	@if test -f $(texi); then \
-	  grep 'Copyright @copyright{} .*'$$(date +%Y)' Free' $(texi) \
-	    >/dev/null \
-	  || { echo 'out of date copyright in $(texi); update it' 1>&2; \
-	       exit 1; }; \
+	@if test -f $(texi); then					\
+	  grep 'Copyright @copyright{} .*'$$(date +%Y)' Free' $(texi)	\
+	    >/dev/null							\
+	  || { echo 'out of date copyright in $(texi); update it' 1>&2;	\
+	       exit 1; };						\
 	fi

 vc-diff-check:
@@ -659,6 +599,119 @@ maintainer-distcheck:
 	$(MAKE) distcheck
 	$(MAKE) my-distcheck

+
+# Don't make a distribution if checks fail.
+# Also, make sure the NEWS file is up-to-date.
+vc-dist: $(local-check) cvs-check maintainer-distcheck
+	$(MAKE) dist
+
+# Use this to make sure we don't run these programs when building
+# from a virgin tgz file, below.
+null_AM_MAKEFLAGS = \
+  ACLOCAL=false \
+  AUTOCONF=false \
+  AUTOMAKE=false \
+  AUTOHEADER=false \
+  MAKEINFO=false
+
+built_programs = $$(cd src && MAKEFLAGS= $(MAKE) -s built_programs.list)
+
+warn_cflags = -Dlint -O -Werror -Wall -Wformat -Wshadow -Wpointer-arith
+bin=bin-$$$$
+
+write_loser = printf '\#!%s\necho $$0: bad path 1>&2; exit 1\n' '$(SHELL)'
+
+TMPDIR ?= /tmp
+t=$(TMPDIR)/$(PACKAGE)/test
+pfx=$(t)/i
+
+# More than once, tainted build and source directory names would
+# have caused at least one "make check" test to apply "chmod 700"
+# to all directories under $HOME.  Make sure it doesn't happen again.
+tp := $(shell echo "$(TMPDIR)/$(PACKAGE)-$$$$")
+t_prefix = $(tp)/a
+t_taint = '$(t_prefix) b'
+fake_home = $(tp)/home
+
+# Ensure that tests run from tainted build and src dir names work,
+# and don't affect anything in $HOME.  Create witness files in $HOME,
+# record their attributes, and build/test.  Then ensure that the
+# witnesses were not affected.
+taint-distcheck: $(DIST_ARCHIVES)
+	test -d $(t_taint) && chmod -R 700 $(t_taint) || :
+	-rm -rf $(t_taint) $(fake_home)
+	mkdir -p $(t_prefix) $(t_taint) $(fake_home)
+	GZIP=$(GZIP_ENV) $(AMTAR) -C $(t_taint) -zxf $(distdir).tar.gz
+	mkfifo $(fake_home)/fifo
+	touch $(fake_home)/f
+	mkdir -p $(fake_home)/d/e
+	ls -lR $(fake_home) $(t_prefix) > $(tp)/.ls-before
+	cd $(t_taint)/$(distdir)			\
+	  && ./configure				\
+	  && $(MAKE)					\
+	  && HOME=$(fake_home) $(MAKE) check		\
+	  && ls -lR $(fake_home) $(t_prefix) > $(tp)/.ls-after \
+	  && diff $(tp)/.ls-before $(tp)/.ls-after	\
+	  && test -d $(t_prefix)
+	rm -rf $(tp)
+
+# Verify that a twisted use of --program-transform-name=PROGRAM works.
+define install-transform-check
+  echo running install-transform-check			\
+    && rm -rf $(pfx)					\
+    && $(MAKE) program_transform_name='s/.*/zyx/'	\
+      prefix=$(pfx) install				\
+    && test "$$(echo $(pfx)/bin/*)" = "$(pfx)/bin/zyx"	\
+    && test "$$(find $(pfx)/share/man -type f|sed 's,.*/,,;s,\..*,,')" = "zyx"
+endef
+
+# Install, then verify that all binaries and man pages are in place.
+# Note that neither the binary, ginstall, nor the ].1 man page is installed.
+define my-instcheck
+  $(MAKE) prefix=$(pfx) install				\
+    && test ! -f $(pfx)/bin/ginstall			\
+    && { fail=0;					\
+      for i in $(built_programs); do			\
+        test "$$i" = ginstall && i=install;		\
+        for j in "$(pfx)/bin/$$i"			\
+                 "$(pfx)/share/man/man1/$$i.1"; do	\
+          case $$j in *'[.1') continue;; esac;		\
+          test -f "$$j" && :				\
+            || { echo "$$j not installed"; fail=1; };	\
+        done;						\
+      done;						\
+      test $$fail = 1 && exit 1 || :;			\
+    }
+endef
+
+define coreutils-path-check
+  {							\
+    if test -f $(srcdir)/src/true.c; then		\
+      fail=1;						\
+      mkdir $(bin)					\
+	&& ($(write_loser)) > $(bin)/loser		\
+	&& chmod a+x $(bin)/loser			\
+	&& for i in $(built_programs); do		\
+	       case $$i in				\
+		 rm|expr|basename|echo|sort|ls|tr);;	\
+		 cat|dirname|mv|wc);;			\
+		 *) ln $(bin)/loser $(bin)/$$i;;	\
+	       esac;					\
+	     done					\
+	  && ln -sf ../src/true $(bin)/false		\
+	  && PATH=`pwd`/$(bin):$$PATH $(MAKE) -C tests check \
+	  && { test -d gnulib-tests			\
+	         && $(MAKE) -C gnulib-tests check	\
+	         || :; }				\
+	  && rm -rf $(bin)				\
+	  && fail=0;					\
+    else						\
+      fail=0;						\
+    fi;							\
+    test $$fail = 1 && exit 1 || :;			\
+  }
+endef
+
 # Use -Wformat -Werror to detect format-string/arg-list mismatches.
 # Also, check for shadowing problems with -Wshadow, and for pointer
 # arithmetic problems with -Wpointer-arith.
@@ -671,8 +724,6 @@ maintainer-distcheck:
 # the build srcdir, these always-failing programs will run.
 # Otherwise, it is too easy to test the wrong programs.
 # Note that "false" itself is a symlink to true, so it too will malfunction.
-TMPDIR ?= /tmp
-t=$(TMPDIR)/$(PACKAGE)/test
 my-distcheck: $(DIST_ARCHIVES) $(local-check)
 	$(MAKE) syntax-check
 	$(MAKE) check
@@ -684,6 +735,9 @@ my-distcheck: $(DIST_ARCHIVES) $(local-check)
 	  && $(MAKE) CFLAGS='$(warn_cflags)'		\
 	      AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)'	\
 	  && $(MAKE) dvi				\
+	  && $(install-transform-check)			\
+	  && $(my-instcheck)				\
+	  && $(coreutils-path-check)			\
 	  && $(MAKE) distclean
 	(cd $(t) && mv $(distdir) $(distdir).old	\
 	  && $(AMTAR) -zxf - ) < $(distdir).tar.gz
--
1.6.1.1.374.g0d9d7


>From e296a217081051c32ca5117ffc4689177763a1fb Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@xxxxxxxxxx>
Date: Wed, 28 Jan 2009 16:45:00 +0100
Subject: [PATCH 7/8] * Makefile.cfg: disable some new checks

---
 Makefile.cfg |   22 ++++++++++++++--------
 1 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/Makefile.cfg b/Makefile.cfg
index 8964319..44d3898 100644
--- a/Makefile.cfg
+++ b/Makefile.cfg
@@ -1,5 +1,5 @@
 # Customize Makefile.maint.                           -*- makefile -*-
-# Copyright (C) 2003-2008 Free Software Foundation, Inc.
+# Copyright (C) 2003-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,30 +26,36 @@ url_dir_list = \

 # Tests not to run as part of "make distcheck".
 local-checks-to-skip =			\
-  makefile_path_separator_check		\
+  changelog-check			\
+  check-AUTHORS				\
   makefile-check			\
-  sc_tight_scope			\
+  makefile_path_separator_check		\
+  patch-check				\
   sc_GPL_version			\
   sc_always_defined_macros		\
   sc_cast_of_alloca_return_value	\
   sc_dd_max_sym_length			\
   sc_error_exit_success			\
   sc_file_system			\
+  sc_immutable_NEWS			\
+  sc_m4_quote_check			\
+  sc_makefile_path_separator_check	\
   sc_obsolete_symbols			\
+  sc_prohibit_S_IS_definition		\
   sc_prohibit_atoi_atof			\
   sc_prohibit_jm_in_m4			\
+  sc_prohibit_nonreentrant		\
   sc_prohibit_quote_without_use		\
   sc_prohibit_quotearg_without_use	\
-  sc_prohibit_nonreentrant		\
+  sc_prohibit_stat_st_blocks		\
+  sc_redundant_const			\
   sc_root_tests				\
   sc_space_tab				\
   sc_sun_os_names			\
   sc_system_h_headers			\
+  sc_tight_scope			\
   sc_two_space_separator_in_usage	\
-  sc_useless_cpp_parens			\
-  patch-check				\
-  check-AUTHORS				\
-  changelog-check
+  sc_useless_cpp_parens

 useless_free_options =		\
   --name=sexpr_free		\
--
1.6.1.1.374.g0d9d7

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]