From 073bdfe9ec911b0392502cd9fa3b594cccbe55df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Kijewski?= Date: Wed, 7 May 2014 13:02:22 +0200 Subject: [PATCH] make: add own file for CFLAGS feature tests --- Makefile.cflags | 23 +++++++++++++++++++++++ Makefile.include | 25 ++----------------------- 2 files changed, 25 insertions(+), 23 deletions(-) create mode 100644 Makefile.cflags diff --git a/Makefile.cflags b/Makefile.cflags new file mode 100644 index 0000000000..220215f413 --- /dev/null +++ b/Makefile.cflags @@ -0,0 +1,23 @@ +# Test if the input language was specified externally. +# Otherwise test if the compiler unterstands the "-std=gnu99" flag, and use it if so. +# Otherwise test if the compiler unterstands the "-std=c99" flag, and use it if so. +ifeq ($(filter -std=%,$(CFLAGS)),) +ifeq ($(shell $(CC) -std=gnu99 -E - 2>/dev/null >/dev/null /dev/null >/dev/null y` was accessed. +# 0x0 might be a sane memory location for embedded systems, so the test must not be removed. +# Right now clang does not use the *delete-null-pointer* optimization, and does not understand the parameter. +# Related issues: #628, #664. +ifeq ($(shell $(CC) -fno-delete-null-pointer-checks -E - 2>/dev/null >/dev/null &1 1>/dev/null /dev/null >/dev/null /dev/null >/dev/null y` was accessed. -# 0x0 might be a sane memory location for embedded systems, so the test must not be removed. -# Right now clang does not use the *delete-null-pointer* optimization, and does not understand the parameter. -# Related issues: #628, #664. -ifeq ($(shell $(CC) -fno-delete-null-pointer-checks -E - 2>/dev/null >/dev/null &1 1>/dev/null