3 # This file is in the public domain.
10 t=$(mktemp -d -t makeman)
11 trap 'test -d $t && rm -rf $t' exit
13 srcdir=$(realpath ../../..)
14 make="make -C $srcdir -m $srcdir/share/mk"
17 # usage: no_targets all_targets yes_targets
23 if [ "${t1}" = "${t2}" ] ; then
33 ALL_TARGETS=$(echo $(${make} targets | tail -n +2))
35 for target in ${ALL_TARGETS} ; do
36 env -i ${make} showconfig \
37 SRCCONF=/dev/null __MAKE_CONF=/dev/null \
38 TARGET_ARCH=${target#*/} TARGET=${target%/*} |
39 while read var _ val ; do
49 echo 'make showconfig broken' >&2
53 done > $t/settings.target
54 if [ -r $t/settings ] ; then
55 join -t\ $t/settings $t/settings.target > $t/settings.new
56 mv $t/settings.new $t/settings
58 mv $t/settings.target $t/settings
62 while read opt targets ; do
63 if [ "${targets}" = "${ALL_TARGETS}" ] ; then
65 elif [ -z "${targets}" ] ; then
68 echo "WITHOUT_${opt}" $(no_targets "${ALL_TARGETS}" "${targets}")
69 echo "WITH_${opt} ${targets}"
75 # usage: show { settings | with | without } ...
95 echo 'internal error' >&2
99 env -i ${make} "$@" showconfig __MAKE_CONF=/dev/null |
100 while read var _ val ; do
104 echo ${yes_prefix}_${opt}
107 echo ${no_prefix}_${opt}
110 echo 'make showconfig broken' >&2
124 .\" DO NOT EDIT-- this file is automatically generated.
127 .Dd $(echo $(LC_TIME=C date +'%B %e, %Y'))
132 .Nd "source build options"
136 file contains settings that will apply to every build involving the
143 file uses the standard makefile syntax.
146 should not specify any dependencies to
152 variables that control the aspects of how the system builds.
154 The default location of
158 though an alternative location can be specified in the
162 Overriding the location of
164 may be necessary if the system-wide settings are not suitable
165 for a particular build.
166 For instance, setting
170 effectively resets all build controls to their defaults.
174 is to control the compilation of the
176 source code, which is usually located in
178 As a rule, the system administrator creates
180 when the values of certain control variables need to be changed
183 In addition, control variables can be specified
184 for a particular build via the
188 or in its environment; see
191 The values of variables are ignored regardless of their setting;
192 even if they would be set to
196 Just the existence of an option will cause
200 The following list provides a name and short description for variables
201 that can be used for source builds.
202 .Bl -tag -width indent
204 show settings SRCCONF=/dev/null | sort > $t/config_default
205 # Work around WITH_LDNS_UTILS forcing BIND_UTILS off by parsing the
206 # actual config that results from enabling every WITH_ option. This
207 # can be reverted if/when we no longer have options that disable
209 show with SRCCONF=/dev/null | sort | sed 's/$/=/' > $t/src.conf
210 show settings SRCCONF=$t/src.conf | sort > $t/config_WITH_ALL
211 show without SRCCONF=/dev/null | sort > $t/config_WITHOUT_ALL
214 while read opt targets ; do
215 if [ ! -f ${opt} ] ; then
216 echo "no description found for ${opt}, skipping" >&2
221 sed -e's/\$\(FreeBSD: .*\) \$/from \1/' ${opt}
222 if [ -n "${targets}" ] ; then
224 echo 'It is a default setting on'
225 echo $(echo ${targets} | sed -e's/ /, /g' -e's/\(.*\), /\1 and /').
228 if [ "${opt%%_*}" = 'WITHOUT' ] ; then
229 sed -n "/^WITH_${opt#WITHOUT_}$/!s/$/=/p" $t/config_WITH_ALL > $t/src.conf
230 show settings SRCCONF=$t/src.conf -D${opt} | sort > $t/config_WITH_ALL_${opt}
231 comm -13 $t/config_WITH_ALL $t/config_WITH_ALL_${opt} | sed -n "/^${opt}$/!p" > $t/deps
232 elif [ "${opt%%_*}" = 'WITH' ] ; then
233 sed -n "/^WITHOUT${opt#WITH}$/!s/$/=/p" $t/config_WITHOUT_ALL > $t/src.conf
234 show settings SRCCONF=$t/src.conf -D${opt} | sort > $t/config_WITHOUT_ALL_${opt}
235 comm -13 $t/config_WITHOUT_ALL $t/config_WITHOUT_ALL_${opt} | sed -n "/^${opt}$/!p" > $t/deps
237 echo 'internal error' >&2
241 show settings SRCCONF=/dev/null -D${opt} | sort > $t/config_${opt}
242 comm -13 $t/config_default $t/config_${opt} | sed -n "/^${opt}$/!p" |
243 comm -13 $t/deps - > $t/deps2
245 # Work around BIND_UTILS=no being the default when every WITH_
247 if [ "$(cat $t/deps2)" = WITHOUT_BIND_UTILS ]; then
248 sort $t/deps $t/deps2 > $t/_deps
254 if [ -s $t/deps ] ; then
256 echo 'When set, it also enforces the following options:'
258 echo '.Bl -item -compact'
266 if [ -s $t/deps2 ] ; then
267 if [ ${havedeps} -eq 1 ] ; then
270 echo 'When set, the following options are also in effect:'
272 echo '.Bl -inset -compact'
274 echo ".It Va ${opt2}"
275 noopt=$(echo ${opt2} | sed -e's/WITH_/WITHOUT_/;t' -e's/WITHOUT_/WITH_/')
278 echo 'is set explicitly)'
287 .Bl -tag -compact -width Pa
289 .It Pa /usr/share/mk/bsd.own.mk
302 This manual page was autogenerated.
309 local c0='|' c1='/' c2='-' c3='\'
311 eval printf '%c\\b' '$c'${twiddle_pos}
312 twiddle_pos=$(((twiddle_pos+1)%4))