From dcdd01ca2c76bec812da0811aaf6cbd6199423bd Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Sat, 31 Jan 2009 22:06:42 +0100 Subject: [PATCH] make.conf: Bring back WARNS_WERROR to build with -Werror if WARNS is set. In-discussion-with: pavalos --- etc/defaults/make.conf | 3 +++ share/man/man5/make.conf.5 | 8 +++++++- share/mk/bsd.sys.mk | 12 ++++++------ 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/etc/defaults/make.conf b/etc/defaults/make.conf index 29f8d5fc4a..7941242028 100644 --- a/etc/defaults/make.conf +++ b/etc/defaults/make.conf @@ -69,6 +69,9 @@ BDECFLAGS= -W -Wall -ansi -pedantic -Wbad-function-cast -Wcast-align \ -Wmissing-prototypes -Wnested-externs -Wpointer-arith \ -Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings # +# WARNS_WERROR causes -Werror to be added when WARNS is in effect. +#WARNS_WERROR= yes +# # To compile just the kernel with special optimizations, you should use # this instead of CFLAGS (which is not applicable to kernel builds anyway). # There is very little to gain by using higher optimization levels, and doing diff --git a/share/man/man5/make.conf.5 b/share/man/man5/make.conf.5 index 0881427215..c904b1e756 100644 --- a/share/man/man5/make.conf.5 +++ b/share/man/man5/make.conf.5 @@ -25,7 +25,7 @@ .\" $FreeBSD: src/share/man/man5/make.conf.5,v 1.12.2.30 2003/05/18 17:05:55 brueffer Exp $ .\" $DragonFly: src/share/man/man5/make.conf.5,v 1.38 2008/11/03 00:25:45 pavalos Exp $ .\" -.Dd December 1, 2008 +.Dd January 31, 2009 .Dt MAKE.CONF 5 .Os .Sh NAME @@ -199,6 +199,12 @@ Set this to the flag to pass the command. If set to a blank value, components will be installed with debugging symbols. +.It Va WARNS_WERROR +Causes +.Fl Werror +to be added to +.Va CWARNFLAGS +when WARNS is in effect. .It Va WITH_GCPIO .Pq Vt bool Set this to use diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 4fe47573ae..a008d668c2 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -24,9 +24,9 @@ CFLAGS += -std=${CSTD} . if defined(WARNS) . if ${WARNS} >= 1 CWARNFLAGS += -Wsystem-headers -#. if !defined(NO_WERROR) && ${CCVER} == "gcc41" && ${MACHINE_ARCH} == "i386" -#CWARNFLAGS += -Werror -#. endif +. if defined(WARNS_WERROR) && !defined(NO_WERROR) +CWARNFLAGS += -Werror +. endif . endif . if ${WARNS} >= 2 CWARNFLAGS += -Wall @@ -55,9 +55,9 @@ WFORMAT = 1 . if defined(WFORMAT) . if ${WFORMAT} > 0 CWARNFLAGS += -Wformat=2 -Wno-format-extra-args -#. if !defined(NO_WERROR) && ${CCVER} == "gcc41" && ${MACHINE_ARCH} == "i386" -#CWARNFLAGS += -Werror -#. endif +. if defined(WARNS_WERROR) && !defined(NO_WERROR) +CWARNFLAGS += -Werror +. endif . endif . endif .endif -- 2.11.4.GIT