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
37 env -i ${make} showconfig \
38 SRC_ENV_CONF=/dev/null SRCCONF=/dev/null \
39 __MAKE_CONF=/dev/null \
40 TARGET_ARCH=${target#*/} TARGET=${target%/*} |
41 while read var _ val ; do
43 if [ $opt = "$prev_opt" ]; then
44 echo "$target: ignoring duplicate option $opt" >&2
56 echo "make showconfig broken: ${var} ${_} ${val} (not yes or no)" >&2
60 done > $t/settings.target
61 if [ -r $t/settings ] ; then
62 join -t\ $t/settings $t/settings.target > $t/settings.new
63 mv $t/settings.new $t/settings
65 mv $t/settings.target $t/settings
69 while read opt targets ; do
70 if [ "${targets}" = "${ALL_TARGETS}" ] ; then
72 elif [ -z "${targets}" ] ; then
75 echo "WITHOUT_${opt}" $(no_targets "${ALL_TARGETS}" "${targets}")
76 echo "WITH_${opt} ${targets}"
82 # usage: show { settings | with | without } ...
102 echo 'internal error' >&2
106 env -i ${make} .MAKE.MODE=normal "$@" showconfig __MAKE_CONF=/dev/null \
108 while read var _ val ; do
112 echo ${yes_prefix}_${opt}
115 echo ${no_prefix}_${opt}
118 echo "make showconfig broken: ${var} ${_} ${val} (not yes or no)" >&2
127 echo "building src.conf.5 man page from files in ${PWD}" >&2
131 .\" DO NOT EDIT-- this file is automatically generated.
133 .Dd $(echo $(LC_TIME=C date +'%B %e, %Y'))
138 .Nd "source build options"
142 file contains settings that will apply to every build involving the
149 file uses the standard makefile syntax.
152 should not specify any dependencies to
158 variables that control the aspects of how the system builds.
160 The default location of
164 though an alternative location can be specified in the
168 Overriding the location of
170 may be necessary if the system-wide settings are not suitable
171 for a particular build.
172 For instance, setting
176 effectively resets all build controls to their defaults.
180 is to control the compilation of the
182 source code, which is usually located in
184 As a rule, the system administrator creates
186 when the values of certain control variables need to be changed
189 In addition, control variables can be specified
190 for a particular build via the
194 or in its environment; see
199 for the build can be controlled via the
201 variable, which defaults to
202 .Pa /etc/src-env.conf .
203 Some examples that may only be set in this file are
204 .Va WITH_DIRDEPS_BUILD ,
207 as they are environment-only variables.
210 may be set here only when using
211 .Va WITH_DIRDEPS_BUILD .
213 The values of variables are ignored regardless of their setting;
214 even if they would be set to
218 The presence of an option causes
222 This list provides a name and short description for variables
223 that can be used for source builds.
224 .Bl -tag -width indent
226 show settings SRC_ENV_CONF=/dev/null | sort > $t/config_default
227 # Work around WITH_LDNS_UTILS forcing BIND_UTILS off by parsing the
228 # actual config that results from enabling every WITH_ option. This
229 # can be reverted if/when we no longer have options that disable
231 show with SRC_ENV_CONF=/dev/null | sort | sed 's/$/=/' > $t/src.conf
232 show settings SRC_ENV_CONF=$t/src.conf | sort > $t/config_WITH_ALL
233 show without SRC_ENV_CONF=/dev/null | sort > $t/config_WITHOUT_ALL
234 env_only_options="$(${make} -V __ENV_ONLY_OPTIONS)"
237 while read opt targets ; do
238 if [ ! -f ${opt} ] ; then
239 echo "no description found for ${opt}, skipping" >&2
244 sed -e'/\$FreeBSD.*\$/d' ${opt}
245 if [ -n "${targets}" ] ; then
247 echo 'This is a default setting on'
248 echo $(echo ${targets} | sed -e's/ /, /g' -e's/\(.*\), /\1 and /').
251 if [ "${opt%%_*}" = 'WITHOUT' ] ; then
252 sed -n "/^WITH_${opt#WITHOUT_}$/!s/$/=/p" $t/config_WITH_ALL > $t/src.conf
253 show settings SRC_ENV_CONF=$t/src.conf -D${opt} | sort > $t/config_WITH_ALL_${opt}
254 comm -13 $t/config_WITH_ALL $t/config_WITH_ALL_${opt} | sed -n "/^${opt}$/!p" > $t/deps
255 elif [ "${opt%%_*}" = 'WITH' ] ; then
256 sed -n "/^WITHOUT${opt#WITH}$/!s/$/=/p" $t/config_WITHOUT_ALL > $t/src.conf
257 show settings SRC_ENV_CONF=$t/src.conf -D${opt} | sort > $t/config_WITHOUT_ALL_${opt}
258 comm -13 $t/config_WITHOUT_ALL $t/config_WITHOUT_ALL_${opt} | sed -n "/^${opt}$/!p" > $t/deps
260 echo 'internal error' >&2
264 show settings SRC_ENV_CONF=/dev/null -D${opt} | sort > $t/config_${opt}
265 comm -13 $t/config_default $t/config_${opt} | sed -n "/^${opt}$/!p" |
266 comm -13 $t/deps - > $t/deps2
268 # Work around BIND_UTILS=no being the default when every WITH_
270 if [ "$(cat $t/deps2)" = WITHOUT_BIND_UTILS ]; then
271 sort $t/deps $t/deps2 > $t/_deps
277 if [ -s $t/deps ] ; then
279 echo 'When set, it enforces these options:'
281 echo '.Bl -item -compact'
289 if [ -s $t/deps2 ] ; then
290 if [ ${havedeps} -eq 1 ] ; then
293 echo 'When set, these options are also in effect:'
295 echo '.Bl -inset -compact'
297 echo ".It Va ${opt2}"
298 noopt=$(echo ${opt2} | sed -e's/WITH_/WITHOUT_/;t' -e's/WITHOUT_/WITH_/')
301 echo 'is set explicitly)'
306 case " ${env_only_options} " in
309 echo "This must be set in the environment, make command line, or"
310 echo ".Pa /etc/src-env.conf ,"
312 echo ".Pa /etc/src.conf ."
321 .Bl -tag -compact -width Pa
323 .It Pa /etc/src-env.conf
324 .It Pa /usr/share/mk/bsd.own.mk
337 This manual page was autogenerated by
338 .An tools/build/options/makeman .
345 local c0='|' c1='/' c2='-' c3='\'
347 eval printf '%c\\b' '$c'${twiddle_pos}
348 twiddle_pos=$(((twiddle_pos+1)%4))