<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
   "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  <!ENTITY % general-entities SYSTEM "../../general.ent">
  %general-entities;

  <!ENTITY sdl-download-http "http://www.libsdl.org/release/SDL-&sdl-version;.tar.gz">
  <!ENTITY sdl-download-ftp  " ">
  <!ENTITY sdl-md5sum        "9d96df8417572a2afb781a7c4c811a85">
  <!ENTITY sdl-size          "3.8 MB">
  <!ENTITY sdl-buildsize     "40 MB">
  <!ENTITY sdl-time          "0.6 SBU">
]>

<sect1 id="sdl" xreflabel="SDL-&sdl-version;">
  <?dbhtml filename="sdl.html"?>

  <sect1info>
    <othername>$LastChangedBy: bdubbs $</othername>
    <date>$Date: 2015-02-23 00:16:54 -0500 (Mon, 23 Feb 2015) $</date>
  </sect1info>

  <title>SDL-&sdl-version;</title>

  <indexterm zone="sdl">
    <primary sortas="a-SDL">SDL</primary>
  </indexterm>

  <sect2 role="package">
    <title>Introduction to SDL</title>

    <para>The Simple DirectMedia Layer (<application>SDL</application>
    for short) is a cross-platform library designed to make it easy to write
    multimedia software, such as games and emulators.</para>

    &lfs77_checked;

    <bridgehead renderas="sect3">Package Information</bridgehead>
    <itemizedlist spacing="compact">
      <listitem>
        <para>Download (HTTP): <ulink url="&sdl-download-http;"/></para>
      </listitem>
      <listitem>
        <para>Download (FTP): <ulink url="&sdl-download-ftp;"/></para>
      </listitem>
      <listitem>
        <para>Download MD5 sum: &sdl-md5sum;</para>
      </listitem>
      <listitem>
        <para>Download size: &sdl-size;</para>
      </listitem>
      <listitem>
        <para>Estimated disk space required: &sdl-buildsize;</para>
      </listitem>
      <listitem>
        <para>Estimated build time: &sdl-time;</para>
      </listitem>
    </itemizedlist>

    <bridgehead renderas="sect3">SDL Dependencies</bridgehead>

    <bridgehead renderas="sect4">Optional</bridgehead>
    <para role="optional">
      <xref linkend="alsa"/>,
      <xref linkend='pulseaudio'/>
      <xref linkend="nasm"/>,
      <xref linkend="x-window-system"/>,
      <xref linkend="glu"/>,
      <xref linkend="aalib"/>,
      <xref linkend="pth"/>,
      <ulink url="http://www.directfb.org/">DirectFB</ulink>,
      <ulink url="http://www.ggi-project.org/">GGI</ulink>,
      <ulink url="http://my.arava.co.il/~matan/svgalib/">SVGAlib-1.9.5</ulink>
      (<ulink url="&patch-root;/svgalib-1.9.25-megafixes-1.patch">patched</ulink>),
      <ulink url="http://caca.zoy.org/wiki/libcaca">libcaca</ulink> and
      <ulink url="http://picogui.org/">PicoGUI</ulink>
    </para>

    <para condition="html" role="usernotes">User Notes:
    <ulink url="&blfs-wiki;/sdl"/></para>

  </sect2>

  <sect2 role="installation">
    <title>Installation of SDL</title>

    <para>Install <application>SDL</application> by running the
    following commands:</para>

<screen><userinput>sed -i '/_XData32/s:register long:register _Xconst long:' src/video/x11/SDL_x11sym.h &amp;&amp;

./configure --prefix=/usr --disable-static --disable-sdl-dlopen &amp;&amp;
make</userinput></screen>

    <para>Now, as the <systemitem class="username">root</systemitem> user:</para>

<screen role="root"><userinput>make install &amp;&amp;

install -v -m755 -d /usr/share/doc/SDL-&sdl-version;/html &amp;&amp;
install -v -m644    docs/html/*.html \
                    /usr/share/doc/SDL-&sdl-version;/html</userinput></screen>

  </sect2>

  <sect2 role="testing">
    <title>Testing SDL</title>

    <para>If you wish to, test the installation of
    <application>SDL</application> using the included
    test programs. It is not required to install any of the resulting binaries
    to validate the installation. Issue the following commands to build the
    test programs:</para>

<screen><userinput>cd test &amp;&amp;
./configure &amp;&amp;
make</userinput></screen>

    <para>You'll need to manually run all the test programs (they are listed in
    the <filename>README</filename> file in this directory).  Many of them will
    need to be manually killed, and you'll need to turn your speakers on with the
    volume at a suitable level.</para>

  </sect2>

  <sect2 role="commands">
    <title>Command Explanations</title>

    <para><command>sed -i ...</command>: This command fixes compilation with libX11-1.6.0</para>

    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
      href="../../xincludes/static-libraries.xml"/>

    <para><parameter>--disable-sdl-dlopen</parameter>: This switch disables
    using dlopen for shared object loading.</para>

  </sect2>

  <sect2 role="configuration">
    <title>Configuring SDL</title>

    <sect3>
      <title>Configuration Information</title>

      <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
      href="../../xincludes/lib-config.xml"/>

    </sect3>

  </sect2>

  <sect2 role="content">
    <title>Contents</title>

    <segmentedlist>
      <segtitle>Installed Program</segtitle>
      <segtitle>Installed Libraries</segtitle>
      <segtitle>Installed Directories</segtitle>

      <seglistitem>
        <seg>sdl-config</seg>
        <seg>libSDL.so and libSDLmain.a</seg>
        <seg>/usr/include/SDL and /usr/share/doc/SDL-&sdl-version;</seg>
      </seglistitem>
    </segmentedlist>

    <variablelist>
      <bridgehead renderas="sect3">Short Descriptions</bridgehead>
      <?dbfo list-presentation="list"?>
      <?dbhtml list-presentation="table"?>

      <varlistentry id="sdl-config">
        <term><command>sdl-config</command></term>
        <listitem>
          <para>determines the compile and linker flags that should be used to
          compile and link programs that use
          <filename class='libraryfile'>libSDL</filename>.</para>
          <indexterm zone="sdl sdl-config">
            <primary sortas="b-sdl-config">sdl-config</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="libsdl">
        <term><filename class='libraryfile'>libSDL.so</filename></term>
        <listitem>
          <para> library provides low level access to audio, keyboard, mouse,
          joystick, 3D hardware via OpenGL, and
          2D frame buffer across multiple platforms.</para>
          <indexterm zone="sdl libsdl">
            <primary sortas="c-libsdl">libSDL.so</primary>
          </indexterm>
        </listitem>
      </varlistentry>

    </variablelist>

  </sect2>

</sect1>
