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