Add a section about USE_SDL

Submitted by:	edwin
Reviewed by:	josef
Approved by:	simon
This commit is contained in:
Erwin Lansing 2004-02-01 21:59:30 +00:00
parent cff6110ebc
commit 3880ba475e
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=19932

View file

@ -3127,6 +3127,14 @@ PATCHFILES= patch1:test</programlisting>
building.</entry>
</row>
<row>
<entry><makevar>USE_SDL</makevar></entry>
<entry>The port uses <literal>SDL</literal> for
building and running. See <xref linkend="using-sdl"> on how to use
<makevar>USE_SDL</makevar>.</entry>
</row>
<row>
<entry><makevar>NO_INSTALL_MANPAGES</makevar></entry>
@ -3899,7 +3907,105 @@ LDCONFIG_DIRS= %%PREFIX%%/lib/foo %%PREFIX%%/lib/bar</programlisting>
<para>This section is yet to be written.</para>
</sect1>
</chapter>
<sect1 id="using-sdl">
<title>Using SDL</title>
<para>The <makevar>USE_SDL</makevar> variable is used to autoconfigure
the dependencies for ports which use an SDL based library like
<filename role="package">devel/sdl12</filename> and
<filename role="package">x11-toolkits/sdl_gui</filename>.</para>
<para>The following SDL libraries are recognized at the moment:</para>
<itemizedlist>
<listitem>
<para>sdl: <filename role="package">devel/sdl12</filename></para>
</listitem>
<listitem>
<para>gfx: <filename role="package">graphics/sdl_gfx</filename></para>
</listitem>
<listitem>
<para>gui: <filename role="package">x11-toolkits/sdl_gui</filename></para>
</listitem>
<listitem>
<para>image: <filename role="package">graphics/sdl_image</filename></para>
</listitem>
<listitem>
<para>ldbad: <filename role="package">devel/sdl_ldbad</filename></para>
</listitem>
<listitem>
<para>mixer: <filename role="package">audio/sdl_mixer</filename></para>
</listitem>
<listitem>
<para>mm: <filename role="package">devel/sdlmm</filename></para>
</listitem>
<listitem>
<para>net: <filename role="package">net/sdl_net</filename></para>
</listitem>
<listitem>
<para>sound: <filename role="package">audio/sdl_sound</filename></para>
</listitem>
<listitem>
<para>ttf: <filename role="package">graphics/sdl_ttf</filename></para>
</listitem>
</itemizedlist>
<para>Therefore, if a port has a dependency on
<filename role="package">net/sdl_net</filename> and
<filename role="package">audio/sdl_mixer</filename>,
the syntax will be:</para>
<programlisting>USE_SDL= net mixer</programlisting>
<para>The dependency <filename role="package">devel/sdl12</filename>,
which is required by <filename role="package">net/sdl_net</filename> and
<filename role="package">audio/sdl_mixer</filename>, is automatically
added as well.</para>
<para>If you use <makevar>USE_SDL</makevar>, it will automatically:</para>
<itemizedlist>
<listitem>
<para>Add a dependency on <application>sdl11-config</application> to
<makevar>BUILD_DEPENDS</makevar></para>
</listitem>
<listitem>
<para>Add the variable <makevar>SDL_CONFIG</makevar> to
<makevar>CONFIGURE_ENV</makevar></para>
</listitem>
<listitem>
<para>Add the dependencies of the selected libraries to the
<makevar>LIB_DEPENDS</makevar></para>
</listitem>
</itemizedlist>
<para>To check whether an SDL library is available, you can do it
with the <makevar>WANT_SDL</makevar> variable:</para>
<programlisting>WANT_SDL=yes
.include &lt;bsd.port.pre.mk&gt;
.if ${HAVE_SDL:Mmixer}!=""
USE_SDL+= mixer
.endif
.include &lt;bsd.port.post.mk&gt;</programlisting>
</sect1>
</chapter>
<!--