]> www.infradead.org Git - users/sagi/blktests.git/commitdiff
src: check if header exists with -E
authorOmar Sandoval <osandov@fb.com>
Wed, 13 Feb 2019 19:42:02 +0000 (11:42 -0800)
committerOmar Sandoval <osandov@fb.com>
Wed, 13 Feb 2019 19:49:24 +0000 (11:49 -0800)
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 <osandov@fb.com>
src/Makefile

index cb35497a60892be8a5e7d48dd1bcb901de63b1b9..917d6f4d2b7f1c5267533343b0c4278f5ff2dfcf 100644 (file)
@@ -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 \