Annotation of htdocs/docs/pkgsrc/configuring.html, revision 1.17

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

CVSweb <webmaster@jp.NetBSD.org>