maint.mk: let po check work in VPATH build
authorEric Blake <eblake@redhat.com>
Fri, 18 Mar 2011 21:32:24 +0000 (15:32 -0600)
committerEric Blake <eblake@redhat.com>
Fri, 18 Mar 2011 21:33:34 +0000 (15:33 -0600)
* top/maint.mk (po_file): Allow cfg.mk override.
(sc_po_check): Allow VPATH use.
Reported by Jiri Denemark.

Signed-off-by: Eric Blake <eblake@redhat.com>
ChangeLog
top/maint.mk

index 917e834e9dc9196993c7bcff65d789dc57b7484c..01544bc9b6ee6c5cb8fd31c4e0a11ed97283cea4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-03-18  Eric Blake  <eblake@redhat.com>
+
+       maint.mk: let po check work in VPATH build
+       * top/maint.mk (po_file): Allow cfg.mk override.
+       (sc_po_check): Allow VPATH use.
+       Reported by Jiri Denemark.
+
 2011-03-16  Jim Meyering  <meyering@redhat.com>
 
        maint.mk: allow fine-grained syntax-check exclusion via Make variables
index 1df8c7a770a6825de16ddf54144082e9cd95b4c0..6dde0227d7e5b674f87a42b55f93e3572d1c5e0a 100644 (file)
@@ -955,13 +955,13 @@ fix_po_file_diag = \
 apply the above patch\n'
 
 # Verify that all source files using _() are listed in po/POTFILES.in.
-po_file po/POTFILES.in
+po_file ?= $(srcdir)/po/POTFILES.in
 sc_po_check:
        @if test -f $(po_file); then                                    \
          grep -E -v '^(#|$$)' $(po_file)                               \
            | grep -v '^src/false\.c$$' | sort > $@-1;                  \
          files=;                                                       \
-         for file in $$($(VC_LIST_EXCEPT)) lib/*.[ch]; do              \
+         for file in $$($(VC_LIST_EXCEPT)) $(srcdir)lib/*.[ch]; do     \
            test -r $$file || continue;                                 \
            case $$file in                                              \
              *.m4|*.mk) continue ;;                                    \
@@ -976,7 +976,7 @@ sc_po_check:
            files="$$files $$file";                                     \
          done;                                                         \
          grep -E -l '\b(N?_|gettext *)\([^)"]*("|$$)' $$files          \
-           | sort -u > $@-2;                                           \
+           | sort -u | sed 's|^$(_dot_escaped_srcdir)/||' > $@-2;      \
          diff -u -L $(po_file) -L $(po_file) $@-1 $@-2                 \
            || { printf '$(ME): '$(fix_po_file_diag) 1>&2; exit 1; };   \
          rm -f $@-1 $@-2;                                              \