Merge 8d46a3c691776bcda7ad0e55c481b41d41235e33 on remote branch

Change-Id: I79d7b3d899f1882dcf39c03632438b37e67d6140
tree: 405c963f163066a33bc883df0889415e7daab24d
  1. Android.configure.mk
  2. Android.mk
  3. arraylist.c
  4. arraylist.h
  5. AUTHORS
  6. autogen.sh
  7. bits.h
  8. ChangeLog
  9. config.h
  10. config.h.in
  11. configure.ac
  12. COPYING
  13. debug.c
  14. debug.h
  15. Doxyfile
  16. json-c-uninstalled.pc.in
  17. json-c.pc.in
  18. json.h
  19. json_c_version.c
  20. json_c_version.h
  21. json_config.h
  22. json_config.h.in
  23. json_inttypes.h
  24. json_object.c
  25. json_object.h
  26. json_object_iterator.c
  27. json_object_iterator.h
  28. json_object_private.h
  29. json_tokener.c
  30. json_tokener.h
  31. json_util.c
  32. json_util.h
  33. libjson.c
  34. linkhash.c
  35. linkhash.h
  36. Makefile.am
  37. Makefile.am.inc
  38. math_compat.h
  39. printbuf.c
  40. printbuf.h
  41. random_seed.c
  42. random_seed.h
  43. README
  44. README-WIN32.html
  45. README.html
  46. README.md
  47. RELEASE_CHECKLIST.txt
README.md

json-c

Building on Unix with git, gcc and autotools

Home page for json-c: https://github.com/json-c/json-c/wiki

Caution: do NOT use sources from svn.metaparadigm.com, they are old.

Prerequisites:

  • gcc, clang, or another C compiler
  • libtool

If you're not using a release tarball, you'll also need:

  • autoconf (autoreconf)
  • automake

Make sure you have a complete libtool install, including libtoolize.

json-c GitHub repo: https://github.com/json-c/json-c

$ git clone https://github.com/json-c/json-c.git
$ cd json-c
$ sh autogen.sh

followed by

$ ./configure
$ make
$ make install

To build and run the test programs:

$ make check

Linking to libjson-c

If your system has pkgconfig, then you can just add this to your makefile:

CFLAGS += $(shell pkg-config --cflags json-c)
LDFLAGS += $(shell pkg-config --libs json-c)

Without pkgconfig, you would do something like this:

JSON_C_DIR=/path/to/json_c/install
CFLAGS += -I$(JSON_C_DIR)/include/json-c
LDFLAGS+= -L$(JSON_C_DIR)/lib -ljson-c