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 show with SRCCONF=/dev/null | sort > $t/config_WITH_ALL
202 show without SRCCONF=/dev/null | sort > $t/config_WITHOUT_ALL
205 while read opt targets ; do
206 if [ ! -f ${opt} ] ; then
207 echo "no description found for ${opt}, skipping" >&2
212 sed -e's/\$\(FreeBSD: .*\) \$/from \1/' ${opt}
213 if [ -n "${targets}" ] ; then
215 echo 'It is a default setting on'
216 echo $(echo ${targets} | sed -e's/ /, /g' -e's/\(.*\), /\1 and /').
219 if [ "${opt%%_*}" = 'WITHOUT' ] ; then
220 sed -n "/^WITH_${opt#WITHOUT_}$/!s/$/=/p" $t/config_WITH_ALL > $t/src.conf
221 show settings SRCCONF=$t/src.conf -D${opt} | sort > $t/config_WITH_ALL_${opt}
222 comm -13 $t/config_WITH_ALL $t/config_WITH_ALL_${opt} | sed -n "/^${opt}$/!p" > $t/deps
223 elif [ "${opt%%_*}" = 'WITH' ] ; then
224 sed -n "/^WITHOUT${opt#WITH}$/!s/$/=/p" $t/config_WITHOUT_ALL > $t/src.conf
225 show settings SRCCONF=$t/src.conf -D${opt} | sort > $t/config_WITHOUT_ALL_${opt}
226 comm -13 $t/config_WITHOUT_ALL $t/config_WITHOUT_ALL_${opt} | sed -n "/^${opt}$/!p" > $t/deps
228 echo 'internal error' >&2
232 if [ -s $t/deps ] ; then
233 echo 'When set, it also enforces the following options:'
235 echo '.Bl -item -compact'
236 cat $t/deps | while read opt2 ; do
243 show settings SRCCONF=/dev/null -D${opt} | sort > $t/config_${opt}
244 comm -13 $t/config_default $t/config_${opt} | sed -n "/^${opt}$/!p" |
245 comm -13 $t/deps - > $t/deps2
247 if [ -s $t/deps2 ] ; then
248 if [ -s $t/deps ] ; then
251 echo 'When set, the following options are also in effect:'
253 echo '.Bl -inset -compact'
254 cat $t/deps2 | while read opt2 ; do
255 echo ".It Va ${opt2}"
256 noopt=$(echo ${opt2} | sed -e's/WITH_/WITHOUT_/;t' -e's/WITHOUT_/WITH_/')
259 echo 'is set explicitly)'
270 .It Pa /usr/share/mk/bsd.own.mk
283 This manual page was autogenerated.
290 local c0='|' c1='/' c2='-' c3='\'
292 eval printf '%c\\b' '$c'${twiddle_pos}
293 twiddle_pos=$(((twiddle_pos+1)%4))