From f01cc5d266b888405fd4a0c3c080871044c42715 Mon Sep 17 00:00:00 2001 From: J08nY Date: Fri, 21 Feb 2020 11:44:15 +0100 Subject: [PATCH] Fix clang detection when cross-compiling. `echo` needs -e to output newlines, without the switch make complains: :1:17: warning: extra tokens at end of #ifdef directive :1: error: unterminated #ifdef and does not detect clang properly when cross-compiling. --- makefile_include.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefile_include.mk b/makefile_include.mk index be53ba7..0266da1 100644 --- a/makefile_include.mk +++ b/makefile_include.mk @@ -26,7 +26,7 @@ ifeq ($(PLATFORM),FreeBSD) # XXX: FreeBSD needs extra escaping for some reason CSTR := $$$(CSTR) endif -ifneq (,$(shell echo $(CSTR) | $(CC) -E - | grep CLANG)) +ifneq (,$(shell printf $(CSTR) | $(CC) -E - | grep CLANG)) CC := $(CROSS_COMPILE)clang else CC := $(CROSS_COMPILE)gcc