You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 1.2 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. `json-c`
  2. ========
  3. Building on Unix with `git`, `gcc` and `autotools`
  4. --------------------------------------------------
  5. Home page for json-c: https://github.com/json-c/json-c/wiki
  6. Caution: do **NOT** use sources from svn.metaparadigm.com,
  7. they are old.
  8. Prerequisites:
  9. - `gcc`, `clang`, or another C compiler
  10. - `libtool`
  11. If you're not using a release tarball, you'll also need:
  12. - `autoconf` (`autoreconf`)
  13. - `automake`
  14. Make sure you have a complete `libtool` install, including `libtoolize`.
  15. `json-c` GitHub repo: https://github.com/json-c/json-c
  16. ```bash
  17. $ git clone https://github.com/json-c/json-c.git
  18. $ cd json-c
  19. $ sh autogen.sh
  20. ```
  21. followed by
  22. ```bash
  23. $ ./configure
  24. $ make
  25. $ make install
  26. ```
  27. To build and run the test programs:
  28. ```bash
  29. $ make check
  30. ```
  31. Linking to `libjson-c`
  32. ----------------------
  33. If your system has `pkgconfig`,
  34. then you can just add this to your `makefile`:
  35. ```make
  36. CFLAGS += $(shell pkg-config --cflags json-c)
  37. LDFLAGS += $(shell pkg-config --libs json-c)
  38. ```
  39. Without `pkgconfig`, you would do something like this:
  40. ```make
  41. JSON_C_DIR=/path/to/json_c/install
  42. CFLAGS += -I$(JSON_C_DIR)/include/json-c
  43. LDFLAGS+= -L$(JSON_C_DIR)/lib -ljson-c
  44. ```