summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrdivacky <rdivacky@FreeBSD.org>2009-03-14 17:55:16 +0000
committerrdivacky <rdivacky@FreeBSD.org>2009-03-14 17:55:16 +0000
commit4cd01fc223701ae9a3fc4907d8c8e835ca6193d6 (patch)
tree2e832ae7edeb004a0ac2179546f03d09f8ad19b9
parent9dac23d7ae211df76cd0c75b8afc7a756730f4d4 (diff)
downloadFreeBSD-src-4cd01fc223701ae9a3fc4907d8c8e835ca6193d6.zip
FreeBSD-src-4cd01fc223701ae9a3fc4907d8c8e835ca6193d6.tar.gz
Switch over to gnu99 compilation on default for userland.
Tested by: make universe Tested by: ports exp build (done by pav) Reviewed by: ru Reviewed by: silence on arch Approved by: ed (mentor)
-rw-r--r--cddl/Makefile.inc2
-rw-r--r--cddl/lib/libzpool/Makefile4
-rw-r--r--cddl/usr.bin/ztest/Makefile4
-rw-r--r--cddl/usr.sbin/zdb/Makefile4
-rw-r--r--share/mk/bsd.sys.mk17
-rw-r--r--tools/regression/include/tgmath/Makefile3
6 files changed, 19 insertions, 15 deletions
diff --git a/cddl/Makefile.inc b/cddl/Makefile.inc
index 99ef333..4161c27 100644
--- a/cddl/Makefile.inc
+++ b/cddl/Makefile.inc
@@ -6,3 +6,5 @@ OPENSOLARIS_SYS_DISTDIR= ${.CURDIR}/../../../sys/cddl/contrib/opensolaris
IGNORE_PRAGMA= YES
CFLAGS+= -DNEED_SOLARIS_BOOLEAN
+
+CSTD?= gnu89
diff --git a/cddl/lib/libzpool/Makefile b/cddl/lib/libzpool/Makefile
index 26d5499..54ab6c0 100644
--- a/cddl/lib/libzpool/Makefile
+++ b/cddl/lib/libzpool/Makefile
@@ -33,8 +33,6 @@ SRCS= ${ZFS_COMMON_SRCS} ${ZFS_SHARED_SRCS} \
${KERNEL_SRCS} ${LIST_SRCS} ${ATOMIC_SRCS} \
${UNICODE_SRCS}
-CFLAGS+= -std=c99
-
CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris
CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/include
CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem
@@ -60,4 +58,6 @@ LDADD= -lpthread -lz
# atomic.S doesn't like profiling.
NO_PROFILE=
+CSTD= c99
+
.include <bsd.lib.mk>
diff --git a/cddl/usr.bin/ztest/Makefile b/cddl/usr.bin/ztest/Makefile
index cc0bca4..67ade45ad 100644
--- a/cddl/usr.bin/ztest/Makefile
+++ b/cddl/usr.bin/ztest/Makefile
@@ -5,8 +5,6 @@
PROG= ztest
NO_MAN=
-CFLAGS+= -std=c99
-
CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris
CFLAGS+= -I${.CURDIR}/../../compat/opensolaris/include
CFLAGS+= -I${.CURDIR}/../../compat/opensolaris/lib/libumem
@@ -21,4 +19,6 @@ DPADD= ${LIBM} ${LIBNVPAIR} ${LIBUMEM} ${LIBZPOOL} \
${LIBPTHREAD} ${LIBZ} ${LIBAVL}
LDADD= -lm -lnvpair -lumem -lzpool -lpthread -lz -lavl
+CSTD= c99
+
.include <bsd.prog.mk>
diff --git a/cddl/usr.sbin/zdb/Makefile b/cddl/usr.sbin/zdb/Makefile
index f0c1b22..35ad2a1 100644
--- a/cddl/usr.sbin/zdb/Makefile
+++ b/cddl/usr.sbin/zdb/Makefile
@@ -6,8 +6,6 @@ PROG= zdb
MAN= zdb.8
SRCS= zdb.c zdb_il.c
-CFLAGS+= -std=c99
-
CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris
CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/include
CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem
@@ -25,4 +23,6 @@ DPADD= ${LIBAVL} ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBPTHREAD} ${LIBUMEM} \
${LIBUUTIL} ${LIBZ} ${LIBZFS} ${LIBZPOOL}
LDADD= -lavl -lgeom -lm -lnvpair -lpthread -lumem -luutil -lz -lzfs -lzpool
+CSTD= c99
+
.include <bsd.prog.mk>
diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk
index 197c1d6..34e04f8 100644
--- a/share/mk/bsd.sys.mk
+++ b/share/mk/bsd.sys.mk
@@ -8,22 +8,23 @@
# for GCC: http://gcc.gnu.org/onlinedocs/gcc-3.0.4/gcc_3.html#IDX143
+# the default is gnu99 for now
+CSTD ?= gnu99
+
.if !defined(NO_WARNS) && ${CC} != "icc"
-. if defined(CSTD)
-. if ${CSTD} == "k&r"
+. if ${CSTD} == "k&r"
CFLAGS += -traditional
-. elif ${CSTD} == "c89" || ${CSTD} == "c90"
+. elif ${CSTD} == "c89" || ${CSTD} == "c90"
CFLAGS += -std=iso9899:1990
-. elif ${CSTD} == "c94" || ${CSTD} == "c95"
+. elif ${CSTD} == "c94" || ${CSTD} == "c95"
CFLAGS += -std=iso9899:199409
-. elif ${CSTD} == "c99"
+. elif ${CSTD} == "c99"
CFLAGS += -std=iso9899:1999
-. else
+. else
CFLAGS += -std=${CSTD}
-. endif
+. endif
# -pedantic is problematic because it also imposes namespace restrictions
#CFLAGS += -pedantic
-. endif
. if defined(WARNS)
. if ${WARNS} >= 1
CWARNFLAGS += -Wsystem-headers
diff --git a/tools/regression/include/tgmath/Makefile b/tools/regression/include/tgmath/Makefile
index 64626c5..53e3b9a 100644
--- a/tools/regression/include/tgmath/Makefile
+++ b/tools/regression/include/tgmath/Makefile
@@ -1,7 +1,8 @@
# $FreeBSD$
PROG= tgmath
-CFLAGS+= -fno-builtin -std=c99
+CSTD= c99
+CFLAGS+= -fno-builtin
NO_MAN=
.include <bsd.prog.mk>
OpenPOWER on IntegriCloud