svn commit: r306729 - head/tools/build/options

Ed Maste emaste at FreeBSD.org
Wed Oct 5 20:12:02 UTC 2016


Author: emaste
Date: Wed Oct  5 20:12:00 2016
New Revision: 306729
URL: https://svnweb.freebsd.org/changeset/base/306729

Log:
  makeman: avoid bogus output with duplicated options
  
  On some targets 'make showconfig' currently reports both 'no' and 'yes'
  for some options. For example:
  
  % make TARGET=mips showconfig | grep SSP
  MK_SSP           = no
  MK_SSP           = yes
  
  Emit a warning on encountering a duplicated variable, and skip the
  second entry.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/tools/build/options/makeman

Modified: head/tools/build/options/makeman
==============================================================================
--- head/tools/build/options/makeman	Wed Oct  5 20:08:07 2016	(r306728)
+++ head/tools/build/options/makeman	Wed Oct  5 20:12:00 2016	(r306729)
@@ -33,12 +33,18 @@ show_options()
 	ALL_TARGETS=$(echo $(${make} targets | tail -n +2))
 	rm -f $t/settings
 	for target in ${ALL_TARGETS} ; do
+		prev_opt=
 		env -i ${make} showconfig \
 		    SRC_ENV_CONF=/dev/null SRCCONF=/dev/null \
 		    __MAKE_CONF=/dev/null \
 		    TARGET_ARCH=${target#*/} TARGET=${target%/*} |
 		while read var _ val ; do
 			opt=${var#MK_}
+			if [ $opt = "$prev_opt" ]; then
+				echo "$target: ignoring duplicate option $opt" >&2
+				continue
+			fi
+			prev_opt=$opt
 			case ${val} in
 			yes)
 				echo ${opt} ${target}


More information about the svn-src-all mailing list