[Olsr-dev] [PATCH v1 1/2] make: support building with clang (on Linux)

Ferry Huberts (spam-protected)
Wed Dec 9 11:15:11 CET 2015


From: Ferry Huberts <(spam-protected)>

Signed-off-by: Ferry Huberts <(spam-protected)>
---
 Makefile.inc | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/Makefile.inc b/Makefile.inc
index b41ca36..64264d7 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -119,14 +119,18 @@ WARNINGS +=	-Wformat-y2k
 WARNINGS +=     -Werror=format-security
 WARNINGS +=	-Winit-self
 WARNINGS +=	-Wswitch-default
-WARNINGS +=	-Wsync-nand
 WARNINGS +=	-Wundef
+ifneq ($(CC),clang)
+WARNINGS +=	-Wsync-nand
 WARNINGS +=	-Wlogical-op
+endif
 ifneq ($(OS),android)
+ifneq ($(CC),clang)
 WARNINGS +=	-Wdouble-promotion
 WARNINGS +=	-Wjump-misses-init
 WARNINGS +=	-Wtrampolines
 endif
+endif
 WARNINGS +=	-Wunused-parameter
 # the following 2 do not work yet and need more work on it
 #WARNINGS +=	-Wconversion
@@ -140,14 +144,18 @@ endif
 WARNINGS +=	-Winline
 WARNINGS +=	-Wdisabled-optimization
 # WARNINGS +=	-Werror
-WARNINGS +=	-finline-functions-called-once
 WARNINGS +=	-funit-at-a-time
+ifneq ($(CC),clang)
+WARNINGS +=	-finline-functions-called-once
 WARNINGS +=	-fearly-inlining
+endif
 ifeq ($(DEBUG),0)
 WARNINGS +=	-fomit-frame-pointer
 endif
 # we have small inline functions in src/lq_route.h which should always be inlined
+ifneq ($(CC),clang)
 WARNINGS +=	-finline-limit=350
+endif
 # These tell gcc to put each function and global variable in a separate section.
 # The linker can than remove all unreferenced section. But in the olsrd binary
 # unused doesn't imply unused at all since the function may be used by plugins,
-- 
2.5.0




More information about the Olsr-dev mailing list