Add a section describing how to build on Windows
[jansson.git] / doc / gettingstarted.rst
index 2221d07..45ec10c 100644 (file)
@@ -10,6 +10,9 @@ Compiling and Installing Jansson
 The Jansson source is available at
 http://www.digip.org/jansson/releases/.
 
+Unix-like systems
+-----------------
+
 Unpack the source tarball and change to the source directory:
 
 .. parsed-literal::
@@ -31,9 +34,9 @@ the ``--prefix=DIR`` argument to ``./configure``. See ``./configure
 no options to customize the resulting Jansson binary.)
 
 The command ``make check`` runs the test suite distributed with
-Jansson. Python_ is required to run the tests. 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.
+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.
 
 If you obtained the source from a Git repository (or any other source
 control system), there's no ``./configure`` script as it's not kept in
@@ -44,19 +47,38 @@ to use ``autoreconf``::
     autoreconf -vi
 
 This command creates the ``./configure`` script, which can then be
-used as described in the previous section.
+used as described above.
 
 .. _autoconf: http://www.gnu.org/software/autoconf/
 .. _automake: http://www.gnu.org/software/automake/
 .. _libtool: http://www.gnu.org/software/libtool/
-.. _Python: http://www.python.org/
+
+
+Windows
+-------
+
+On Windows (and other non-Unix-like systems), you may be unable to run
+the ``./configure`` script. In this case, follow these steps. All the
+files mentioned can be found in the ``src/`` directory.
+
+1. Rename ``jansson_config.h.win32`` to ``jansson_config.h``. This
+   file has some platform-specific parameters that are normally filled
+   in by the ``./configure`` script.
+
+2. Make ``jansson.h`` and ``jansson_config.h`` available to the
+   compiler, so that they can be found when compiling programs that
+   use Jansson.
+
+3. Compile all the ``.c`` files (in the ``src/`` directory) into a
+   library file. Make the library available to the compiler, as in
+   step 2.
 
 
 Installing Prebuilt Binary Packages
 -----------------------------------
 
-Binary ``.deb`` packages for Ubuntu are available in `this PPA`_ at
-Launchpad_. Follow the instructions in the PPA ("Technical details
+Binary ``.deb`` packages for Ubuntu Linux are available in `this PPA`_
+at Launchpad_. Follow the instructions in the PPA ("Technical details
 about this PPA" link) to take the PPA into use. Then install the -dev
 package::
 
@@ -85,8 +107,8 @@ required to generate the documentation.
 .. _Sphinx: http://sphinx.pocoo.org/
 
 
-Compiling Programs Using Jansson
-================================
+Compiling Programs That Use Jansson
+===================================
 
 Jansson involves one C header file, :file:`jansson.h`, so it's enough
 to put the line
@@ -101,3 +123,9 @@ There's also just one library to link with, ``libjansson``. Compile and
 link the program as follows::
 
     cc -o prog prog.c -ljansson
+
+Starting from version 1.2, there's also support for pkg-config_::
+
+    cc -o prog prog.c `pkg-config --cflags --libs jansson`
+
+.. _pkg-config: http://pkg-config.freedesktop.org/