From 843cec5cbd2bcd548e7486ae1f3bbf35d4acced0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= Date: Thu, 14 Jun 2018 23:38:36 +0200 Subject: [PATCH] makefiles/cflags.inc.mk: Use a template for CFLAGS testing --- makefiles/cflags.inc.mk | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/makefiles/cflags.inc.mk b/makefiles/cflags.inc.mk index 160469fbc8..edd578b69d 100644 --- a/makefiles/cflags.inc.mk +++ b/makefiles/cflags.inc.mk @@ -25,21 +25,23 @@ ifeq ($(shell $(CC) -fno-delete-null-pointer-checks -E - 2>/dev/null >/dev/null endif endif +# Template for testing a compiler flag and adding it to CFLAGS (errors usually +# happens when using older toolchains which do not support the given flags) +define cflags_test_and_add + ifeq ($(shell $(CC) $(1) -E - 2>/dev/null >/dev/null /dev/null >/dev/null /dev/null >/dev/null