4 Commits

Author SHA1 Message Date
Jose Bollo
d189d7b5ff Improve pkgconfig setting
This changes allows to use #include <json-c/json.h>
instead of just #include <json.h>

This is normally possible but in some tricky case
this usage is broken without this change.

Here is the case that I encountered. I had to
compile json-c fresh version for some investigations
on newer versions. Then I installed it on my local
environment using option --prefix. After that I
had 2 versions:

 - the system wide version in usual locations
   /usr/lib and /usr/include
 - mine in my HOME directory

Then, as I'm used to include <json-c/json.h>, the
included iheder's version was the system wide one
whereas the linked lib was mine.

Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2018-07-25 15:51:02 +02:00
Nicola Spanti (RyDroid)
250a3987cf Very minor changes not related to C source code 2016-08-08 15:13:43 +02:00
Thomas Petazzoni
93582ad85e Link against libm when needed
In certain C libraries (e.g uClibc), isnan() and related functions are
implemented in libm, so json-c needs to link against it. This commit
therefore adds an AC_TRY_LINK() test to check whether a program
calling isnan() can be properly linked with no special flags. If not,
we assume linking against libm is needed.

The json-c.pc.in file is also adjusted so that in the case of static
linking against json-c, -lm is also used.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-05-01 13:01:17 +02:00
Keith Derrick
30dd367c0a Modify install names for library and include files
Changing root name of library to json-c, and also the
directory where header files are installed to .../jsdon-c/*.

This avoids clashes with other implementations of JSON libraries.
2012-04-05 19:38:02 -07:00