diff --git a/en_US.ISO8859-1/books/porters-handbook/book.sgml b/en_US.ISO8859-1/books/porters-handbook/book.sgml index cc81a3a06d..97033a5da1 100644 --- a/en_US.ISO8859-1/books/porters-handbook/book.sgml +++ b/en_US.ISO8859-1/books/porters-handbook/book.sgml @@ -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 <bsd.port.pre.mk> + +.if ${HAVE_SDL:Mmixer}!="" +USE_SDL+= mixer +.endif + +.include <bsd.port.post.mk></programlisting> + + </sect1> + </chapter> <!--