Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 1bf9e5c843e97403254f737cd1156812 > files > 26

jansson-devel-1.2-1.fc13.x86_64.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Getting Started &mdash; Jansson v1.2 documentation</title>
    <link rel="stylesheet" href="_static/default.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '#',
        VERSION:     '1.2',
        COLLAPSE_MODINDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="top" title="Jansson v1.2 documentation" href="index.html" />
    <link rel="next" title="Tutorial" href="tutorial.html" />
    <link rel="prev" title="Jansson Documentation" href="index.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="tutorial.html" title="Tutorial"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="index.html" title="Jansson Documentation"
             accesskey="P">previous</a> |</li>
        <li><a href="index.html">Jansson v1.2 documentation</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="getting-started">
<h1>Getting Started<a class="headerlink" href="#getting-started" title="Permalink to this headline">¶</a></h1>
<div class="section" id="compiling-and-installing-jansson">
<h2>Compiling and Installing Jansson<a class="headerlink" href="#compiling-and-installing-jansson" title="Permalink to this headline">¶</a></h2>
<p>The Jansson source is available at
<a class="reference external" href="http://www.digip.org/jansson/releases/">http://www.digip.org/jansson/releases/</a>.</p>
<p>Unpack the source tarball and change to the source directory:</p>
<pre class="literal-block">
bunzip2 -c jansson-1.2.tar.bz2 | tar xf -
cd jansson-1.2
</pre>
<p>The source uses GNU Autotools (<a class="reference external" href="http://www.gnu.org/software/autoconf/">autoconf</a>, <a class="reference external" href="http://www.gnu.org/software/automake/">automake</a>, <a class="reference external" href="http://www.gnu.org/software/libtool/">libtool</a>), so
compiling and installing is extremely simple:</p>
<div class="highlight-c"><div class="highlight"><pre><span class="p">.</span><span class="o">/</span><span class="n">configure</span>
<span class="n">make</span>
<span class="n">make</span> <span class="n">check</span>
<span class="n">make</span> <span class="n">install</span>
</pre></div>
</div>
<p>To change the destination directory (<tt class="docutils literal"><span class="pre">/usr/local</span></tt> by default), use
the <tt class="docutils literal"><span class="pre">--prefix=DIR</span></tt> argument to <tt class="docutils literal"><span class="pre">./configure</span></tt>. See <tt class="docutils literal"><span class="pre">./configure</span>
<span class="pre">--help</span></tt> for the list of all possible installation options. (There are
no options to customize the resulting Jansson binary.)</p>
<p>The command <tt class="docutils literal"><span class="pre">make</span> <span class="pre">check</span></tt> runs the test suite distributed with
Jansson. This step is not strictly necessary, but it may find possible
problems that Jansson has on your platform. If any problems are found,
please report them.</p>
<p>If you obtained the source from a Git repository (or any other source
control system), there&#8217;s no <tt class="docutils literal"><span class="pre">./configure</span></tt> script as it&#8217;s not kept in
version control. To create the script, Autotools needs to be
bootstrapped. There are many ways to do this, but the easiest one is
to use <tt class="docutils literal"><span class="pre">autoreconf</span></tt>:</p>
<div class="highlight-c"><div class="highlight"><pre><span class="n">autoreconf</span> <span class="o">-</span><span class="n">vi</span>
</pre></div>
</div>
<p>This command creates the <tt class="docutils literal"><span class="pre">./configure</span></tt> script, which can then be
used as described above.</p>
<div class="section" id="installing-prebuilt-binary-packages">
<h3>Installing Prebuilt Binary Packages<a class="headerlink" href="#installing-prebuilt-binary-packages" title="Permalink to this headline">¶</a></h3>
<p>Binary <tt class="docutils literal"><span class="pre">.deb</span></tt> packages for Ubuntu are available in <a class="reference external" href="http://launchpad.net/~petri/+archive/ppa">this PPA</a> at
<a class="reference external" href="http://launchpad.net/">Launchpad</a>. Follow the instructions in the PPA (&#8220;Technical details
about this PPA&#8221; link) to take the PPA into use. Then install the -dev
package:</p>
<div class="highlight-c"><div class="highlight"><pre><span class="n">sudo</span> <span class="n">apt</span><span class="o">-</span><span class="n">get</span> <span class="n">install</span> <span class="n">libjansson</span><span class="o">-</span><span class="n">dev</span>
</pre></div>
</div>
</div>
<div class="section" id="building-the-documentation">
<h3>Building the Documentation<a class="headerlink" href="#building-the-documentation" title="Permalink to this headline">¶</a></h3>
<p>(This subsection describes how to build the HTML documentation you are
currently reading, so it can be safely skipped.)</p>
<p>Documentation is in the <tt class="docutils literal"><span class="pre">doc/</span></tt> subdirectory. It&#8217;s written in
<a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> with <a class="reference external" href="http://sphinx.pocoo.org/">Sphinx</a> annotations. To generate the HTML
documentation, invoke:</p>
<div class="highlight-c"><div class="highlight"><pre><span class="n">make</span> <span class="n">html</span>
</pre></div>
</div>
<p>and point your browser to <tt class="docutils literal"><span class="pre">doc/_build/html/index.html</span></tt>. <a class="reference external" href="http://sphinx.pocoo.org/">Sphinx</a> is
required to generate the documentation.</p>
</div>
</div>
<div class="section" id="compiling-programs-that-use-jansson">
<h2>Compiling Programs That Use Jansson<a class="headerlink" href="#compiling-programs-that-use-jansson" title="Permalink to this headline">¶</a></h2>
<p>Jansson involves one C header file, <tt class="docutils literal"><span class="pre">jansson.h</span></tt>, so it&#8217;s enough
to put the line</p>
<div class="highlight-c"><div class="highlight"><pre><span class="cp">#include &lt;jansson.h&gt;</span>
</pre></div>
</div>
<p>in the beginning of every source file that uses Jansson.</p>
<p>There&#8217;s also just one library to link with, <tt class="docutils literal"><span class="pre">libjansson</span></tt>. Compile and
link the program as follows:</p>
<div class="highlight-c"><div class="highlight"><pre><span class="n">cc</span> <span class="o">-</span><span class="n">o</span> <span class="n">prog</span> <span class="n">prog</span><span class="p">.</span><span class="n">c</span> <span class="o">-</span><span class="n">ljansson</span>
</pre></div>
</div>
<p>Starting from version 1.2, there&#8217;s also support for <a class="reference external" href="http://pkg-config.freedesktop.org/">pkg-config</a>:</p>
<div class="highlight-c"><pre>cc -o prog prog.c `pkg-config --cflags --libs jansson`</pre>
</div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
            <h3><a href="index.html">Table Of Contents</a></h3>
            <ul>
<li><a class="reference external" href="#">Getting Started</a><ul>
<li><a class="reference external" href="#compiling-and-installing-jansson">Compiling and Installing Jansson</a><ul>
<li><a class="reference external" href="#installing-prebuilt-binary-packages">Installing Prebuilt Binary Packages</a></li>
<li><a class="reference external" href="#building-the-documentation">Building the Documentation</a></li>
</ul>
</li>
<li><a class="reference external" href="#compiling-programs-that-use-jansson">Compiling Programs That Use Jansson</a></li>
</ul>
</li>
</ul>

            <h4>Previous topic</h4>
            <p class="topless"><a href="index.html"
                                  title="previous chapter">Jansson Documentation</a></p>
            <h4>Next topic</h4>
            <p class="topless"><a href="tutorial.html"
                                  title="next chapter">Tutorial</a></p>
            <h3>This Page</h3>
            <ul class="this-page-menu">
              <li><a href="_sources/gettingstarted.txt"
                     rel="nofollow">Show Source</a></li>
            </ul>
          <div id="searchbox" style="display: none">
            <h3>Quick search</h3>
              <form class="search" action="search.html" method="get">
                <input type="text" name="q" size="18" />
                <input type="submit" value="Go" />
                <input type="hidden" name="check_keywords" value="yes" />
                <input type="hidden" name="area" value="default" />
              </form>
              <p class="searchtip" style="font-size: 90%">
              Enter search terms or a module, class or function name.
              </p>
          </div>
          <script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="tutorial.html" title="Tutorial"
             >next</a> |</li>
        <li class="right" >
          <a href="index.html" title="Jansson Documentation"
             >previous</a> |</li>
        <li><a href="index.html">Jansson v1.2 documentation</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
      &copy; Copyright 2009, Petri Lehtinen.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.4.
    </div>
  </body>
</html>