From 9f9aa69d4412b99a1c72008210179b2cd4e9f4ae Mon Sep 17 00:00:00 2001 From: des Date: Wed, 13 Sep 2006 08:40:40 +0000 Subject: [PATCH] MFC: CSTD support Approved by: re (kensmith) --- share/mk/bsd.sys.mk | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 5c840cd8b4b5..bf5d8d9a85b0 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -9,6 +9,21 @@ # for GCC: http://gcc.gnu.org/onlinedocs/gcc-3.0.4/gcc_3.html#IDX143 .if !defined(NO_WARNS) && ${CC} != "icc" +. if defined(CSTD) +. if ${CSTD} == "k&r" +CFLAGS += -traditional +. elif ${CSTD} == "c89" || ${CSTD} == "c90" +CFLAGS += -std=iso9899:1990 +. elif ${CSTD} == "c94" || ${CSTD} == "c95" +CFLAGS += -std=iso9899:199409 +. elif ${CSTD} == "c99" +CFLAGS += -std=iso9899:1999 +. else +CFLAGS += -std=${CSTD} +. endif +# -pedantic is problematic because it also imposes namespace restrictions +#CFLAGS += -pedantic +. endif . if defined(WARNS) . if ${WARNS} >= 1 CWARNFLAGS += -Wsystem-headers