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