Makefile.am: fix printf-check in out-of-tree build
authorDaniele Di Proietto <ddiproietto@vmware.com>
Mon, 23 Jun 2014 04:39:47 +0000 (04:39 +0000)
committerJoe Stringer <joestringer@nicira.com>
Sun, 22 Jun 2014 21:44:16 +0000 (09:44 +1200)
The introduction of a %zu in datapath/flow_netlink.c with commit c1fc1411
revealed a problem with out-of-tree builds.

printf-check and thread-safety-check skip some directories with a 'grep -v'.
In the case of an out-of-tree build, the grep -v pattern doesn't work, because
it assumes the pathnames to be relative to the OVS root directory.

This commit fixes the problem by changing the directory before executing any
commands, like we do elsewhere in Makefile.am

Signed-off-by: Daniele Di Proietto <ddiproietto@vmware.com>
Signed-off-by: Joe Stringer <joestringer@nicira.com>
Makefile.am

index a98541f..d479c8b 100644 (file)
@@ -208,8 +208,9 @@ config-h-check:
 # Check for printf() type modifiers that MSVC doesn't support.
 ALL_LOCAL += printf-check
 printf-check:
-       @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1 && \
-          git --no-pager grep -n -E -e '%[-+ #0-9.*]*([ztj]|hh)' --and --not -e 'ovs_scan' `git ls-files $(srcdir) | grep '\.[ch]$$' | \
+       @cd $(srcdir); \
+       if test -e .git && (git --version) >/dev/null 2>&1 && \
+          git --no-pager grep -n -E -e '%[-+ #0-9.*]*([ztj]|hh)' --and --not -e 'ovs_scan' `git ls-files | grep '\.[ch]$$' | \
                grep -vE '^datapath|^lib/sflow|^third-party'`; \
        then \
            echo "See above for list of violations of the rule that"; \
@@ -246,9 +247,10 @@ check-assert-h-usage:
 
 ALL_LOCAL += thread-safety-check
 thread-safety-check:
-       @if test -e '$(srcdir)'/.git && (git --version) >/dev/null 2>&1 && \
-          grep -n -f '$(srcdir)'/build-aux/thread-safety-blacklist \
-              `git ls-files '$(srcdir)' | grep '\.[ch]$$' \
+       @cd $(srcdir); \
+       if test -e .git && (git --version) >/dev/null 2>&1 && \
+          grep -n -f build-aux/thread-safety-blacklist \
+              `git ls-files | grep '\.[ch]$$' \
                 | $(EGREP) -v '^datapath|^lib/sflow|^third-party'` /dev/null \
               | $(EGREP) -v ':[        ]*/?\*'; \
        then \