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