From f41f926aab38d52734b3908eeb0496ebf1285cbd Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 23 Apr 2009 08:45:51 +0200 Subject: tests: make the check-AUTHORS test more portable, now that it's... run as part of "make check". * src/Makefile.am (check-AUTHORS): Don't depend on en_US.UTF-8. Instead, use the French UTF8 locale, if configure found one. If not found, just skip the test. --- src/Makefile.am | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index be134be01..a266d7b31 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -382,12 +382,17 @@ check-duplicate-no-install: tr test -z "`echo '$(EXTRA_PROGRAMS)'| ./tr ' ' '\n' | uniq -d`" # Ensure that the list of programs and author names is accurate. +# We need a UTF8 locale, and any one should do, but since configure +# already tries to find a French one, use it. It's fine to skip this test. au_dotdot = authors-dotdot au_actual = authors-actual .PHONY: check-AUTHORS check-AUTHORS: $(all_programs) - @rm -f $(au_actual) $(au_dotdot) - @for i in `ls $(all_programs) | sed -e 's,$(EXEEXT)$$,,' \ + @locale='$(LOCALE_FR_UTF8)'; \ + case "$$locale" in \ + ''|none) echo "$@: skipping this check"; exit 0;; esac; \ + rm -f $(au_actual) $(au_dotdot); \ + for i in `ls $(all_programs) | sed -e 's,$(EXEEXT)$$,,' \ | $(ASSORT) -u`; do \ test "$$i" = '[' && continue; \ exe=$$i; \ @@ -396,7 +401,7 @@ check-AUTHORS: $(all_programs) elif test "$$i" = test; then \ exe='['; \ fi; \ - LC_ALL=en_US.UTF-8 ./$$exe --version \ + LC_ALL="$$locale" ./$$exe --version \ | perl -0 -pi -e 's/,\n/, /gm' \ | sed -n -e '/Written by /{ s//'"$$i"': /;' \ -e 's/,* and /, /; s/\.$$//; p; }'; \ -- cgit v1.2.3-54-g00ecf