]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
src: Fix checking for clang
authorAndrea Bolognani <abologna@redhat.com>
Thu, 1 Mar 2018 16:32:08 +0000 (17:32 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Thu, 1 Mar 2018 16:47:54 +0000 (17:47 +0100)
The check was trying to use the shell variable $CC instead of
the make variable $(CC); it also interpreted grep's return code
wrong: 1 means the provided pattern was *not* matched. As a
result, pdwtags was never run, not even when building with gcc.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/Makefile.am

index 57949152469d74768fc7a4f9c995bdc6ea829a0f..3bf2da543d1bc7ad0cbe3609e0fa7de8126b0d7c 100644 (file)
@@ -668,8 +668,7 @@ struct_prefix = ($(libs_prefix)|$(other_prefix))
 # which causes the comparison against expected output to fail, so skip
 # if using clang as CC.
 PDWTAGS = \
-       $(AM_V_GEN)$CC -v 2>&1 | grep -q clang; \
-       if test $$? == 1; then \
+       $(AM_V_GEN)if $(CC) -v 2>&1 | grep -q clang; then \
           echo 'WARNING: skipping pdwtags test with Clang' >&2; \
           exit 0; \
        fi; \