1c5922fbfSRuslan Ermilov#!/bin/sh 2c5922fbfSRuslan Ermilov# 3c5922fbfSRuslan Ermilov# This file is in the public domain. 4c5922fbfSRuslan Ermilov 5c5922fbfSRuslan Ermilovident='$FreeBSD$' 6c5922fbfSRuslan Ermilov 7c5922fbfSRuslan Ermilov# 8c5922fbfSRuslan Ermilov# show settings | options 9c5922fbfSRuslan Ermilov# 10c5922fbfSRuslan Ermilovshow() 11c5922fbfSRuslan Ermilov{ 12c5922fbfSRuslan Ermilov 13c5922fbfSRuslan Ermilov mode=$1; shift 14c5922fbfSRuslan Ermilov case ${mode} in 15c5922fbfSRuslan Ermilov settings) 16c5922fbfSRuslan Ermilov yes_prefix=WITH 17c5922fbfSRuslan Ermilov no_prefix=WITHOUT 18c5922fbfSRuslan Ermilov ;; 19c5922fbfSRuslan Ermilov options) 20c5922fbfSRuslan Ermilov yes_prefix=WITHOUT 21c5922fbfSRuslan Ermilov no_prefix=WITH 22c5922fbfSRuslan Ermilov ;; 23c5922fbfSRuslan Ermilov *) 24c5922fbfSRuslan Ermilov echo "internal error" >/dev/stderr 25c5922fbfSRuslan Ermilov exit 1 26c5922fbfSRuslan Ermilov ;; 27c5922fbfSRuslan Ermilov esac 28c5922fbfSRuslan Ermilov make "$@" -f ../../../share/mk/bsd.own.mk SRCCONF=/dev/null -V_ -dg1 | 29c5922fbfSRuslan Ermilov grep ^MK_ |sort | 30c5922fbfSRuslan Ermilov while read var _ val; do 31c5922fbfSRuslan Ermilov opt=${var#MK_} 32c5922fbfSRuslan Ermilov case ${val} in 33c5922fbfSRuslan Ermilov yes) 34c5922fbfSRuslan Ermilov echo ${yes_prefix}_${opt} 35c5922fbfSRuslan Ermilov ;; 36c5922fbfSRuslan Ermilov no) 37c5922fbfSRuslan Ermilov echo ${no_prefix}_${opt} 38c5922fbfSRuslan Ermilov ;; 39c5922fbfSRuslan Ermilov *) 40c5922fbfSRuslan Ermilov echo "make showconfig broken" >/dev/stderr 41c5922fbfSRuslan Ermilov exit 1 42c5922fbfSRuslan Ermilov ;; 43c5922fbfSRuslan Ermilov esac 44c5922fbfSRuslan Ermilov done 45c5922fbfSRuslan Ermilov} 46c5922fbfSRuslan Ermilov 47c5922fbfSRuslan Ermilovmain() 48c5922fbfSRuslan Ermilov{ 49c5922fbfSRuslan Ermilov 50c5922fbfSRuslan Ermilov trap 'rm -f _config _config2 _deps' exit 51c5922fbfSRuslan Ermilov ident=${ident#$} 52c5922fbfSRuslan Ermilov ident=${ident% $} 53c5922fbfSRuslan Ermilov fbsdid='$FreeBSD$' 54c5922fbfSRuslan Ermilov cat <<EOF 55c5922fbfSRuslan Ermilov.\" DO NOT EDIT-- this file is automatically generated. 56c5922fbfSRuslan Ermilov.\" from ${ident} 57c5922fbfSRuslan Ermilov.\" ${fbsdid} 58c5922fbfSRuslan Ermilov.Dd $(LC_TIME=C date +'%B %e, %Y') 59c5922fbfSRuslan Ermilov.Dt SRC.CONF 5 60c5922fbfSRuslan Ermilov.Os 61c5922fbfSRuslan Ermilov.Sh NAME 62c5922fbfSRuslan Ermilov.Nm src.conf 63c5922fbfSRuslan Ermilov.Nd source build options 64c5922fbfSRuslan Ermilov.Sh DESCRIPTION 65c5922fbfSRuslan ErmilovThe 66c5922fbfSRuslan Ermilov.Nm 67c5922fbfSRuslan Ermilovfile contains settings that will apply to every build involving the 68c5922fbfSRuslan Ermilov.Fx 69c5922fbfSRuslan Ermilovsource tree; see 70c5922fbfSRuslan Ermilov.Xr build 7 . 71c5922fbfSRuslan Ermilov.Pp 72c5922fbfSRuslan ErmilovThe 73c5922fbfSRuslan Ermilov.Nm 74c5922fbfSRuslan Ermilovfile uses the standard makefile syntax. 75c5922fbfSRuslan ErmilovHowever, 76c5922fbfSRuslan Ermilov.Nm 77c5922fbfSRuslan Ermilovshould not specify any dependencies to 78c5922fbfSRuslan Ermilov.Xr make 1 . 79c5922fbfSRuslan ErmilovInstead, 80c5922fbfSRuslan Ermilov.Nm 81c5922fbfSRuslan Ermilovis to set 82c5922fbfSRuslan Ermilov.Xr make 1 83c5922fbfSRuslan Ermilovvariables that control the aspects of how the system builds. 84c5922fbfSRuslan Ermilov.Pp 85c5922fbfSRuslan ErmilovThe default location of 86c5922fbfSRuslan Ermilov.Nm 87c5922fbfSRuslan Ermilovis 88c5922fbfSRuslan Ermilov.Pa /etc/src.conf , 89c5922fbfSRuslan Ermilovthough an alternative location can be specified in the 90c5922fbfSRuslan Ermilov.Xr make 1 91c5922fbfSRuslan Ermilovvariable 92c5922fbfSRuslan Ermilov.Va SRCCONF . 93c5922fbfSRuslan ErmilovOverriding the location of 94c5922fbfSRuslan Ermilov.Nm 95c5922fbfSRuslan Ermilovmaybe necessary if the system-wide settings are not suitable 96c5922fbfSRuslan Ermilovfor a particular build. 97c5922fbfSRuslan ErmilovFor instance, setting 98c5922fbfSRuslan Ermilov.Va SRCCONF 99c5922fbfSRuslan Ermilovto 100c5922fbfSRuslan Ermilov.Pa /dev/null 101c5922fbfSRuslan Ermiloveffectively resets all build controls to their defaults. 102c5922fbfSRuslan Ermilov.Pp 103c5922fbfSRuslan ErmilovThe only purpose of 104c5922fbfSRuslan Ermilov.Nm 105c5922fbfSRuslan Ermilovis to control the compilation of the 106c5922fbfSRuslan Ermilov.Fx 107c5922fbfSRuslan Ermilovsources, which are usually found in 108c5922fbfSRuslan Ermilov.Pa /usr/src . 109c5922fbfSRuslan ErmilovAs a rule, the system administrator creates 110c5922fbfSRuslan Ermilov.Nm 111c5922fbfSRuslan Ermilovwhen the values of certain control variables need to be changed 112c5922fbfSRuslan Ermilovfrom their defaults. 113c5922fbfSRuslan Ermilov.Pp 114c5922fbfSRuslan ErmilovIn addition, control variables can be specified 115c5922fbfSRuslan Ermilovfor a particular build via the 116c5922fbfSRuslan Ermilov.Fl D 117c5922fbfSRuslan Ermilovoption of 118c5922fbfSRuslan Ermilov.Xr make 1 119c5922fbfSRuslan Ermilovor in environment; see 120c5922fbfSRuslan Ermilov.Xr environ 7 . 121c5922fbfSRuslan Ermilov.Pp 122c5922fbfSRuslan ErmilovThe values of variables are ignored; the variable being 123c5922fbfSRuslan Ermilovset at all (even to 124c5922fbfSRuslan Ermilov.Dq Li FALSE 125c5922fbfSRuslan Ermilovor 126c5922fbfSRuslan Ermilov.Dq Li NO ) 127c5922fbfSRuslan Ermilovcauses it to be treated as if it was set with no value. 128c5922fbfSRuslan Ermilov.Pp 129c5922fbfSRuslan ErmilovThe following list provides a name and short description for variables 130c5922fbfSRuslan Ermilovthat can be used for source builds. 131c5922fbfSRuslan Ermilov.Bl -tag -width indent 132c5922fbfSRuslan ErmilovEOF 133c5922fbfSRuslan Ermilov show settings |sort >_config 134c5922fbfSRuslan Ermilov show options | 135c5922fbfSRuslan Ermilov while read opt; do 136c5922fbfSRuslan Ermilov if [ -f ${opt} ]; then 137c5922fbfSRuslan Ermilov cat <<EOF 138c5922fbfSRuslan Ermilov.It Va ${opt} 139c5922fbfSRuslan ErmilovEOF 140c5922fbfSRuslan Ermilov sed -e's/\$\(FreeBSD: .*\) \$/from \1/' ${opt} 141c5922fbfSRuslan Ermilov else 142c5922fbfSRuslan Ermilov echo "no description found for ${opt}, skipping" >/dev/stderr 143c5922fbfSRuslan Ermilov fi 144c5922fbfSRuslan Ermilov show settings -D${opt} |sort >_config2 145c5922fbfSRuslan Ermilov comm -13 _config _config2 |grep -v "^${opt}$" >_deps 146c5922fbfSRuslan Ermilov if [ -s _deps ]; then 147c5922fbfSRuslan Ermilov cat <<EOF 148c5922fbfSRuslan ErmilovWhen set, it also enforces the following options: 149c5922fbfSRuslan Ermilov.Pp 150c5922fbfSRuslan Ermilov.Bl -item -compact 151c5922fbfSRuslan ErmilovEOF 152c5922fbfSRuslan Ermilov cat _deps |while read opt2; do 153c5922fbfSRuslan Ermilov cat <<EOF 154c5922fbfSRuslan Ermilov.It 155c5922fbfSRuslan Ermilov.Va ${opt2} 156c5922fbfSRuslan ErmilovEOF 157c5922fbfSRuslan Ermilov done 158c5922fbfSRuslan Ermilov cat <<EOF 159c5922fbfSRuslan Ermilov.El 160c5922fbfSRuslan ErmilovEOF 161c5922fbfSRuslan Ermilov fi 162c5922fbfSRuslan Ermilov done 163c5922fbfSRuslan Ermilov cat <<EOF 164c5922fbfSRuslan Ermilov.El 165c5922fbfSRuslan Ermilov.Sh FILES 166c5922fbfSRuslan Ermilov.Bl -tag -compact 167c5922fbfSRuslan Ermilov.It Pa /etc/src.conf 168c5922fbfSRuslan Ermilov.It Pa /usr/share/mk/bsd.own.mk 169c5922fbfSRuslan Ermilov.El 170c5922fbfSRuslan Ermilov.Sh SEE ALSO 171c5922fbfSRuslan Ermilov.Xr make 1 , 172c5922fbfSRuslan Ermilov.Xr make.conf 5 , 173c5922fbfSRuslan Ermilov.Xr build 7 , 174c5922fbfSRuslan Ermilov.Xr ports 7 175c5922fbfSRuslan Ermilov.Sh HISTORY 176c5922fbfSRuslan ErmilovThe 177c5922fbfSRuslan Ermilov.Nm 178c5922fbfSRuslan Ermilovfile appeared in 179c5922fbfSRuslan Ermilov.Fx 7.0 . 180c5922fbfSRuslan Ermilov.Sh AUTHORS 181c5922fbfSRuslan ErmilovThis manual page was autogenerated. 182c5922fbfSRuslan ErmilovEOF 183c5922fbfSRuslan Ermilov} 184c5922fbfSRuslan Ermilov 185c5922fbfSRuslan Ermilovmain 186