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