| @@ -1,407 +1,446 @@ | | | @@ -1,407 +1,446 @@ |
1 | <!-- $NetBSD: configuring.xml,v 1.32 2009/01/28 23:31:39 abs Exp $ --> | | 1 | <!-- $NetBSD: configuring.xml,v 1.33 2009/03/05 13:08:02 imil Exp $ --> |
2 | | | 2 | |
3 | <chapter id="configuring"> | | 3 | <chapter id="configuring"> |
4 | <title>Configuring pkgsrc</title> | | 4 | <title>Configuring pkgsrc</title> |
5 | | | 5 | |
6 | <anchor id="mk.conf" /> | | 6 | <anchor id="mk.conf" /> |
7 | | | 7 | |
8 | <para>The whole pkgsrc system is configured in a single file, usually | | 8 | <para>The whole pkgsrc system is configured in a single file, usually |
9 | called <filename>mk.conf</filename>. In which directory pkgsrc looks for | | 9 | called <filename>mk.conf</filename>. In which directory pkgsrc looks for |
10 | that file depends on the installation. On NetBSD, when you use | | 10 | that file depends on the installation. On NetBSD, when you use |
11 | &man.make.1; from the base system, it is in the directory | | 11 | &man.make.1; from the base system, it is in the directory |
12 | <filename>/etc/</filename>. In all other cases the default location is | | 12 | <filename>/etc/</filename>. In all other cases the default location is |
13 | <literal>${PREFIX}/etc/</literal>, depending on where you told the | | 13 | <literal>${PREFIX}/etc/</literal>, depending on where you told the |
14 | bootstrap program to install the binary packages.</para> | | 14 | bootstrap program to install the binary packages.</para> |
15 | | | 15 | |
16 | <para>During the bootstrap, an example configuration file is created. To | | 16 | <para>During the bootstrap, an example configuration file is created. To |
17 | use that, you have to create the directory | | 17 | use that, you have to create the directory |
18 | <filename>${PREFIX}/etc</filename> and copy the example file | | 18 | <filename>${PREFIX}/etc</filename> and copy the example file |
19 | there.</para> | | 19 | there.</para> |
20 | | | 20 | |
21 | <para>The format of the configuration file is that of the usual | | 21 | <para>The format of the configuration file is that of the usual |
22 | BSD-style <filename>Makefile</filename>s. The whole pkgsrc configuration | | 22 | BSD-style <filename>Makefile</filename>s. The whole pkgsrc configuration |
23 | is done by setting variables in this file. Note that you can define all | | 23 | is done by setting variables in this file. Note that you can define all |
24 | kinds of variables, and no special error checking (for example for | | 24 | kinds of variables, and no special error checking (for example for |
25 | spelling mistakes) takes place, so you have to try it out to see if it | | 25 | spelling mistakes) takes place, so you have to try it out to see if it |
26 | works.</para> | | 26 | works.</para> |
27 | | | 27 | |
28 | <sect1 id="general-configuration"> | | 28 | <sect1 id="general-configuration"> |
29 | <title>General configuration</title> | | 29 | <title>General configuration</title> |
30 | | | 30 | |
31 | <para>In this section, you can find some variables that apply to all | | 31 | <para>In this section, you can find some variables that apply to all |
32 | pkgsrc packages. A complete list of the variables that can be | | 32 | pkgsrc packages. A complete list of the variables that can be |
33 | configured by the user is available in | | 33 | configured by the user is available in |
34 | <filename>mk/defaults/mk.conf</filename>, together with some | | 34 | <filename>mk/defaults/mk.conf</filename>, together with some |
35 | comments that describe each variable's intent.</para> | | 35 | comments that describe each variable's intent.</para> |
36 | | | 36 | |
37 | <itemizedlist> | | 37 | <itemizedlist> |
38 | <listitem><para><varname>LOCALBASE</varname>: Where | | 38 | <listitem><para><varname>LOCALBASE</varname>: Where |
39 | packages will be installed. The default is | | 39 | packages will be installed. The default is |
40 | <filename>/usr/pkg</filename>. Do not mix binary packages | | 40 | <filename>/usr/pkg</filename>. Do not mix binary packages |
41 | with different <varname>LOCALBASE</varname>s!</para> | | 41 | with different <varname>LOCALBASE</varname>s!</para> |
42 | </listitem> | | 42 | </listitem> |
43 | <listitem><para><varname>CROSSBASE</varname>: Where | | 43 | <listitem><para><varname>CROSSBASE</varname>: Where |
44 | <quote>cross</quote> category packages will be | | 44 | <quote>cross</quote> category packages will be |
45 | installed. The default is | | 45 | installed. The default is |
46 | <filename>${LOCALBASE}/cross</filename>.</para> | | 46 | <filename>${LOCALBASE}/cross</filename>.</para> |
47 | </listitem> | | 47 | </listitem> |
48 | <listitem><para><varname>X11BASE</varname>: Where | | 48 | <listitem><para><varname>X11BASE</varname>: Where |
49 | X11 is installed on the system. The default is | | 49 | X11 is installed on the system. The default is |
50 | <filename>/usr/X11R6</filename>.</para> | | 50 | <filename>/usr/X11R6</filename>.</para> |
51 | </listitem> | | 51 | </listitem> |
52 | <listitem><para><varname>DISTDIR</varname>: Where to store the | | 52 | <listitem><para><varname>DISTDIR</varname>: Where to store the |
53 | downloaded copies of the original source distributions used | | 53 | downloaded copies of the original source distributions used |
54 | for building pkgsrc packages. The default is | | 54 | for building pkgsrc packages. The default is |
55 | <filename>${PKGSRCDIR}/distfiles</filename>.</para> | | 55 | <filename>${PKGSRCDIR}/distfiles</filename>.</para> |
56 | </listitem> | | 56 | </listitem> |
57 | <listitem><para><varname>PKG_DBDIR</varname>: Where the | | 57 | <listitem><para><varname>PKG_DBDIR</varname>: Where the |
58 | database about installed packages is stored. The default is | | 58 | database about installed packages is stored. The default is |
59 | <filename>/var/db/pkg</filename>.</para> | | 59 | <filename>/var/db/pkg</filename>.</para> |
60 | </listitem> | | 60 | </listitem> |
61 | <listitem><para><varname>MASTER_SITE_OVERRIDE</varname>: | | 61 | <listitem><para><varname>MASTER_SITE_OVERRIDE</varname>: |
62 | If set, override the packages' | | 62 | If set, override the packages' |
63 | <varname>MASTER_SITES</varname> with this value.</para> | | 63 | <varname>MASTER_SITES</varname> with this value.</para> |
64 | </listitem> | | 64 | </listitem> |
65 | <listitem><para><varname>MASTER_SITE_BACKUP</varname>: | | 65 | <listitem><para><varname>MASTER_SITE_BACKUP</varname>: |
66 | Backup location(s) for distribution files and patch files | | 66 | Backup location(s) for distribution files and patch files |
67 | if not found locally or in | | 67 | if not found locally or in |
68 | <filename>${MASTER_SITES}</filename> or | | 68 | <filename>${MASTER_SITES}</filename> or |
69 | <filename>${PATCH_SITES}</filename> respectively. | | 69 | <filename>${PATCH_SITES}</filename> respectively. |
70 | The defaults are | | 70 | The defaults are |
71 | <filename>ftp://ftp.NetBSD.org/pub/NetBSD/packages/distfiles/${DIST_SUBDIR}/</filename> | | 71 | <filename>ftp://ftp.NetBSD.org/pub/NetBSD/packages/distfiles/${DIST_SUBDIR}/</filename> |
72 | and | | 72 | and |
73 | <filename>ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/</filename>.</para> | | 73 | <filename>ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/</filename>.</para> |
74 | </listitem> | | 74 | </listitem> |
75 | <listitem><para><varname>BINPKG_SITES</varname>: | | 75 | <listitem><para><varname>BINPKG_SITES</varname>: |
76 | List of sites carrying binary pkgs. <replaceable>rel</replaceable> and | | 76 | List of sites carrying binary pkgs. <replaceable>rel</replaceable> and |
77 | <replaceable>arch</replaceable> are replaced with OS | | 77 | <replaceable>arch</replaceable> are replaced with OS |
78 | release (<quote>2.0</quote>, etc.) and architecture | | 78 | release (<quote>2.0</quote>, etc.) and architecture |
79 | (<quote>mipsel</quote>, etc.).</para> | | 79 | (<quote>mipsel</quote>, etc.).</para> |
80 | </listitem> | | 80 | </listitem> |
81 | <listitem><para><varname>ACCEPTABLE_LICENSES</varname>: | | 81 | <listitem><para><varname>ACCEPTABLE_LICENSES</varname>: |
82 | List of acceptable licenses. Whenever you try to build a package | | 82 | List of acceptable licenses. Whenever you try to build a package |
83 | whose license is not in this list, you will get an error message | | 83 | whose license is not in this list, you will get an error message |
84 | that includes instructions on how to change this variable.</para> | | 84 | that includes instructions on how to change this variable.</para> |
85 | </listitem> | | 85 | </listitem> |
86 | </itemizedlist> | | 86 | </itemizedlist> |
87 | </sect1> | | 87 | </sect1> |
88 | | | 88 | |
89 | <sect1 id="variables-affecting-build"> | | 89 | <sect1 id="variables-affecting-build"> |
90 | <title>Variables affecting the build process</title> | | 90 | <title>Variables affecting the build process</title> |
91 | <para>XXX | | 91 | <para>XXX |
92 | <itemizedlist> | | 92 | <itemizedlist> |
93 | <listitem><para><varname>PACKAGES</varname>: The top level | | 93 | <listitem><para><varname>PACKAGES</varname>: The top level |
94 | directory for the binary packages. The default is | | 94 | directory for the binary packages. The default is |
95 | <filename>${PKGSRCDIR}/packages</filename>.</para> | | 95 | <filename>${PKGSRCDIR}/packages</filename>.</para> |
96 | </listitem> | | 96 | </listitem> |
97 | <listitem><para><varname>WRKOBJDIR</varname>: | | 97 | <listitem><para><varname>WRKOBJDIR</varname>: |
98 | The top level directory where, if defined, the separate | | 98 | The top level directory where, if defined, the separate |
99 | working directories will get created, and symbolically | | 99 | working directories will get created, and symbolically |
100 | linked to from <filename>${WRKDIR}</filename> (see below). | | 100 | linked to from <filename>${WRKDIR}</filename> (see below). |
101 | This is useful for building packages on several | | 101 | This is useful for building packages on several |
102 | architectures, then <filename>${PKGSRCDIR}</filename> | | 102 | architectures, then <filename>${PKGSRCDIR}</filename> |
103 | can be NFS-mounted while <filename>${WRKOBJDIR}</filename> | | 103 | can be NFS-mounted while <filename>${WRKOBJDIR}</filename> |
104 | is local to every architecture. (It should be noted that | | 104 | is local to every architecture. (It should be noted that |
105 | <varname>PKGSRCDIR</varname> should not be set by the user | | 105 | <varname>PKGSRCDIR</varname> should not be set by the user |
106 | — it is an internal definition which refers to the | | 106 | — it is an internal definition which refers to the |
107 | root of the pkgsrc tree. It is possible to have many | | 107 | root of the pkgsrc tree. It is possible to have many |
108 | pkgsrc tree instances.)</para> | | 108 | pkgsrc tree instances.)</para> |
109 | </listitem> | | 109 | </listitem> |
110 | <listitem><para><varname>LOCALPATCHES</varname>: | | 110 | <listitem><para><varname>LOCALPATCHES</varname>: |
111 | Directory for local patches that aren't part of pkgsrc. | | 111 | Directory for local patches that aren't part of pkgsrc. |
112 | See <xref linkend="components.patches" /> for more | | 112 | See <xref linkend="components.patches" /> for more |
113 | information.</para> | | 113 | information.</para> |
114 | </listitem> | | 114 | </listitem> |
115 | <listitem><para><varname>PKGMAKECONF</varname>: Location of | | 115 | <listitem><para><varname>PKGMAKECONF</varname>: Location of |
116 | the &mk.conf; file used by a package's | | 116 | the &mk.conf; file used by a package's |
117 | BSD-style Makefile. If this is not set, | | 117 | BSD-style Makefile. If this is not set, |
118 | <varname>MAKECONF</varname> is set to | | 118 | <varname>MAKECONF</varname> is set to |
119 | <filename>/dev/null</filename> to avoid picking up | | 119 | <filename>/dev/null</filename> to avoid picking up |
120 | settings used by builds in <filename>/usr/src</filename>.</para> | | 120 | settings used by builds in <filename>/usr/src</filename>.</para> |
121 | </listitem> | | 121 | </listitem> |
122 | <listitem><para><varname>DEPENDS_TARGET</varname>: | | 122 | <listitem><para><varname>DEPENDS_TARGET</varname>: |
123 | By default, dependencies are only installed, and no binary | | 123 | By default, dependencies are only installed, and no binary |
124 | package is created for them. You can set this variable to | | 124 | package is created for them. You can set this variable to |
125 | <literal>package</literal> to automatically create binary | | 125 | <literal>package</literal> to automatically create binary |
126 | packages after installing dependencies.</para> | | 126 | packages after installing dependencies.</para> |
127 | </listitem> | | 127 | </listitem> |
128 | | | 128 | |
129 | <!-- DISTDIR --> | | 129 | <!-- DISTDIR --> |
130 | <!-- FAILOVER_FETCH --> | | 130 | <!-- FAILOVER_FETCH --> |
131 | </itemizedlist></para> | | 131 | </itemizedlist></para> |
132 | </sect1> | | 132 | </sect1> |
133 | | | 133 | |
134 | <sect1 id="variables-affecting-installation"> | | 134 | <sect1 id="variables-affecting-installation"> |
135 | <title>Variables affecting the installation process</title> | | 135 | <title>Variables affecting the installation process</title> |
136 | | | 136 | |
137 | <para>A growing number of packages support installation into a | | 137 | <para>A growing number of packages support installation into a |
138 | subdirectory of <varname>WRKDIR</varname>. This allows a package | | 138 | subdirectory of <varname>WRKDIR</varname>. This allows a package |
139 | to be built, before the actual filesystem is touched. DESTDIR | | 139 | to be built, before the actual filesystem is touched. DESTDIR |
140 | support exists in two variations:</para> | | 140 | support exists in two variations:</para> |
141 | <itemizedlist> | | 141 | <itemizedlist> |
142 | <listitem><para>Basic DESTDIR support means that the package | | 142 | <listitem><para>Basic DESTDIR support means that the package |
143 | installation and packaging is still run as | | 143 | installation and packaging is still run as |
144 | root.</para></listitem> | | 144 | root.</para></listitem> |
145 | <listitem><para>Full DESTDIR support can run the complete build, | | 145 | <listitem><para>Full DESTDIR support can run the complete build, |
146 | installation and packaging as normal user. Root privileges are | | 146 | installation and packaging as normal user. Root privileges are |
147 | only needed to add packages.</para></listitem> | | 147 | only needed to add packages.</para></listitem> |
148 | </itemizedlist> | | 148 | </itemizedlist> |
149 | <para>To use the DESTDIR support, set either | | 149 | <para>To use the DESTDIR support, set either |
150 | <varname>USE_DESTDIR=yes</varname> to use the basic support for | | 150 | <varname>USE_DESTDIR=yes</varname> to use the basic support for |
151 | packages that offer it or <varname>USE_DESTDIR=full</varname> to | | 151 | packages that offer it or <varname>USE_DESTDIR=full</varname> to |
152 | get the full support with fallback to basic | | 152 | get the full support with fallback to basic |
153 | support. <varname>USE_DESTDIR=full</varname> needs <filename | | 153 | support. <varname>USE_DESTDIR=full</varname> needs <filename |
154 | role="pkg">pkgtools/pkg_install</filename> version 20070802 (or | | 154 | role="pkg">pkgtools/pkg_install</filename> version 20070802 (or |
155 | newer). It might become the default DESTDIR support later.</para> | | 155 | newer). It might become the default DESTDIR support later.</para> |
156 | <para>DESTDIR support changes the behaviour of various targets | | 156 | <para>DESTDIR support changes the behaviour of various targets |
157 | slightly. To install a package after building it, use | | 157 | slightly. To install a package after building it, use |
158 | <literal>package-install</literal>. <literal>package</literal> and | | 158 | <literal>package-install</literal>. <literal>package</literal> and |
159 | <literal>install</literal> don't do that any | | 159 | <literal>install</literal> don't do that any |
160 | longer. <literal>package-install</literal> can be used as | | 160 | longer. <literal>package-install</literal> can be used as |
161 | <varname>DEPENDS_TARGET</varname>. <literal>bin-install</literal> | | 161 | <varname>DEPENDS_TARGET</varname>. <literal>bin-install</literal> |
162 | will ask for the root password to install the package and fail, | | 162 | will ask for the root password to install the package and fail, |
163 | <literal>package-install</literal> will ask again.</para> | | 163 | <literal>package-install</literal> will ask again.</para> |
164 | <para>With basic DESTDIR support, <userinput>make | | 164 | <para>With basic DESTDIR support, <userinput>make |
165 | clean</userinput> needs to be run as root.</para> | | 165 | clean</userinput> needs to be run as root.</para> |
| | | 166 | |
| | | 167 | <para>Considering the <filename>foo/bar</filename> package, |
| | | 168 | DESTDIR full support can be tested using the following commands |
| | | 169 | |
| | | 170 | <programlisting> |
| | | 171 | &uprompt; id |
| | | 172 | uid=1000(myusername) gid=100(users) groups=100(users),0(wheel) |
| | | 173 | &uprompt; mkdir $HOME/packages |
| | | 174 | &uprompt; cd $PKGSRCDIR/foo/bar |
| | | 175 | </programlisting> |
| | | 176 | |
| | | 177 | Verify <varname>DESTDIR</varname> full support, no root privileges |
| | | 178 | should be needed |
| | | 179 | |
| | | 180 | <programlisting> |
| | | 181 | &uprompt; make USE_DESTDIR=full install |
| | | 182 | </programlisting> |
| | | 183 | |
| | | 184 | Create a package without root privileges |
| | | 185 | |
| | | 186 | <programlisting> |
| | | 187 | &uprompt; make USE_DESTDIR=full PACKAGES=$HOME/packages package |
| | | 188 | </programlisting> |
| | | 189 | |
| | | 190 | For the following command, you must be able to gain root |
| | | 191 | privileges using &man.su.1; |
| | | 192 | |
| | | 193 | <programlisting> |
| | | 194 | &uprompt; make USE_DESTDIR=full PACKAGES=$HOME/packages package-install |
| | | 195 | </programlisting> |
| | | 196 | |
| | | 197 | Then, as a simple user |
| | | 198 | |
| | | 199 | <programlisting> |
| | | 200 | &uprompt; make clean |
| | | 201 | </programlisting> |
| | | 202 | |
| | | 203 | </para> |
| | | 204 | |
166 | </sect1> | | 205 | </sect1> |
167 | | | 206 | |
168 | <sect1 id="conf.compiler"> | | 207 | <sect1 id="conf.compiler"> |
169 | <title>Selecting and configuring the compiler</title> | | 208 | <title>Selecting and configuring the compiler</title> |
170 | | | 209 | |
171 | <sect2 id="selecting-the-compiler"> | | 210 | <sect2 id="selecting-the-compiler"> |
172 | <title>Selecting the compiler</title> | | 211 | <title>Selecting the compiler</title> |
173 | | | 212 | |
174 | <para>By default, pkgsrc will use GCC to build packages. This may be | | 213 | <para>By default, pkgsrc will use GCC to build packages. This may be |
175 | overridden by setting the following variables in /etc/mk.conf:</para> | | 214 | overridden by setting the following variables in /etc/mk.conf:</para> |
176 | | | 215 | |
177 | <variablelist> | | 216 | <variablelist> |
178 | <varlistentry> | | 217 | <varlistentry> |
179 | <term><varname>PKGSRC_COMPILER</varname>:</term> | | 218 | <term><varname>PKGSRC_COMPILER</varname>:</term> |
180 | | | 219 | |
181 | <listitem> | | 220 | <listitem> |
182 | <para>This is a list of values specifying the chain of | | 221 | <para>This is a list of values specifying the chain of |
183 | compilers to invoke when building packages. Valid values | | 222 | compilers to invoke when building packages. Valid values |
184 | are:</para> | | 223 | are:</para> |
185 | | | 224 | |
186 | <!-- TODO: update this list after jlam's changes in May 2005 --> | | 225 | <!-- TODO: update this list after jlam's changes in May 2005 --> |
187 | <itemizedlist> | | 226 | <itemizedlist> |
188 | <listitem><para><varname>distcc</varname>: | | 227 | <listitem><para><varname>distcc</varname>: |
189 | distributed C/C++ (chainable)</para> | | 228 | distributed C/C++ (chainable)</para> |
190 | </listitem> | | 229 | </listitem> |
191 | | | 230 | |
192 | <listitem><para><varname>ccache</varname>: | | 231 | <listitem><para><varname>ccache</varname>: |
193 | compiler cache (chainable)</para> | | 232 | compiler cache (chainable)</para> |
194 | </listitem> | | 233 | </listitem> |
195 | | | 234 | |
196 | <listitem><para><varname>gcc</varname>: | | 235 | <listitem><para><varname>gcc</varname>: |
197 | GNU C/C++ Compiler</para> | | 236 | GNU C/C++ Compiler</para> |
198 | </listitem> | | 237 | </listitem> |
199 | | | 238 | |
200 | <listitem><para><varname>mipspro</varname>: | | 239 | <listitem><para><varname>mipspro</varname>: |
201 | Silicon Graphics, Inc. MIPSpro (n32/n64)</para> | | 240 | Silicon Graphics, Inc. MIPSpro (n32/n64)</para> |
202 | </listitem> | | 241 | </listitem> |
203 | | | 242 | |
204 | <listitem><para><varname>mipspro</varname>: | | 243 | <listitem><para><varname>mipspro</varname>: |
205 | Silicon Graphics, Inc. MIPSpro (o32)</para> | | 244 | Silicon Graphics, Inc. MIPSpro (o32)</para> |
206 | </listitem> | | 245 | </listitem> |
207 | | | 246 | |
208 | <listitem><para><varname>sunpro</varname>: | | 247 | <listitem><para><varname>sunpro</varname>: |
209 | Sun Microsystems, Inc. WorkShip/Forte/Sun ONE Studio</para> | | 248 | Sun Microsystems, Inc. WorkShip/Forte/Sun ONE Studio</para> |
210 | </listitem> | | 249 | </listitem> |
211 | </itemizedlist> | | 250 | </itemizedlist> |
212 | | | 251 | |
213 | <para>The default is | | 252 | <para>The default is |
214 | <quote><varname>gcc</varname></quote>. You can use | | 253 | <quote><varname>gcc</varname></quote>. You can use |
215 | <varname>ccache</varname> and/or | | 254 | <varname>ccache</varname> and/or |
216 | <varname>distcc</varname> with an appropriate | | 255 | <varname>distcc</varname> with an appropriate |
217 | <varname>PKGSRC_COMPILER</varname> setting, | | 256 | <varname>PKGSRC_COMPILER</varname> setting, |
218 | e.g. <quote><varname>ccache gcc</varname></quote>. This | | 257 | e.g. <quote><varname>ccache gcc</varname></quote>. This |
219 | variable should always be terminated with a value for | | 258 | variable should always be terminated with a value for |
220 | a real compiler. Note that only one real compiler | | 259 | a real compiler. Note that only one real compiler |
221 | should be listed (e.g. <quote><varname>sunpro gcc</varname></quote> | | 260 | should be listed (e.g. <quote><varname>sunpro gcc</varname></quote> |
222 | is not allowed).</para> | | 261 | is not allowed).</para> |
223 | </listitem> | | 262 | </listitem> |
224 | </varlistentry> | | 263 | </varlistentry> |
225 | | | 264 | |
226 | <varlistentry> | | 265 | <varlistentry> |
227 | <term><varname>GCC_REQD</varname>:</term> | | 266 | <term><varname>GCC_REQD</varname>:</term> |
228 | <!-- | | 267 | <!-- |
229 | TODO: what are the effects of setting GCC_REQD if PKGSRC_COMPILER | | 268 | TODO: what are the effects of setting GCC_REQD if PKGSRC_COMPILER |
230 | is not gcc? | | 269 | is not gcc? |
231 | --> | | 270 | --> |
232 | <listitem> | | 271 | <listitem> |
233 | <para>This specifies the minimum version of GCC to use | | 272 | <para>This specifies the minimum version of GCC to use |
234 | when building packages. If the system GCC doesn't | | 273 | when building packages. If the system GCC doesn't |
235 | satisfy this requirement, then pkgsrc will build and | | 274 | satisfy this requirement, then pkgsrc will build and |
236 | install one of the GCC packages to use instead.</para> | | 275 | install one of the GCC packages to use instead.</para> |
237 | </listitem> | | 276 | </listitem> |
238 | </varlistentry> | | 277 | </varlistentry> |
239 | </variablelist> | | 278 | </variablelist> |
240 | </sect2> | | 279 | </sect2> |
241 | | | 280 | |
242 | <sect2 id="conf.cflags"> | | 281 | <sect2 id="conf.cflags"> |
243 | <title>Additional flags to the compiler (<varname>CFLAGS</varname>)</title> | | 282 | <title>Additional flags to the compiler (<varname>CFLAGS</varname>)</title> |
244 | | | 283 | |
245 | <para>If you wish to set the <varname>CFLAGS</varname> variable, | | 284 | <para>If you wish to set the <varname>CFLAGS</varname> variable, |
246 | please make sure to use the <literal>+=</literal> operator | | 285 | please make sure to use the <literal>+=</literal> operator |
247 | instead of the <literal>=</literal> operator:</para> | | 286 | instead of the <literal>=</literal> operator:</para> |
248 | | | 287 | |
249 | <programlisting> | | 288 | <programlisting> |
250 | CFLAGS+= -your -flags | | 289 | CFLAGS+= -your -flags |
251 | </programlisting> | | 290 | </programlisting> |
252 | | | 291 | |
253 | <para>Using <varname>CFLAGS=</varname> (i.e. without the | | 292 | <para>Using <varname>CFLAGS=</varname> (i.e. without the |
254 | <quote>+</quote>) may lead to problems with packages that | | 293 | <quote>+</quote>) may lead to problems with packages that |
255 | need to add their own flags. You may want to take a look | | 294 | need to add their own flags. You may want to take a look |
256 | at the <filename role="pkg">devel/cpuflags</filename> | | 295 | at the <filename role="pkg">devel/cpuflags</filename> |
257 | package if you're interested in optimization for the current | | 296 | package if you're interested in optimization for the current |
258 | CPU. Setting <varname>USE_CPUFLAGS</varname> to yes in | | 297 | CPU. Setting <varname>USE_CPUFLAGS</varname> to yes in |
259 | &mk.conf; will cause pkgsrc to automatically use cpuflags.</para> | | 298 | &mk.conf; will cause pkgsrc to automatically use cpuflags.</para> |
260 | | | 299 | |
261 | </sect2> | | 300 | </sect2> |
262 | | | 301 | |
263 | <sect2 id="conf.ldflags"> | | 302 | <sect2 id="conf.ldflags"> |
264 | <title>Additional flags to the linker (<varname>LDFLAGS</varname>)</title> | | 303 | <title>Additional flags to the linker (<varname>LDFLAGS</varname>)</title> |
265 | | | 304 | |
266 | <para>If you want to pass flags to the linker, both in the configure | | 305 | <para>If you want to pass flags to the linker, both in the configure |
267 | step and the build step, you can do this in two ways. Either set | | 306 | step and the build step, you can do this in two ways. Either set |
268 | <varname>LDFLAGS</varname> or <varname>LIBS</varname>. The difference | | 307 | <varname>LDFLAGS</varname> or <varname>LIBS</varname>. The difference |
269 | between the two is that <varname>LIBS</varname> will be appended to | | 308 | between the two is that <varname>LIBS</varname> will be appended to |
270 | the command line, while <varname>LDFLAGS</varname> come earlier. | | 309 | the command line, while <varname>LDFLAGS</varname> come earlier. |
271 | <varname>LDFLAGS</varname> is pre-loaded with rpath settings for ELF | | 310 | <varname>LDFLAGS</varname> is pre-loaded with rpath settings for ELF |
272 | machines depending on the setting of <varname>USE_IMAKE</varname> or | | 311 | machines depending on the setting of <varname>USE_IMAKE</varname> or |
273 | the inclusion of <filename>mk/x11.buildlink3.mk</filename>. As with | | 312 | the inclusion of <filename>mk/x11.buildlink3.mk</filename>. As with |
274 | <varname>CFLAGS</varname>, if you do not wish to override these | | 313 | <varname>CFLAGS</varname>, if you do not wish to override these |
275 | settings, use the <literal>+=</literal> operator:</para> | | 314 | settings, use the <literal>+=</literal> operator:</para> |
276 | <programlisting> | | 315 | <programlisting> |
277 | LDFLAGS+= -your -linkerflags | | 316 | LDFLAGS+= -your -linkerflags |
278 | </programlisting> | | 317 | </programlisting> |
279 | </sect2> | | 318 | </sect2> |
280 | </sect1> | | 319 | </sect1> |
281 | | | 320 | |
282 | <!-- Configuration files --> | | 321 | <!-- Configuration files --> |
283 | <!-- PKG_SYSCONFBASE --> | | 322 | <!-- PKG_SYSCONFBASE --> |
284 | <!-- PKG_SYSCONFDIR.foobar --> | | 323 | <!-- PKG_SYSCONFDIR.foobar --> |
285 | | | 324 | |
286 | <!-- Security --> | | 325 | <!-- Security --> |
287 | <!-- PKGVULNDIR --> | | 326 | <!-- PKGVULNDIR --> |
288 | | | 327 | |
289 | <sect1 id="developer-advanced-settings"> | | 328 | <sect1 id="developer-advanced-settings"> |
290 | <title>Developer/advanced settings</title> | | 329 | <title>Developer/advanced settings</title> |
291 | | | 330 | |
292 | <!-- USE_ABI_DEPENDS --> | | 331 | <!-- USE_ABI_DEPENDS --> |
293 | <para>XXX | | 332 | <para>XXX |
294 | <itemizedlist> | | 333 | <itemizedlist> |
295 | <listitem><para><varname>PKG_DEVELOPER</varname>: | | 334 | <listitem><para><varname>PKG_DEVELOPER</varname>: |
296 | Run some sanity checks that package developers want: | | 335 | Run some sanity checks that package developers want: |
297 | <itemizedlist> | | 336 | <itemizedlist> |
298 | <listitem><para>make sure patches apply with zero | | 337 | <listitem><para>make sure patches apply with zero |
299 | fuzz</para></listitem> | | 338 | fuzz</para></listitem> |
300 | <listitem><para>run check-shlibs to see that all | | 339 | <listitem><para>run check-shlibs to see that all |
301 | binaries will find their shared libs.</para> | | 340 | binaries will find their shared libs.</para> |
302 | <!-- XXX: some more stuff --> | | 341 | <!-- XXX: some more stuff --> |
303 | </listitem> | | 342 | </listitem> |
304 | </itemizedlist> | | 343 | </itemizedlist> |
305 | </para> | | 344 | </para> |
306 | </listitem> | | 345 | </listitem> |
307 | <listitem><para><varname>PKG_DEBUG_LEVEL</varname>: The level | | 346 | <listitem><para><varname>PKG_DEBUG_LEVEL</varname>: The level |
308 | of debugging output which is displayed whilst making and | | 347 | of debugging output which is displayed whilst making and |
309 | installing the package. The default value for this is 0, | | 348 | installing the package. The default value for this is 0, |
310 | which will not display the commands as they are executed | | 349 | which will not display the commands as they are executed |
311 | (normal, default, quiet operation); the value 1 will display | | 350 | (normal, default, quiet operation); the value 1 will display |
312 | all shell commands before their invocation, and the value 2 | | 351 | all shell commands before their invocation, and the value 2 |
313 | will display both the shell commands before their invocation, | | 352 | will display both the shell commands before their invocation, |
314 | and their actual execution progress with <command>set | | 353 | and their actual execution progress with <command>set |
315 | -x</command> will be displayed.</para></listitem> | | 354 | -x</command> will be displayed.</para></listitem> |
316 | </itemizedlist> | | 355 | </itemizedlist> |
317 | </para> | | 356 | </para> |
318 | </sect1> | | 357 | </sect1> |
319 | | | 358 | |
320 | <!-- pkginstall-related variables --> | | 359 | <!-- pkginstall-related variables --> |
321 | <!-- PKG_REGISTER_SHELLS --> | | 360 | <!-- PKG_REGISTER_SHELLS --> |
322 | <!-- PKG_RCD_SCRIPTS --> | | 361 | <!-- PKG_RCD_SCRIPTS --> |
323 | | | 362 | |
324 | <sect1 id="selecting-build-options"> | | 363 | <sect1 id="selecting-build-options"> |
325 | <title>Selecting Build Options</title> | | 364 | <title>Selecting Build Options</title> |
326 | | | 365 | |
327 | <para>Some packages have build time options, usually to select | | 366 | <para>Some packages have build time options, usually to select |
328 | between different dependencies, enable optional support for big | | 367 | between different dependencies, enable optional support for big |
329 | dependencies or enable experimental features.</para> | | 368 | dependencies or enable experimental features.</para> |
330 | | | 369 | |
331 | <para>To see which options, if any, a package supports, and which | | 370 | <para>To see which options, if any, a package supports, and which |
332 | options are mutually exclusive, run <command>make | | 371 | options are mutually exclusive, run <command>make |
333 | show-options</command>, for example:</para> | | 372 | show-options</command>, for example:</para> |
334 | | | 373 | |
335 | <programlisting> | | 374 | <programlisting> |
336 | The following options are supported by this package: | | 375 | The following options are supported by this package: |
337 | ssl Enable SSL support. | | 376 | ssl Enable SSL support. |
338 | Exactly one of the following gecko options is required: | | 377 | Exactly one of the following gecko options is required: |
339 | firefox Use firefox as gecko rendering engine. | | 378 | firefox Use firefox as gecko rendering engine. |
340 | mozilla Use mozilla as gecko rendering engine. | | 379 | mozilla Use mozilla as gecko rendering engine. |
341 | At most one of the following database options may be selected: | | 380 | At most one of the following database options may be selected: |
342 | mysql Enable support for MySQL database. | | 381 | mysql Enable support for MySQL database. |
343 | pgsql Enable support for PostgreSQL database. | | 382 | pgsql Enable support for PostgreSQL database. |
344 | | | 383 | |
345 | These options are enabled by default: firefox | | 384 | These options are enabled by default: firefox |
346 | These options are currently enabled: mozilla ssl | | 385 | These options are currently enabled: mozilla ssl |
347 | </programlisting> | | 386 | </programlisting> |
348 | | | 387 | |
349 | <para>The following variables can be defined in | | 388 | <para>The following variables can be defined in |
350 | &mk.conf; to select which options to | | 389 | &mk.conf; to select which options to |
351 | enable for a package: <varname>PKG_DEFAULT_OPTIONS</varname>, | | 390 | enable for a package: <varname>PKG_DEFAULT_OPTIONS</varname>, |
352 | which can be used to select or disable options for all packages | | 391 | which can be used to select or disable options for all packages |
353 | that support them, and | | 392 | that support them, and |
354 | <varname>PKG_OPTIONS.<replaceable>pkgbase</replaceable></varname>, | | 393 | <varname>PKG_OPTIONS.<replaceable>pkgbase</replaceable></varname>, |
355 | which can be used to select or disable options specifically for | | 394 | which can be used to select or disable options specifically for |
356 | package <replaceable>pkgbase</replaceable>. Options listed in | | 395 | package <replaceable>pkgbase</replaceable>. Options listed in |
357 | these variables are selected, options preceded by <quote>-</quote> | | 396 | these variables are selected, options preceded by <quote>-</quote> |
358 | are disabled. A few examples:</para> | | 397 | are disabled. A few examples:</para> |
359 | | | 398 | |
360 | <screen> | | 399 | <screen> |
361 | &uprompt; <command>grep "PKG.*OPTION" &mk.conf;</command> | | 400 | &uprompt; <command>grep "PKG.*OPTION" &mk.conf;</command> |
362 | PKG_DEFAULT_OPTIONS= -arts -dvdread -esound | | 401 | PKG_DEFAULT_OPTIONS= -arts -dvdread -esound |
363 | PKG_OPTIONS.kdebase= debug -sasl | | 402 | PKG_OPTIONS.kdebase= debug -sasl |
364 | PKG_OPTIONS.apache= suexec </screen> | | 403 | PKG_OPTIONS.apache= suexec </screen> |
365 | | | 404 | |
366 | <para>It is important to note that options that were specifically | | 405 | <para>It is important to note that options that were specifically |
367 | suggested by the package maintainer must be explicitely removed if | | 406 | suggested by the package maintainer must be explicitely removed if |
368 | you do not wish to include the option. If you are unsure you can view | | 407 | you do not wish to include the option. If you are unsure you can view |
369 | the current state with <command>make show-options</command>.</para> | | 408 | the current state with <command>make show-options</command>.</para> |
370 | | | 409 | |
371 | <para>The following settings are consulted in the order given, and | | 410 | <para>The following settings are consulted in the order given, and |
372 | the last setting that selects or disables an option is | | 411 | the last setting that selects or disables an option is |
373 | used:</para> | | 412 | used:</para> |
374 | | | 413 | |
375 | <orderedlist> | | 414 | <orderedlist> |
376 | <listitem><para>the default options as suggested by the package | | 415 | <listitem><para>the default options as suggested by the package |
377 | maintainer</para></listitem> | | 416 | maintainer</para></listitem> |
378 | | | 417 | |
379 | <listitem><para>the options implied by the settings of legacy | | 418 | <listitem><para>the options implied by the settings of legacy |
380 | variables (see below)</para></listitem> | | 419 | variables (see below)</para></listitem> |
381 | | | 420 | |
382 | <listitem><para><varname>PKG_DEFAULT_OPTIONS</varname></para></listitem> | | 421 | <listitem><para><varname>PKG_DEFAULT_OPTIONS</varname></para></listitem> |
383 | | | 422 | |
384 | <listitem><para><varname>PKG_OPTIONS.<replaceable>pkgbase</replaceable></varname></para></listitem> | | 423 | <listitem><para><varname>PKG_OPTIONS.<replaceable>pkgbase</replaceable></varname></para></listitem> |
385 | </orderedlist> | | 424 | </orderedlist> |
386 | | | 425 | |
387 | <para>For groups of mutually exclusive options, the last option | | 426 | <para>For groups of mutually exclusive options, the last option |
388 | selected is used, all others are automatically disabled. If an | | 427 | selected is used, all others are automatically disabled. If an |
389 | option of the group is explicitly disabled, the previously | | 428 | option of the group is explicitly disabled, the previously |
390 | selected option, if any, is used. It is an error if no option | | 429 | selected option, if any, is used. It is an error if no option |
391 | from a required group of options is selected, and building the | | 430 | from a required group of options is selected, and building the |
392 | package will fail.</para> | | 431 | package will fail.</para> |
393 | | | 432 | |
394 | <para>Before the options framework was introduced, build options | | 433 | <para>Before the options framework was introduced, build options |
395 | were selected by setting a variable (often named | | 434 | were selected by setting a variable (often named |
396 | <varname>USE_<replaceable>FOO</replaceable></varname>) in | | 435 | <varname>USE_<replaceable>FOO</replaceable></varname>) in |
397 | &mk.conf; for each option. To ease | | 436 | &mk.conf; for each option. To ease |
398 | transition to the options framework for the user, these legacy | | 437 | transition to the options framework for the user, these legacy |
399 | variables are converted to the appropriate options setting | | 438 | variables are converted to the appropriate options setting |
400 | (<varname>PKG_OPTIONS.<replaceable>pkgbase</replaceable></varname>) | | 439 | (<varname>PKG_OPTIONS.<replaceable>pkgbase</replaceable></varname>) |
401 | automatically. A warning is issued to prompt the user to update | | 440 | automatically. A warning is issued to prompt the user to update |
402 | &mk.conf; to use the options framework | | 441 | &mk.conf; to use the options framework |
403 | directly. Support for the legacy variables will be removed | | 442 | directly. Support for the legacy variables will be removed |
404 | eventually.</para> | | 443 | eventually.</para> |
405 | </sect1> | | 444 | </sect1> |
406 | | | 445 | |
407 | </chapter> | | 446 | </chapter> |