]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - tools/build/options/makeman
This commit was generated by cvs2svn to compensate for changes in r161657,
[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 source code, which is usually located 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 regardless of their setting;
123 even if they would be set to
124 .Dq Li FALSE
125 or
126 .Dq Li NO .
127 Just the existence of an option will cause
128 it to be honoured by
129 .Xr make 1 .
130 .Pp
131 The following list provides a name and short description for variables
132 that can be used for source builds.
133 .Bl -tag -width indent
134 EOF
135         show settings |sort >_config
136         show options |
137         while read opt; do
138                 if [ -f ${opt} ]; then
139                         cat <<EOF
140 .It Va ${opt}
141 EOF
142                         sed -e's/\$\(FreeBSD: .*\) \$/from \1/' ${opt}
143                 else
144                         echo "no description found for ${opt}, skipping" >/dev/stderr
145                         continue
146                 fi
147                 show settings -D${opt} |sort >_config2
148                 comm -13 _config _config2 |grep -v "^${opt}$" >_deps
149                 if [ -s _deps ]; then
150                         cat <<EOF
151 When set, it also enforces the following options:
152 .Pp
153 .Bl -item -compact
154 EOF
155                         cat _deps |while read opt2; do
156                                 cat <<EOF
157 .It
158 .Va ${opt2}
159 EOF
160                         done
161                                 cat <<EOF
162 .El
163 EOF
164                 fi
165         done
166         cat <<EOF
167 .El
168 .Sh FILES
169 .Bl -tag -compact
170 .It Pa /etc/src.conf
171 .It Pa /usr/share/mk/bsd.own.mk
172 .El
173 .Sh SEE ALSO
174 .Xr make 1 ,
175 .Xr make.conf 5 ,
176 .Xr build 7 ,
177 .Xr ports 7
178 .Sh HISTORY
179 The
180 .Nm
181 file appeared in
182 .Fx 7.0 .
183 .Sh AUTHORS
184 This manual page was autogenerated.
185 EOF
186 }
187
188 main