Makefile: Use C locale for checking files to distribute.
authorBen Pfaff <blp@cs.stanford.edu>
Tue, 24 Dec 2013 16:18:53 +0000 (08:18 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Tue, 24 Dec 2013 16:18:53 +0000 (08:18 -0800)
Otherwise a bad report can result if the two targets are run in different
locales (in different runs of "make").

Reported by John Darrington.

Makefile.am

index 803ad08e2a01473ebb5db1ac4af6d0f727450859..51c2f226b950fadf3ba0a8f60de882985c5f539e 100644 (file)
@@ -116,9 +116,9 @@ ALL_LOCAL += dist-hook-git
 dist-hook-git: distfiles
        @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1; then \
          (cd $(srcdir) && git ls-files)                                    \
-           | grep -vE '\.gitignore|README.Git|Smake'                       \
-           | sort -u > gitfiles;                                           \
-         comm -1 -3 distfiles gitfiles > missing-distfiles;                \
+           | grep -vE '\.gitignore|README.Git|Smake'                       \
+           | LC_ALL=C sort -u > gitfiles;                                  \
+         LC_ALL=C comm -1 -3 distfiles gitfiles > missing-distfiles;       \
          if test -s missing-distfiles; then                                \
            echo "The distribution is missing the following files:";        \
            cat missing-distfiles;                                          \
@@ -132,6 +132,7 @@ distfiles: Makefile
        list='$(DISTFILES)'; \
        for file in $$list; do echo $$file; done | \
          sed -e "s|^$$srcdirstrip/||;t" \
-             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t" | sort -u > $@
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t" \
+         | LC_ALL=C sort -u > $@
 CLEANFILES += distfiles gitfiles missing-distfiles
 .PHONY: dist-hook-git