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
133 .\" DO NOT EDIT-- this file is automatically generated.
136 .Dd $(echo $(LC_TIME=C date +'%B %e, %Y'))
141 .Nd "source build options"
145 file contains settings that will apply to every build involving the
152 file uses the standard makefile syntax.
155 should not specify any dependencies to
161 variables that control the aspects of how the system builds.
163 The default location of
167 though an alternative location can be specified in the
171 Overriding the location of
173 may be necessary if the system-wide settings are not suitable
174 for a particular build.
175 For instance, setting
179 effectively resets all build controls to their defaults.
183 is to control the compilation of the
185 source code, which is usually located in
187 As a rule, the system administrator creates
189 when the values of certain control variables need to be changed
192 In addition, control variables can be specified
193 for a particular build via the
197 or in its environment; see
202 for the build can be controlled via the
204 variable, which defaults to
205 .Pa /etc/src-env.conf .
206 Some examples that may only be set in this file are
207 .Va WITH_DIRDEPS_BUILD ,
210 as they are environment-only variables.
213 may be set here only when using
214 .Va WITH_DIRDEPS_BUILD .
216 The values of variables are ignored regardless of their setting;
217 even if they would be set to
221 The presence of an option causes
225 This list provides a name and short description for variables
226 that can be used for source builds.
227 .Bl -tag -width indent
229 show settings SRC_ENV_CONF=/dev/null | sort > $t/config_default
230 # Work around WITH_LDNS_UTILS forcing BIND_UTILS off by parsing the
231 # actual config that results from enabling every WITH_ option. This
232 # can be reverted if/when we no longer have options that disable
234 show with SRC_ENV_CONF=/dev/null | sort | sed 's/$/=/' > $t/src.conf
235 show settings SRC_ENV_CONF=$t/src.conf | sort > $t/config_WITH_ALL
236 show without SRC_ENV_CONF=/dev/null | sort > $t/config_WITHOUT_ALL
237 env_only_options="$(${make} -V __ENV_ONLY_OPTIONS)"
240 while read opt targets ; do
241 if [ ! -f ${opt} ] ; then
242 echo "no description found for ${opt}, skipping" >&2
247 sed -e's/\$\(FreeBSD: .*\) \$/from \1/' ${opt}
248 if [ -n "${targets}" ] ; then
250 echo 'This is a default setting on'
251 echo $(echo ${targets} | sed -e's/ /, /g' -e's/\(.*\), /\1 and /').
254 if [ "${opt%%_*}" = 'WITHOUT' ] ; then
255 sed -n "/^WITH_${opt#WITHOUT_}$/!s/$/=/p" $t/config_WITH_ALL > $t/src.conf
256 show settings SRC_ENV_CONF=$t/src.conf -D${opt} | sort > $t/config_WITH_ALL_${opt}
257 comm -13 $t/config_WITH_ALL $t/config_WITH_ALL_${opt} | sed -n "/^${opt}$/!p" > $t/deps
258 elif [ "${opt%%_*}" = 'WITH' ] ; then
259 sed -n "/^WITHOUT${opt#WITH}$/!s/$/=/p" $t/config_WITHOUT_ALL > $t/src.conf
260 show settings SRC_ENV_CONF=$t/src.conf -D${opt} | sort > $t/config_WITHOUT_ALL_${opt}
261 comm -13 $t/config_WITHOUT_ALL $t/config_WITHOUT_ALL_${opt} | sed -n "/^${opt}$/!p" > $t/deps
263 echo 'internal error' >&2
267 show settings SRC_ENV_CONF=/dev/null -D${opt} | sort > $t/config_${opt}
268 comm -13 $t/config_default $t/config_${opt} | sed -n "/^${opt}$/!p" |
269 comm -13 $t/deps - > $t/deps2
271 # Work around BIND_UTILS=no being the default when every WITH_
273 if [ "$(cat $t/deps2)" = WITHOUT_BIND_UTILS ]; then
274 sort $t/deps $t/deps2 > $t/_deps
280 if [ -s $t/deps ] ; then
282 echo 'When set, it enforces these options:'
284 echo '.Bl -item -compact'
292 if [ -s $t/deps2 ] ; then
293 if [ ${havedeps} -eq 1 ] ; then
296 echo 'When set, these options are also in effect:'
298 echo '.Bl -inset -compact'
300 echo ".It Va ${opt2}"
301 noopt=$(echo ${opt2} | sed -e's/WITH_/WITHOUT_/;t' -e's/WITHOUT_/WITH_/')
304 echo 'is set explicitly)'
309 case " ${env_only_options} " in
312 echo "This must be set in the environment, make command line, or"
313 echo ".Pa /etc/src-env.conf ,"
315 echo ".Pa /etc/src.conf ."
324 .Bl -tag -compact -width Pa
326 .It Pa /etc/src-env.conf
327 .It Pa /usr/share/mk/bsd.own.mk
340 This manual page was autogenerated.
347 local c0='|' c1='/' c2='-' c3='\'
349 eval printf '%c\\b' '$c'${twiddle_pos}
350 twiddle_pos=$(((twiddle_pos+1)%4))