bassosimone/libight — pull request #30 by bassosimone (2014-09-23 06:31:31+00:00)
Title: Build JsonCpp along with libight

We need JSON support to implement the *Header Field Manipulation* OONI test (see #29).

This pull request adds JsonCpp as a git submodule. It also tweaks the autotools build system so that one can choose whether to use the system-wide JsonCpp or to use the builtin one.

The possibility to choose between the system-wide and the builtin JsonCpp was tested on my Xubuntu 14.04 netbook.

Regarding the builtin JsonCpp, I choose to build it using the amalgamated source file and header. This simplifies things, because we can bypass CMake.

Since distributions typically do not install the amalgamated header, I needed to add one extra header that selects the system-wide or builtin amalgamated header depending on how libight was configured.

I also added a basic smoke test, to make sure that JsonCpp functionality is available when compiling libight (this is mostly useful when building the builtin JsonCpp along with libight).

Note that the amalgamated source file and header are generated by invoking `python amalgamate.py` on JsonCpp's topdir. I could have modified the autotools build system to run that command automatically at the end of `./configure`, but I didn't because I was unsure whether that was too much automation.