Beging to rework the section on dependencies Makevars, especially with

respect to WITH_*/WITHOUT_*.  Although this patch is incomplete, it is
better than what is there.

Note: I've removed some of the GNOME text because AFAICT it is just
completely wrong now.

PR:			docs/67707
No reaction from:	freebsd-doc, portmgr
This commit is contained in:
Mark Linimon 2004-06-30 03:04:24 +00:00
parent 07184f31b1
commit 99c79e2f75
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=21309

View file

@ -3062,7 +3062,26 @@ PATCHFILES= patch1:test</programlisting>
<title><makevar>USE_<replaceable>*</replaceable></makevar></title>
<para>A number of variables exist in order to encapsulate common
dependencies that many ports have.</para>
dependencies that many ports have. Although their use is
optional, they can help to reduce the verbosity of the port
<filename>Makefile</filename>s. Each of them is styled
as <makevar>USE_<replaceable>*</replaceable></makevar>. The
usage of these variables is restricted to the port
<filename>Makefile</filename>s and
<filename>ports/Mk/bsd.*.mk</filename> and is not designed
to encapsulate user-settable options &mdash; use
<makevar>WITH_<replaceable>*</replaceable></makevar> and
<makevar>WITHOUT_<replaceable>*</replaceable></makevar>
for that purpose.</para>
<note>
<para>It is <emphasis>always</emphasis> incorrect to set
any <makevar>USE_<replaceable>*</replaceable></makevar>
in <filename>/etc/make.conf</filename>. For instance,
setting <programlisting>USE_GCC=3.2</programlisting>
would adds a dependency on gcc32 for every port,
including gcc32 itself!</para>
</note>
<table frame="none">
<title>The <makevar>USE_<replaceable>*</replaceable></makevar>
@ -3231,42 +3250,6 @@ PATCHFILES= patch1:test</programlisting>
intention will be clear.</para>
</sect2>
<sect2>
<title>Optional dependencies</title>
<para>Some large applications can be built in a number of
configurations, adding functionality if one of a number of
libraries or applications is available. Since not all users
want those libraries or applications, the ports system
provides hooks that the port author can use to decide which
configuration should be built. Supporting these properly will
make users happy, and effectively provide 2 or more ports for the
price of one.</para>
<para>The easiest of these to use is
<makevar>WITHOUT_X11</makevar>. If the port can be built both
with and without X support, then it should normally be built
with X support. If <makevar>WITHOUT_X11</makevar> is defined,
then the version that does not have X support should be
built.</para>
<para>Various parts of GNOME have such knobs, though they are
slightly more difficult to use. The variables to use in the
<filename>Makefile</filename> are <makevar>WANT_*</makevar>
and <makevar>HAVE_*</makevar>. If the application can be
built both with or without one of the dependencies listed
below, then the <filename>Makefile</filename> should set
<makevar>WANT_PKG</makevar>, and should build the version that
uses <makevar>PKG</makevar> if <makevar>HAVE_PKG</makevar>
is defined.</para>
<para>The <makevar>WANT_*</makevar> variables currently
supported this way are <makevar>WANT_GLIB</makevar>,
<makevar>WANT_GTK</makevar>, <makevar>WANT_ESOUND</makevar>,
<makevar>WANT_IMLIB</makevar>, and
<makevar>WANT_GNOME</makevar>.</para>
</sect2>
<sect2>
<title>Circular dependencies are fatal</title>
@ -3286,6 +3269,142 @@ PATCHFILES= patch1:test</programlisting>
save a large number of people&mdash;including yourself&mdash;
a lot of grief in the process.</para>
</sect2>
</sect1>
<sect1 id="makefile-options">
<title>Makefile Options</title>
<para>Some large applications can be built in a number of
configurations, adding functionality if one of a number of
libraries or applications is available. Examples include
choice of natural (human) language, GUI versus command-line,
or type of database to support. Since not all users
want those libraries or applications, the ports system
provides hooks that the port author can use to control which
configuration should be built. Supporting these properly will
make users happy, and effectively provide 2 or more ports for the
price of one.</para>
<sect2>
<title><makevar>WITH_<replaceable>*</replaceable></makevar> and
<makevar>WITHOUT_<replaceable>*</replaceable></makevar></title>
<para>These variables are designed to be set by the system
administrator. There are many that are standardized in
<filename>ports/Mk/bsd.*.mk</filename>; others are not,
which can be confusing. If you need to add such a
configuration variable, please consider using one of the
ones from the following list.</para>
<note>
<para>You should not assume that a
<makevar>WITH_<replaceable>*</replaceable></makevar>
necessarily has a corresponding
<makevar>WITHOUT_<replaceable>*</replaceable></makevar>
variable and vice versa. In general, the default is
simply assumed.</para>
</note>
<note>
<para>Unless otherwise specified, these variables are only
tested for being set or not set, rather than being set to
some kind of variable such as <literal>YES</literal> or
<literal>NO</literal>.</para>
</note>
<table frame="none">
<title>The <makevar>WITH_<replaceable>*</replaceable></makevar>
and <makevar>WITHOUT_<replaceable>*</replaceable></makevar>
variables</title>
<tgroup cols="2">
<thead>
<row>
<entry>Variable</entry>
<entry>Means</entry>
</row>
</thead>
<tbody>
<row>
<entry><makevar>WITH_APACHE2</makevar></entry>
<entry>If set, use
<filename role="package">www/apache2</filename>
instead of the default of
<filename role="package">www/apache</filename>.</entry>
</row>
<row>
<entry><makevar>WITH_BERKELEY_DB</makevar></entry>
<entry>Define this variable to specify the ability to
use a variant of the Berkeley database package such as
<filename role="package">databases/db41</filename>.
An associated variable,
<entry><makevar>WITH_BDB_VER</makevar>, may be
set to values such as 2, 3, 4, 41 or 42.</entry>
</row>
<row>
<entry><makevar>WITHOUT_GETTEXT</makevar></entry>
<entry>If set, says that internationalization is not
needed, which can save compile time. By default,
internalization is used.</entry>
</row>
<row>
<entry><makevar>WITH_MYSQL</makevar></entry>
<entry>Define this variable to specify the ability to
use a variant of the MySQL database package such as
<filename role="package">databases/mysql40-server</filename>.
An associated variable,
<entry><makevar>WANT_MYSQL_VER</makevar>, may be
set to values such as 323, 40, 41, or 50.</entry>
</row>
<row>
<entry><makevar>WITH_OPENSSL_BASE</makevar></entry>
<entry>Use the version of OpenSSL in the base system.</entry>
</row>
<row>
<entry><makevar>WITH_OPENSSL_PORT</makevar></entry>
<entry>Use the version of OpenSSL from
<filename role="package">security/openssh</filename>,
overwriting the version that was originally installed
in the base system.</entry>
</row>
<row>
<entry><makevar>WITH_POSTGRESQL</makevar></entry>
<entry>Define this variable to specify the ability to
use a variant of the PostGreSQL database package such as
<filename role="package">databases/postgresql72</filename>.
</entry>
</row>
<row>
<entry><makevar>WITHOUT_X11</makevar></entry>
<entry>If the port can be built both with and without
X support, then it should normally be built with
with X support. If this variable is defined, then
then the version that does not have X support should
be built instead.</entry>
</row>
</tbody>
</tgroup>
</table>
</sect2>
</sect1>
<sect1 id="makefile-wrkdir">