[Midnightbsd-cvs] src [11878] trunk/tools/build/options/makeman: update file

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sun Jul 15 16:47:21 EDT 2018


Revision: 11878
          http://svnweb.midnightbsd.org/src/?rev=11878
Author:   laffer1
Date:     2018-07-15 16:47:20 -0400 (Sun, 15 Jul 2018)
Log Message:
-----------
update file

Modified Paths:
--------------
    trunk/tools/build/options/makeman

Property Changed:
----------------
    trunk/tools/build/options/makeman

Modified: trunk/tools/build/options/makeman
===================================================================
--- trunk/tools/build/options/makeman	2018-07-15 20:46:37 UTC (rev 11877)
+++ trunk/tools/build/options/makeman	2018-07-15 20:47:20 UTC (rev 11878)
@@ -3,6 +3,7 @@
 # This file is in the public domain.
 
 set -o errexit
+LC_ALL=C
 
 ident='$MidnightBSD$'
 
@@ -9,6 +10,9 @@
 t=$(mktemp -d -t makeman)
 trap 'test -d $t && rm -rf $t' exit
 
+srcdir=$(realpath ../../..)
+make="make -C $srcdir -m $srcdir/share/mk"
+
 #
 # usage: no_targets all_targets yes_targets
 #
@@ -26,10 +30,10 @@
 
 show_options()
 {
-	ALL_TARGETS=$(echo $(make -C ../../.. targets | tail -n +2))
+	ALL_TARGETS=$(echo $(${make} targets | tail -n +2))
 	rm -f $t/settings
 	for target in ${ALL_TARGETS} ; do
-		make -C ../../.. showconfig \
+		env -i ${make} showconfig \
 		    SRCCONF=/dev/null __MAKE_CONF=/dev/null \
 		    TARGET_ARCH=${target#*/} TARGET=${target%/*} |
 		while read var _ val ; do
@@ -55,7 +59,7 @@
 		fi
 	done
 
-	cat $t/settings | while read opt targets ; do
+	while read opt targets ; do
 		if [ "${targets}" = "${ALL_TARGETS}" ] ; then
 			echo "WITHOUT_${opt}"
 		elif [ -z "${targets}" ] ; then
@@ -64,7 +68,7 @@
 			echo "WITHOUT_${opt}" $(no_targets "${ALL_TARGETS}" "${targets}")
 			echo "WITH_${opt} ${targets}"
 		fi
-	done
+	done < $t/settings
 }
 
 #
@@ -92,7 +96,7 @@
 		exit 1
 		;;
 	esac
-	make -C ../../.. "$@" showconfig __MAKE_CONF=/dev/null |
+	env -i ${make} "$@" showconfig __MAKE_CONF=/dev/null |
 	while read var _ val ; do
 		opt=${var#MK_}
 		case ${val} in
@@ -115,7 +119,7 @@
 
 	ident=${ident#$}
 	ident=${ident% $}
-	fbsdid='$'MidnightBSD'$'
+	fbsdid='$'FreeBSD'$'
 	cat <<EOF
 .\" DO NOT EDIT-- this file is automatically generated.
 .\" from ${ident}
@@ -198,7 +202,12 @@
 .Bl -tag -width indent
 EOF
 	show settings SRCCONF=/dev/null | sort > $t/config_default
-	show with SRCCONF=/dev/null | sort > $t/config_WITH_ALL
+	# Work around WITH_LDNS_UTILS forcing BIND_UTILS off by parsing the
+	# actual config that results from enabling every WITH_ option.  This
+	# can be reverted if/when we no longer have options that disable
+	# others.
+	show with SRCCONF=/dev/null | sort | sed 's/$/=/' > $t/src.conf
+	show settings SRCCONF=$t/src.conf | sort > $t/config_WITH_ALL
 	show without SRCCONF=/dev/null | sort > $t/config_WITHOUT_ALL
 
 	show_options |
@@ -209,7 +218,7 @@
 		fi
 
 		echo ".It Va ${opt}"
-		sed -e's/\$\(MidnightBSD: .*\) \$/from \1/' ${opt}
+		sed -e's/\$\(FreeBSD: .*\) \$/from \1/' ${opt}
 		if [ -n "${targets}" ] ; then
 			echo '.Pp'
 			echo 'It is a default setting on'
@@ -229,35 +238,45 @@
 			exit 1
 		fi
 
+		show settings SRCCONF=/dev/null -D${opt} | sort > $t/config_${opt}
+		comm -13 $t/config_default $t/config_${opt} | sed -n "/^${opt}$/!p" |
+		comm -13 $t/deps - > $t/deps2
+
+		# Work around BIND_UTILS=no being the default when every WITH_
+		# option is enabled.
+		if [ "$(cat $t/deps2)" = WITHOUT_BIND_UTILS ]; then
+			sort $t/deps $t/deps2 > $t/_deps
+			mv $t/_deps $t/deps
+			:> $t/deps2
+		fi
+
+		havedeps=0
 		if [ -s $t/deps ] ; then
+			havedeps=1
 			echo 'When set, it also enforces the following options:'
 			echo '.Pp'
 			echo '.Bl -item -compact'
-			cat $t/deps | while read opt2 ; do
+			while read opt2 ; do
 				echo '.It'
 				echo ".Va ${opt2}"
-			done
+			done < $t/deps
 			echo '.El'
 		fi
 
-		show settings SRCCONF=/dev/null -D${opt} | sort > $t/config_${opt}
-		comm -13 $t/config_default $t/config_${opt} | sed -n "/^${opt}$/!p" |
-		comm -13 $t/deps - > $t/deps2
-
 		if [ -s $t/deps2 ] ; then
-			if [ -s $t/deps ] ; then
+			if [ ${havedeps} -eq 1 ] ; then
 				echo '.Pp'
 			fi
 			echo 'When set, the following options are also in effect:'
 			echo '.Pp'
 			echo '.Bl -inset -compact'
-			cat $t/deps2 | while read opt2 ; do
+			while read opt2 ; do
 				echo ".It Va ${opt2}"
 				noopt=$(echo ${opt2} | sed -e's/WITH_/WITHOUT_/;t' -e's/WITHOUT_/WITH_/')
 				echo '(unless'
 				echo ".Va ${noopt}"
 				echo 'is set explicitly)'
-			done
+			done < $t/deps2
 			echo '.El'
 		fi
 		twiddle >&2
@@ -280,7 +299,8 @@
 file appeared in
 .Fx 7.0 .
 .Sh AUTHORS
-This manual page was autogenerated.
+This manual page was autogenerated by
+.An tools/build/options/makeman .
 EOF
 }
 


Property changes on: trunk/tools/build/options/makeman
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property


More information about the Midnightbsd-cvs mailing list