Annotation of htdocs/docs/pkgsrc/configuring.html, revision 1.52
1.36 sevan 1: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
1.1 dsieger 2: <html>
3: <head>
4: <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
1.43 rillig 5: <title>Chapter 6. Configuring pkgsrc</title>
1.19 spz 6: <link rel="stylesheet" type="text/css" href="/global.css">
1.1 dsieger 7: <meta name="generator" content="DocBook XSL Stylesheets VX.X.X">
1.11 rillig 8: <link rel="home" href="index.html" title="The pkgsrc guide">
1.1 dsieger 9: <link rel="up" href="users-guide.html" title="Part I. The pkgsrc user's guide">
1.43 rillig 10: <link rel="prev" href="using.html" title="Chapter 5. Using pkgsrc">
11: <link rel="next" href="binary.html" title="Chapter 7. Creating binary packages">
1.1 dsieger 12: </head>
13: <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
14: <div class="navheader">
15: <table width="100%" summary="Navigation header">
1.43 rillig 16: <tr><th colspan="3" align="center">Chapter 6. Configuring pkgsrc</th></tr>
1.1 dsieger 17: <tr>
18: <td width="20%" align="left">
19: <a accesskey="p" href="using.html">Prev</a> </td>
20: <th width="60%" align="center">Part I. The pkgsrc user's guide</th>
21: <td width="20%" align="right"> <a accesskey="n" href="binary.html">Next</a>
22: </td>
23: </tr>
24: </table>
25: <hr>
26: </div>
1.21 asau 27: <div class="chapter">
1.1 dsieger 28: <div class="titlepage"><div><div><h2 class="title">
1.43 rillig 29: <a name="configuring"></a>Chapter 6. Configuring pkgsrc</h2></div></div></div>
1.1 dsieger 30: <div class="toc">
31: <p><b>Table of Contents</b></p>
1.30 leot 32: <dl class="toc">
1.43 rillig 33: <dt><span class="sect1"><a href="configuring.html#general-configuration">6.1. General configuration</a></span></dt>
34: <dt><span class="sect1"><a href="configuring.html#variables-affecting-build">6.2. Variables affecting the build process</a></span></dt>
35: <dt><span class="sect1"><a href="configuring.html#variables-affecting-installation">6.3. Variables affecting the installation process</a></span></dt>
36: <dt><span class="sect1"><a href="configuring.html#conf.compiler">6.4. Selecting and configuring the compiler</a></span></dt>
1.1 dsieger 37: <dd><dl>
1.43 rillig 38: <dt><span class="sect2"><a href="configuring.html#selecting-the-compiler">6.4.1. Selecting the compiler</a></span></dt>
39: <dt><span class="sect2"><a href="configuring.html#conf.cflags">6.4.2. Additional flags to the compiler (<code class="varname">CFLAGS</code>)</a></span></dt>
40: <dt><span class="sect2"><a href="configuring.html#conf.ldflags">6.4.3. Additional flags to the linker (<code class="varname">LDFLAGS</code>)</a></span></dt>
1.1 dsieger 41: </dl></dd>
1.43 rillig 42: <dt><span class="sect1"><a href="configuring.html#developer-advanced-settings">6.5. Developer/advanced settings</a></span></dt>
43: <dt><span class="sect1"><a href="configuring.html#selecting-build-options">6.6. Selecting Build Options</a></span></dt>
1.1 dsieger 44: </dl>
45: </div>
1.3 rillig 46: <a name="mk.conf"></a><p>The whole pkgsrc system is configured in a single file, usually
1.1 dsieger 47: called <code class="filename">mk.conf</code>. In which directory pkgsrc looks for
48: that file depends on the installation. On NetBSD, when you use
1.52 ! leot 49: <a class="citerefentry" href="//man.NetBSD.org/NetBSD-9.2/i386/make.1"><span class="citerefentry"><span class="refentrytitle">make</span>(1)</span></a> from the base system, it is in the directory
1.1 dsieger 50: <code class="filename">/etc/</code>. In all other cases the default location is
51: <code class="literal">${PREFIX}/etc/</code>, depending on where you told the
52: bootstrap program to install the binary packages.</p>
53: <p>The format of the configuration file is that of the usual
54: BSD-style <code class="filename">Makefile</code>s. The whole pkgsrc configuration
55: is done by setting variables in this file. Note that you can define all
56: kinds of variables, and no special error checking (for example for
1.33 rillig 57: spelling mistakes) takes place.</p>
1.21 asau 58: <div class="sect1">
1.1 dsieger 59: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.43 rillig 60: <a name="general-configuration"></a>6.1. General configuration</h2></div></div></div>
1.33 rillig 61: <p>The following variables apply to all
1.1 dsieger 62: pkgsrc packages. A complete list of the variables that can be
63: configured by the user is available in
64: <code class="filename">mk/defaults/mk.conf</code>, together with some
65: comments that describe each variable's intent.</p>
1.21 asau 66: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.17 wiz 67: <li class="listitem"><p><code class="varname">LOCALBASE</code>: Where
1.1 dsieger 68: packages will be installed. The default is
69: <code class="filename">/usr/pkg</code>. Do not mix binary packages
70: with different <code class="varname">LOCALBASE</code>s!</p></li>
1.17 wiz 71: <li class="listitem"><p><code class="varname">CROSSBASE</code>: Where
72: <span class="quote">“<span class="quote">cross</span>”</span> category packages will be
1.1 dsieger 73: installed. The default is
74: <code class="filename">${LOCALBASE}/cross</code>.</p></li>
1.17 wiz 75: <li class="listitem"><p><code class="varname">X11BASE</code>: Where
1.1 dsieger 76: X11 is installed on the system. The default is
1.24 wiz 77: <code class="filename">/usr/X11R7</code>.</p></li>
1.17 wiz 78: <li class="listitem"><p><code class="varname">DISTDIR</code>: Where to store the
1.1 dsieger 79: downloaded copies of the original source distributions used
80: for building pkgsrc packages. The default is
81: <code class="filename">${PKGSRCDIR}/distfiles</code>.</p></li>
1.17 wiz 82: <li class="listitem"><p><code class="varname">PKG_DBDIR</code>: Where the
1.1 dsieger 83: database about installed packages is stored. The default is
1.35 sevan 84: <code class="filename">/usr/pkg/pkgdb</code>.</p></li>
1.17 wiz 85: <li class="listitem"><p><code class="varname">MASTER_SITE_OVERRIDE</code>:
1.1 dsieger 86: If set, override the packages'
87: <code class="varname">MASTER_SITES</code> with this value.</p></li>
1.17 wiz 88: <li class="listitem"><p><code class="varname">MASTER_SITE_BACKUP</code>:
1.1 dsieger 89: Backup location(s) for distribution files and patch files
90: if not found locally or in
91: <code class="filename">${MASTER_SITES}</code> or
92: <code class="filename">${PATCH_SITES}</code> respectively.
1.35 sevan 93: The defaults is
94: <code class="filename">ftp://ftp.NetBSD.org/pub/pkgsrc/distfiles/${DIST_SUBDIR}/</code>.</p></li>
1.17 wiz 95: <li class="listitem"><p><code class="varname">BINPKG_SITES</code>:
1.1 dsieger 96: List of sites carrying binary pkgs. <em class="replaceable"><code>rel</code></em> and
97: <em class="replaceable"><code>arch</code></em> are replaced with OS
1.17 wiz 98: release (<span class="quote">“<span class="quote">2.0</span>”</span>, etc.) and architecture
99: (<span class="quote">“<span class="quote">mipsel</span>”</span>, etc.).</p></li>
100: <li class="listitem"><p><code class="varname">ACCEPTABLE_LICENSES</code>:
1.16 jakllsch 101: List of acceptable licenses. License names are case-sensitive.
102: Whenever you try to build a package whose license is not in this
103: list, you will get an error message. If the license condition is
104: simple enough, the error message will include specific
105: instructions on how to change this variable.</p></li>
1.1 dsieger 106: </ul></div>
107: </div>
1.21 asau 108: <div class="sect1">
1.1 dsieger 109: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.43 rillig 110: <a name="variables-affecting-build"></a>6.2. Variables affecting the build process</h2></div></div></div>
1.32 rillig 111: <p>
1.1 dsieger 112: </p>
1.21 asau 113: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.17 wiz 114: <li class="listitem"><p><code class="varname">PACKAGES</code>: The top level
1.1 dsieger 115: directory for the binary packages. The default is
116: <code class="filename">${PKGSRCDIR}/packages</code>.</p></li>
1.17 wiz 117: <li class="listitem"><p><code class="varname">WRKOBJDIR</code>:
1.1 dsieger 118: The top level directory where, if defined, the separate
119: working directories will get created, and symbolically
120: linked to from <code class="filename">${WRKDIR}</code> (see below).
121: This is useful for building packages on several
122: architectures, then <code class="filename">${PKGSRCDIR}</code>
123: can be NFS-mounted while <code class="filename">${WRKOBJDIR}</code>
124: is local to every architecture. (It should be noted that
125: <code class="varname">PKGSRCDIR</code> should not be set by the user
1.10 jmcneill 126: — it is an internal definition which refers to the
1.1 dsieger 127: root of the pkgsrc tree. It is possible to have many
128: pkgsrc tree instances.)</p></li>
1.17 wiz 129: <li class="listitem"><p><code class="varname">LOCALPATCHES</code>:
1.1 dsieger 130: Directory for local patches that aren't part of pkgsrc.
1.48 rillig 131: See <a class="xref" href="components.html#components.patches" title="12.3. patches/*">Section 12.3, “<code class="filename">patches/*</code>”</a> for more
1.1 dsieger 132: information.</p></li>
1.17 wiz 133: <li class="listitem"><p><code class="varname">PKGMAKECONF</code>: Location of
1.7 hubertf 134: the <a class="link" href="configuring.html#mk.conf"><code class="filename">mk.conf</code></a> file used by a package's
1.1 dsieger 135: BSD-style Makefile. If this is not set,
136: <code class="varname">MAKECONF</code> is set to
137: <code class="filename">/dev/null</code> to avoid picking up
138: settings used by builds in <code class="filename">/usr/src</code>.</p></li>
139: </ul></div>
140: </div>
1.21 asau 141: <div class="sect1">
1.1 dsieger 142: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.43 rillig 143: <a name="variables-affecting-installation"></a>6.3. Variables affecting the installation process</h2></div></div></div>
1.51 leot 144: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><code class="varname">PKGSRC_KEEP_BIN_PKGS</code>:
1.39 maya 145: By default, binary packages of built packages are
1.41 leot 146: preserved in <code class="filename">${PACKAGES}/All</code>. Setting
1.39 maya 147: this variable to "no" prevents this.</p></li></ul></div>
1.31 jnemeth 148: <p>Packages have to support installation into a
1.3 rillig 149: subdirectory of <code class="varname">WRKDIR</code>. This allows a package
150: to be built, before the actual filesystem is touched. DESTDIR
151: support exists in two variations:</p>
1.21 asau 152: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.17 wiz 153: <li class="listitem"><p>Basic DESTDIR support means that the package
1.18 wiz 154: installation and packaging is still run as root.</p></li>
155: <li class="listitem"><p>Full DESTDIR support can run the complete
156: build, installation and packaging as normal user. Root
157: privileges are only needed to add packages.</p></li>
1.3 rillig 158: </ul></div>
159: <p>With basic DESTDIR support, <strong class="userinput"><code>make
160: clean</code></strong> needs to be run as root.</p>
1.13 imil 161: <p>Considering the <code class="filename">foo/bar</code> package,
162: DESTDIR full support can be tested using the following commands
163:
164: </p>
165: <pre class="programlisting">
166: <code class="prompt">$</code> id
167: uid=1000(myusername) gid=100(users) groups=100(users),0(wheel)
168: <code class="prompt">$</code> mkdir $HOME/packages
169: <code class="prompt">$</code> cd $PKGSRCDIR/foo/bar
170: </pre>
171: <p>
172:
173: Verify <code class="varname">DESTDIR</code> full support, no root privileges
174: should be needed
175:
176: </p>
177: <pre class="programlisting">
1.22 asau 178: <code class="prompt">$</code> make stage-install
1.13 imil 179: </pre>
180: <p>
181:
182: Create a package without root privileges
183:
184: </p>
185: <pre class="programlisting">
1.22 asau 186: <code class="prompt">$</code> make PACKAGES=$HOME/packages package
1.13 imil 187: </pre>
188: <p>
189:
190: For the following command, you must be able to gain root
1.52 ! leot 191: privileges using <a class="citerefentry" href="//man.NetBSD.org/NetBSD-9.2/i386/su.1"><span class="citerefentry"><span class="refentrytitle">su</span>(1)</span></a>
1.13 imil 192:
193: </p>
194: <pre class="programlisting">
1.22 asau 195: <code class="prompt">$</code> make PACKAGES=$HOME/packages install
1.13 imil 196: </pre>
197: <p>
198:
199: Then, as a simple user
200:
201: </p>
202: <pre class="programlisting">
203: <code class="prompt">$</code> make clean
204: </pre>
205: <p>
206:
207: </p>
1.3 rillig 208: </div>
1.21 asau 209: <div class="sect1">
1.3 rillig 210: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.43 rillig 211: <a name="conf.compiler"></a>6.4. Selecting and configuring the compiler</h2></div></div></div>
1.21 asau 212: <div class="sect2">
1.1 dsieger 213: <div class="titlepage"><div><div><h3 class="title">
1.43 rillig 214: <a name="selecting-the-compiler"></a>6.4.1. Selecting the compiler</h3></div></div></div>
1.1 dsieger 215: <p>By default, pkgsrc will use GCC to build packages. This may be
216: overridden by setting the following variables in /etc/mk.conf:</p>
1.21 asau 217: <div class="variablelist"><dl class="variablelist">
1.1 dsieger 218: <dt><span class="term"><code class="varname">PKGSRC_COMPILER</code>:</span></dt>
219: <dd>
220: <p>This is a list of values specifying the chain of
221: compilers to invoke when building packages. Valid values
222: are:</p>
1.21 asau 223: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.22 asau 224: <li class="listitem"><p><code class="varname">ccc</code>:
225: Compaq C Compilers (Tru64)</p></li>
226: <li class="listitem"><p><code class="varname">ccache</code>:
227: compiler cache (chainable)</p></li>
228: <li class="listitem"><p><code class="varname">clang</code>:
229: Clang C and Objective-C compiler</p></li>
1.17 wiz 230: <li class="listitem"><p><code class="varname">distcc</code>:
1.1 dsieger 231: distributed C/C++ (chainable)</p></li>
1.22 asau 232: <li class="listitem"><p><code class="varname">f2c</code>:
233: Fortran 77 to C compiler (chainable)</p></li>
234: <li class="listitem"><p><code class="varname">icc</code>:
235: Intel C++ Compiler (Linux)</p></li>
236: <li class="listitem"><p><code class="varname">ido</code>:
237: SGI IRIS Development Option cc (IRIX 5)</p></li>
1.17 wiz 238: <li class="listitem"><p><code class="varname">gcc</code>:
1.1 dsieger 239: GNU C/C++ Compiler</p></li>
1.22 asau 240: <li class="listitem"><p><code class="varname">hp</code>:
241: HP-UX C/aC++ compilers</p></li>
1.17 wiz 242: <li class="listitem"><p><code class="varname">mipspro</code>:
1.1 dsieger 243: Silicon Graphics, Inc. MIPSpro (n32/n64)</p></li>
1.22 asau 244: <li class="listitem"><p><code class="varname">mipspro-ucode</code>:
1.1 dsieger 245: Silicon Graphics, Inc. MIPSpro (o32)</p></li>
1.17 wiz 246: <li class="listitem"><p><code class="varname">sunpro</code>:
1.1 dsieger 247: Sun Microsystems, Inc. WorkShip/Forte/Sun ONE Studio</p></li>
1.22 asau 248: <li class="listitem"><p><code class="varname">xlc</code>:
1.35 sevan 249: IBM's XL C/C++ compiler suite</p></li>
1.1 dsieger 250: </ul></div>
251: <p>The default is
1.17 wiz 252: <span class="quote">“<span class="quote"><code class="varname">gcc</code></span>”</span>. You can use
1.1 dsieger 253: <code class="varname">ccache</code> and/or
254: <code class="varname">distcc</code> with an appropriate
255: <code class="varname">PKGSRC_COMPILER</code> setting,
1.17 wiz 256: e.g. <span class="quote">“<span class="quote"><code class="varname">ccache gcc</code></span>”</span>. This
1.1 dsieger 257: variable should always be terminated with a value for
258: a real compiler. Note that only one real compiler
1.17 wiz 259: should be listed (e.g. <span class="quote">“<span class="quote"><code class="varname">sunpro gcc</code></span>”</span>
1.1 dsieger 260: is not allowed).</p>
261: </dd>
262: <dt><span class="term"><code class="varname">GCC_REQD</code>:</span></dt>
263: <dd><p>This specifies the minimum version of GCC to use
264: when building packages. If the system GCC doesn't
265: satisfy this requirement, then pkgsrc will build and
266: install one of the GCC packages to use instead.</p></dd>
1.42 leot 267: <dt><span class="term"><code class="varname">PYTHON_VERSION_DEFAULT</code>:</span></dt>
1.34 maya 268: <dd><p>Specifies which version of python to use when several
269: options are available.</p></dd>
270: <dt><span class="term"><code class="varname">PKGSRC_FORTRAN</code>:</span></dt>
1.47 gutterid 271: <dd><p>Specifies the Fortran compiler to use.
272: The default is <code class="varname">gfortran</code>.</p></dd>
1.34 maya 273: <dt><span class="term"><code class="varname">GFORTRAN_VERSION</code>:</span></dt>
274: <dd><p>If <code class="varname">PKGSRC_FORTRAN</code><code class="literal">=</code>
275: <code class="varname">gfortran</code> is used, this option specifies which
276: version to use.</p></dd>
1.1 dsieger 277: </dl></div>
278: </div>
1.21 asau 279: <div class="sect2">
1.1 dsieger 280: <div class="titlepage"><div><div><h3 class="title">
1.43 rillig 281: <a name="conf.cflags"></a>6.4.2. Additional flags to the compiler (<code class="varname">CFLAGS</code>)</h3></div></div></div>
1.1 dsieger 282: <p>If you wish to set the <code class="varname">CFLAGS</code> variable,
283: please make sure to use the <code class="literal">+=</code> operator
284: instead of the <code class="literal">=</code> operator:</p>
285: <pre class="programlisting">
286: CFLAGS+= -your -flags
287: </pre>
288: <p>Using <code class="varname">CFLAGS=</code> (i.e. without the
1.17 wiz 289: <span class="quote">“<span class="quote">+</span>”</span>) may lead to problems with packages that
1.12 jnemeth 290: need to add their own flags. You may want to take a look
1.52 ! leot 291: at the <a href="https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/devel/cpuflags/index.html" target="_top"><code class="filename">devel/cpuflags</code></a>
1.17 wiz 292: package if you're interested in optimization specifically
293: for the current CPU. </p>
1.1 dsieger 294: </div>
1.21 asau 295: <div class="sect2">
1.1 dsieger 296: <div class="titlepage"><div><div><h3 class="title">
1.43 rillig 297: <a name="conf.ldflags"></a>6.4.3. Additional flags to the linker (<code class="varname">LDFLAGS</code>)</h3></div></div></div>
1.1 dsieger 298: <p>If you want to pass flags to the linker, both in the configure
299: step and the build step, you can do this in two ways. Either set
300: <code class="varname">LDFLAGS</code> or <code class="varname">LIBS</code>. The difference
301: between the two is that <code class="varname">LIBS</code> will be appended to
302: the command line, while <code class="varname">LDFLAGS</code> come earlier.
303: <code class="varname">LDFLAGS</code> is pre-loaded with rpath settings for ELF
304: machines depending on the setting of <code class="varname">USE_IMAKE</code> or
305: the inclusion of <code class="filename">mk/x11.buildlink3.mk</code>. As with
306: <code class="varname">CFLAGS</code>, if you do not wish to override these
307: settings, use the <code class="literal">+=</code> operator:</p>
308: <pre class="programlisting">
309: LDFLAGS+= -your -linkerflags
310: </pre>
311: </div>
312: </div>
1.21 asau 313: <div class="sect1">
1.1 dsieger 314: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.43 rillig 315: <a name="developer-advanced-settings"></a>6.5. Developer/advanced settings</h2></div></div></div>
1.24 wiz 316: <p>
1.1 dsieger 317: </p>
1.21 asau 318: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.17 wiz 319: <li class="listitem">
1.1 dsieger 320: <p><code class="varname">PKG_DEVELOPER</code>:
321: Run some sanity checks that package developers want:
322: </p>
1.21 asau 323: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; ">
1.17 wiz 324: <li class="listitem"><p>make sure patches apply with zero
1.1 dsieger 325: fuzz</p></li>
1.17 wiz 326: <li class="listitem"><p>run check-shlibs to see that all
1.1 dsieger 327: binaries will find their shared libs.</p></li>
328: </ul></div>
329: <p>
330: </p>
331: </li>
1.17 wiz 332: <li class="listitem"><p><code class="varname">PKG_DEBUG_LEVEL</code>: The level
1.1 dsieger 333: of debugging output which is displayed whilst making and
334: installing the package. The default value for this is 0,
335: which will not display the commands as they are executed
336: (normal, default, quiet operation); the value 1 will display
337: all shell commands before their invocation, and the value 2
338: will display both the shell commands before their invocation,
1.33 rillig 339: as well as their actual execution progress with <span class="command"><strong>set
340: -x</strong></span>.</p></li>
1.1 dsieger 341: </ul></div>
342: <p>
343: </p>
344: </div>
1.21 asau 345: <div class="sect1">
1.1 dsieger 346: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.43 rillig 347: <a name="selecting-build-options"></a>6.6. Selecting Build Options</h2></div></div></div>
1.1 dsieger 348: <p>Some packages have build time options, usually to select
349: between different dependencies, enable optional support for big
350: dependencies or enable experimental features.</p>
351: <p>To see which options, if any, a package supports, and which
1.7 hubertf 352: options are mutually exclusive, run <span class="command"><strong>make
1.1 dsieger 353: show-options</strong></span>, for example:</p>
354: <pre class="programlisting">
355: The following options are supported by this package:
356: ssl Enable SSL support.
357: Exactly one of the following gecko options is required:
358: firefox Use firefox as gecko rendering engine.
359: mozilla Use mozilla as gecko rendering engine.
360: At most one of the following database options may be selected:
361: mysql Enable support for MySQL database.
362: pgsql Enable support for PostgreSQL database.
363:
364: These options are enabled by default: firefox
365: These options are currently enabled: mozilla ssl
366: </pre>
367: <p>The following variables can be defined in
1.7 hubertf 368: <a class="link" href="configuring.html#mk.conf"><code class="filename">mk.conf</code></a> to select which options to
1.1 dsieger 369: enable for a package: <code class="varname">PKG_DEFAULT_OPTIONS</code>,
370: which can be used to select or disable options for all packages
371: that support them, and
372: <code class="varname">PKG_OPTIONS.<em class="replaceable"><code>pkgbase</code></em></code>,
373: which can be used to select or disable options specifically for
374: package <em class="replaceable"><code>pkgbase</code></em>. Options listed in
1.17 wiz 375: these variables are selected, options preceded by <span class="quote">“<span class="quote">-</span>”</span>
1.1 dsieger 376: are disabled. A few examples:</p>
377: <pre class="screen">
1.7 hubertf 378: <code class="prompt">$</code> <span class="command"><strong>grep "PKG.*OPTION" <a class="link" href="configuring.html#mk.conf"><code class="filename">mk.conf</code></a></strong></span>
1.1 dsieger 379: PKG_DEFAULT_OPTIONS= -arts -dvdread -esound
380: PKG_OPTIONS.kdebase= debug -sasl
381: PKG_OPTIONS.apache= suexec </pre>
1.8 rillig 382: <p>It is important to note that options that were specifically
1.14 snj 383: suggested by the package maintainer must be explicitly removed if
1.8 rillig 384: you do not wish to include the option. If you are unsure you can view
385: the current state with <span class="command"><strong>make show-options</strong></span>.</p>
1.1 dsieger 386: <p>The following settings are consulted in the order given, and
387: the last setting that selects or disables an option is
388: used:</p>
1.17 wiz 389: <div class="orderedlist"><ol class="orderedlist" type="1">
390: <li class="listitem"><p>the default options as suggested by the package
1.1 dsieger 391: maintainer</p></li>
1.17 wiz 392: <li class="listitem"><p>the options implied by the settings of legacy
1.1 dsieger 393: variables (see below)</p></li>
1.17 wiz 394: <li class="listitem"><p><code class="varname">PKG_DEFAULT_OPTIONS</code></p></li>
395: <li class="listitem"><p><code class="varname">PKG_OPTIONS.<em class="replaceable"><code>pkgbase</code></em></code></p></li>
1.1 dsieger 396: </ol></div>
397: <p>For groups of mutually exclusive options, the last option
398: selected is used, all others are automatically disabled. If an
399: option of the group is explicitly disabled, the previously
400: selected option, if any, is used. It is an error if no option
401: from a required group of options is selected, and building the
402: package will fail.</p>
403: <p>Before the options framework was introduced, build options
404: were selected by setting a variable (often named
405: <code class="varname">USE_<em class="replaceable"><code>FOO</code></em></code>) in
1.7 hubertf 406: <a class="link" href="configuring.html#mk.conf"><code class="filename">mk.conf</code></a> for each option. To ease
1.1 dsieger 407: transition to the options framework for the user, these legacy
408: variables are converted to the appropriate options setting
409: (<code class="varname">PKG_OPTIONS.<em class="replaceable"><code>pkgbase</code></em></code>)
410: automatically. A warning is issued to prompt the user to update
1.7 hubertf 411: <a class="link" href="configuring.html#mk.conf"><code class="filename">mk.conf</code></a> to use the options framework
1.1 dsieger 412: directly. Support for the legacy variables will be removed
413: eventually.</p>
414: </div>
415: </div>
416: <div class="navfooter">
417: <hr>
418: <table width="100%" summary="Navigation footer">
419: <tr>
420: <td width="40%" align="left">
421: <a accesskey="p" href="using.html">Prev</a> </td>
422: <td width="20%" align="center"><a accesskey="u" href="users-guide.html">Up</a></td>
423: <td width="40%" align="right"> <a accesskey="n" href="binary.html">Next</a>
424: </td>
425: </tr>
426: <tr>
1.43 rillig 427: <td width="40%" align="left" valign="top">Chapter 5. Using pkgsrc </td>
1.1 dsieger 428: <td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td>
1.43 rillig 429: <td width="40%" align="right" valign="top"> Chapter 7. Creating binary packages</td>
1.1 dsieger 430: </tr>
431: </table>
432: </div>
433: </body>
434: </html>
CVSweb <webmaster@jp.NetBSD.org>