From: Omar Sandoval Date: Wed, 13 Feb 2019 19:42:02 +0000 (-0800) Subject: src: check if header exists with -E X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=01ae9573f22be170d49b3fb6039228790166e5fd;p=users%2Fsagi%2Fblktests.git src: check if header exists with -E The current HAVE_C_HEADER function creates a -.o file. We don't need to compile, just run the C preprocessor, so use -E instead of -c. Signed-off-by: Omar Sandoval --- diff --git a/src/Makefile b/src/Makefile index cb35497..917d6f4 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,6 +1,6 @@ -HAVE_C_HEADER = $(shell if echo "\#include <$(1)>" | \ - $(CC) -x c -c - 2>/dev/null; then echo "$(2)"; \ - else echo "$(3)"; fi) +HAVE_C_HEADER = $(shell if echo "\#include <$(1)>" | \ + $(CC) -E - > /dev/null 2>&1; then echo "$(2)"; \ + else echo "$(3)"; fi) C_TARGETS := \ loblksize \