3 # This file is in the public domain.
9 t=$(mktemp -d -t makeman)
10 trap 'test -d $t && rm -rf $t' exit
13 # usage: no_targets all_targets yes_targets
19 if [ "${t1}" = "${t2}" ] ; then
29 ALL_TARGETS=$(echo $(make -C ../../.. targets | tail -n +2))
31 for target in ${ALL_TARGETS} ; do
32 make -C ../../.. showconfig \
33 SRCCONF=/dev/null __MAKE_CONF=/dev/null \
34 TARGET_ARCH=${target#*/} TARGET=${target%/*} |
35 while read var _ val ; do
45 echo 'make showconfig broken' >&2
49 done > $t/settings.target
50 if [ -r $t/settings ] ; then
51 join -t\ $t/settings $t/settings.target > $t/settings.new
52 mv $t/settings.new $t/settings
54 mv $t/settings.target $t/settings
58 cat $t/settings | while read opt targets ; do
59 if [ "${targets}" = "${ALL_TARGETS}" ] ; then
61 elif [ -z "${targets}" ] ; then
64 echo "WITHOUT_${opt}" $(no_targets "${ALL_TARGETS}" "${targets}")
65 echo "WITH_${opt} ${targets}"
71 # usage: show { settings | with | without } ...
91 echo 'internal error' >&2
95 make -C ../../.. "$@" showconfig __MAKE_CONF=/dev/null |
96 while read var _ val ; do
100 echo ${yes_prefix}_${opt}
103 echo ${no_prefix}_${opt}
106 echo 'make showconfig broken' >&2
120 .\" DO NOT EDIT-- this file is automatically generated.
123 .Dd $(echo $(LC_TIME=C date +'%B %e, %Y'))
128 .Nd "source build options"
132 file contains settings that will apply to every build involving the
139 file uses the standard makefile syntax.
142 should not specify any dependencies to
148 variables that control the aspects of how the system builds.
150 The default location of
154 though an alternative location can be specified in the
158 Overriding the location of
160 may be necessary if the system-wide settings are not suitable
161 for a particular build.
162 For instance, setting
166 effectively resets all build controls to their defaults.
170 is to control the compilation of the
172 source code, which is usually located in
174 As a rule, the system administrator creates
176 when the values of certain control variables need to be changed
179 In addition, control variables can be specified
180 for a particular build via the
184 or in its environment; see
187 The values of variables are ignored regardless of their setting;
188 even if they would be set to
192 Just the existence of an option will cause
196 The following list provides a name and short description for variables
197 that can be used for source builds.
198 .Bl -tag -width indent
200 show settings SRCCONF=/dev/null | sort > $t/config_default
201 # Work around WITH_LDNS_UTILS forcing BIND_UTILS off by parsing the
202 # actual config that results from enabling every WITH_ option. This
203 # can be reverted if/when we no longer have options that disable
205 show with SRCCONF=/dev/null | sort | sed 's/$/=/' > $t/src.conf
206 show settings SRCCONF=$t/src.conf | sort > $t/config_WITH_ALL
207 show without SRCCONF=/dev/null | sort > $t/config_WITHOUT_ALL
210 while read opt targets ; do
211 if [ ! -f ${opt} ] ; then
212 echo "no description found for ${opt}, skipping" >&2
217 sed -e's/\$\(FreeBSD: .*\) \$/from \1/' ${opt}
218 if [ -n "${targets}" ] ; then
220 echo 'It is a default setting on'
221 echo $(echo ${targets} | sed -e's/ /, /g' -e's/\(.*\), /\1 and /').
224 if [ "${opt%%_*}" = 'WITHOUT' ] ; then
225 sed -n "/^WITH_${opt#WITHOUT_}$/!s/$/=/p" $t/config_WITH_ALL > $t/src.conf
226 show settings SRCCONF=$t/src.conf -D${opt} | sort > $t/config_WITH_ALL_${opt}
227 comm -13 $t/config_WITH_ALL $t/config_WITH_ALL_${opt} | sed -n "/^${opt}$/!p" > $t/deps
228 elif [ "${opt%%_*}" = 'WITH' ] ; then
229 sed -n "/^WITHOUT${opt#WITH}$/!s/$/=/p" $t/config_WITHOUT_ALL > $t/src.conf
230 show settings SRCCONF=$t/src.conf -D${opt} | sort > $t/config_WITHOUT_ALL_${opt}
231 comm -13 $t/config_WITHOUT_ALL $t/config_WITHOUT_ALL_${opt} | sed -n "/^${opt}$/!p" > $t/deps
233 echo 'internal error' >&2
237 show settings SRCCONF=/dev/null -D${opt} | sort > $t/config_${opt}
238 comm -13 $t/config_default $t/config_${opt} | sed -n "/^${opt}$/!p" |
239 comm -13 $t/deps - > $t/deps2
241 # Work around BIND_UTILS=no being the default when every WITH_
243 if [ "$(cat $t/deps2)" = WITHOUT_BIND_UTILS ]; then
244 sort $t/deps $t/deps2 > $t/_deps
249 if [ -s $t/deps ] ; then
250 echo 'When set, it also enforces the following options:'
252 echo '.Bl -item -compact'
253 cat $t/deps | while read opt2 ; do
260 if [ -s $t/deps2 ] ; then
261 if [ -s $t/deps ] ; then
264 echo 'When set, the following options are also in effect:'
266 echo '.Bl -inset -compact'
267 cat $t/deps2 | while read opt2 ; do
268 echo ".It Va ${opt2}"
269 noopt=$(echo ${opt2} | sed -e's/WITH_/WITHOUT_/;t' -e's/WITHOUT_/WITH_/')
272 echo 'is set explicitly)'
281 .Bl -tag -compact -width Pa
283 .It Pa /usr/share/mk/bsd.own.mk
296 This manual page was autogenerated.
303 local c0='|' c1='/' c2='-' c3='\'
305 eval printf '%c\\b' '$c'${twiddle_pos}
306 twiddle_pos=$(((twiddle_pos+1)%4))