diff --git a/Makefile.inc1 b/Makefile.inc1 index 549aa2fff001..0781a1c88664 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -248,7 +248,7 @@ BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \ SSP_CFLAGS= \ MK_HTML=no MK_INFO=no NO_LINT=yes MK_MAN=no \ -DNO_PIC MK_PROFILE=no -DNO_SHARED \ - -DNO_CPU_CFLAGS -DNO_WARNS MK_CTF=no -DEARLY_BUILD MK_TESTS=no + -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no -DEARLY_BUILD MK_TESTS=no # build-tools stage TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \ @@ -258,7 +258,7 @@ TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \ BOOTSTRAPPING=${OSRELDATE} \ SSP_CFLAGS= \ -DNO_LINT \ - -DNO_CPU_CFLAGS -DNO_WARNS MK_CTF=no -DEARLY_BUILD MK_TESTS=no + -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no -DEARLY_BUILD MK_TESTS=no # cross-tools stage XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} \ @@ -277,7 +277,7 @@ KTMAKE= TOOLS_PREFIX=${WORLDTMP} MAKEOBJDIRPREFIX=${WORLDTMP} \ SSP_CFLAGS= \ MK_HTML=no MK_INFO=no -DNO_LINT MK_MAN=no \ -DNO_PIC MK_PROFILE=no -DNO_SHARED \ - -DNO_CPU_CFLAGS -DNO_WARNS MK_CTF=no -DEARLY_BUILD + -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no -DEARLY_BUILD # world stage WMAKEENV= ${CROSSENV} \ @@ -609,7 +609,7 @@ build32: WORLDTMP=${WORLDTMP} \ MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" \ MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} SSP_CFLAGS= DESTDIR= \ - DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS -DNO_WARNS MK_CTF=no \ + DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ -DEARLY_BUILD build-tools .endfor cd ${.CURDIR}; \ @@ -1846,7 +1846,7 @@ XDEV_CPUTYPE?=${TARGET_CPUTYPE} NOFUN=-DNO_FSCHG MK_HTML=no MK_INFO=no -DNO_LINT \ MK_MAN=no MK_NLS=no MK_PROFILE=no \ - MK_KERBEROS=no MK_RESCUE=no MK_TESTS=no -DNO_WARNS \ + MK_KERBEROS=no MK_RESCUE=no MK_TESTS=no MK_WARNS=no \ TARGET=${XDEV} TARGET_ARCH=${XDEV_ARCH} \ CPUTYPE=${XDEV_CPUTYPE} diff --git a/share/mk/bsd.opts.mk b/share/mk/bsd.opts.mk index 805200b658d7..885d9224c249 100644 --- a/share/mk/bsd.opts.mk +++ b/share/mk/bsd.opts.mk @@ -56,7 +56,8 @@ __DEFAULT_YES_OPTIONS = \ PROFILE \ SSP \ SYMVER \ - TOOLCHAIN + TOOLCHAIN \ + WARNS __DEFAULT_NO_OPTIONS = \ CTF \ @@ -76,7 +77,8 @@ __DEFAULT_NO_OPTIONS = \ DEBUG_FILES \ INSTALLLIB \ MAN \ - PROFILE + PROFILE \ + WARNS .if defined(NO_${var}) # This warning may be premature... #.warning "NO_${var} is defined, but deprecated. Please use MK_${var}=no instead." diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 7150f2f3c0b3..3bcd237a9399 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -4,7 +4,7 @@ # sources. # Enable various levels of compiler warning checks. These may be -# overridden (e.g. if using a non-gcc compiler) by defining NO_WARNS. +# overridden (e.g. if using a non-gcc compiler) by defining MK_WARNS=no. # for GCC: http://gcc.gnu.org/onlinedocs/gcc-4.2.1/gcc/Warning-Options.html @@ -134,9 +134,8 @@ CFLAGS+= ${SSP_CFLAGS} .endif # SSP && !IA64 && !ARM && !MIPS # Allow user-specified additional warning flags, plus compiler specific flag overrides. -# Unless we're early in the build, in which case don't (which is lame, this should -# be handled by NO_WARNS which needs to migrate to something else. -.if !defined(NO_WARNS) && !defined(EARLY_BUILD) +# Unless we've overriden this... +.if ${MK_WARNS} != "no" CFLAGS+= ${CWARNFLAGS} ${CWARNFLAGS.${COMPILER_TYPE}} .endif diff --git a/tools/build/options/WITHOUT_WARNS b/tools/build/options/WITHOUT_WARNS new file mode 100644 index 000000000000..185a279bffd9 --- /dev/null +++ b/tools/build/options/WITHOUT_WARNS @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Set this to not add warning flags to the compiler invocations. +Useful as a temporary workaround when code enters the tree +which triggers warnings in environments that differ from the +original develoepr.