Commit f01cc5d266b888405fd4a0c3c080871044c42715

J08nY 2020-02-21T11:44:15

Fix clang detection when cross-compiling. `echo` needs -e to output newlines, without the switch make complains: <stdin>:1:17: warning: extra tokens at end of #ifdef directive <stdin>:1: error: unterminated #ifdef and does not detect clang properly when cross-compiling.

1
2
3
4
5
6
7
8
9
10
11
12
13
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