View | Details | Raw Unified | Return to bug 76472 | Differences between
and this patch

Collapse All | Expand All

(-)book.sgml (+78 lines)
Lines 3538-3543 Link Here
3538
	  </table>
3538
	  </table>
3539
3539
3540
      </sect2>
3540
      </sect2>
3541
3542
      <sect2>
3543
	<title><makevar>OPTIONS</makevar></title>
3544
3545
	<sect3>
3546
	  <title>Background</title>
3547
	    <para>The <makevar>OPTIONS</makevar> variable gives the user who
3548
	    installs the port a dialog with the available options and saves
3549
	    them to <filename>/var/db/ports/portname/options</filename>. Next
3550
	    time when the port has to be rebuild, the options are reused. Never
3551
	    again you have to remember all the twenty
3552
	    <makevar>WITH_<replaceable>*</replaceable></makevar> and
3553
	    <makevar>WITHOUT_<replaceable>*</replaceable></makevar> options you
3554
	    used to build this port!</para>
3555
	</sect3>
3556
3557
	<sect3>
3558
	  <title>Syntax</title>
3559
	  <para>The syntax for the <makevar>OPTIONS</makevar> variable is:
3560
3561
<programlisting>OPTIONS=	option	"descriptive text" default ...
3562
</programlisting>
3563
3564
	  The value for default is either <literal>ON</literal> or
3565
	  <literal>OFF</literal>. Multiple repetitions of these three fields
3566
	  is allowed.</para>
3567
3568
	  <para>When the user runs the <command>make config</command> (or runs
3569
	  <command>make build</command> for the first time), the framework will
3570
	  check for
3571
	  <filename>/var/db/ports/<replaceable>portname</replaceable>/options</filename>.
3572
	  If it doesn't exist, it will use the values of
3573
	  <makevar>OPTIONS</makevar> to create a dialogbox where the options
3574
	  can be enabled or disabled. Then the options file is saved and the
3575
	  selected variables are set.</para>
3576
3577
	  <para>Use <command>make showconfig</command> to see the saved
3578
	  configuration. Use <command>make rmconfig</command> to remove the saved
3579
	  configuration.</para>
3580
3581
	<sect3>
3582
	  <title>Example</title>
3583
	  <example id="ports-options-simple-use">
3584
	    <title>Simple use of <makevar>OPTIONS</makevar></title>
3585
	    <para><programlisting>OPTIONS=	foo "Enable option foo" On \
3586
			bar "Support feature bar" Off
3587
3588
.include &lt;bsd.port.pre.mk&gt;
3589
3590
.if defined(WITH_FOO)
3591
CONFIGURE_ARGS+=	--with-foo
3592
.else
3593
CONFIGURE_ARGS+=	--without-foo
3594
.endif
3595
3596
.if defined(WITH_BAR)
3597
RUN_DEPENDS+=	bar:${PORTSDIR}/bar/bar
3598
.endif
3599
3600
.include &lt;bsd.port.post.mk&gt;</programlisting></para>
3601
	  </example>
3602
3603
	<sect3>
3604
	  <title>Brokeness</title>
3605
	  <itemizedlist>
3606
	    <listitem>
3607
	      <para><command>make index</command> doesn't follow
3608
	      <makevar>OPTIONS</makevar> yet (ports/75727)</para>
3609
	    </listitem>
3610
	    <listitem>
3611
	      <para><makevar>PACKAGE_BUILDING</makevar> is ignoring
3612
	      <makevar>OPTIONS</makevar> (ports/75727?)</para>
3613
	    </listitem>
3614
	  </itemizedlist>
3615
	</sect3>
3616
	
3617
      </sect2>
3618
3541
    </sect1>
3619
    </sect1>
3542
3620
3543
    <sect1 id="makefile-wrkdir">
3621
    <sect1 id="makefile-wrkdir">

Return to bug 76472