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.1 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. Prerequisites:
  7. - `gcc`, `clang`, or another C compiler
  8. - `libtool`
  9. If you're not using a release tarball, you'll also need:
  10. - `autoconf` (`autoreconf`)
  11. - `automake`
  12. Make sure you have a complete `libtool` install, including `libtoolize`.
  13. `json-c` GitHub repo: https://github.com/json-c/json-c
  14. ```bash
  15. $ git clone https://github.com/json-c/json-c.git
  16. $ cd json-c
  17. $ sh autogen.sh
  18. ```
  19. followed by
  20. ```bash
  21. $ ./configure
  22. $ make
  23. $ make install
  24. ```
  25. To build and run the test programs:
  26. ```bash
  27. $ make check
  28. ```
  29. Linking to `libjson-c`
  30. ----------------------
  31. If your system has `pkgconfig`,
  32. then you can just add this to your `makefile`:
  33. ```make
  34. CFLAGS += $(shell pkg-config --cflags json-c)
  35. LDFLAGS += $(shell pkg-config --libs json-c)
  36. ```
  37. Without `pkgconfig`, you would do something like this:
  38. ```make
  39. JSON_C_DIR=/path/to/json_c/install
  40. CFLAGS += -I$(JSON_C_DIR)/include/json-c
  41. LDFLAGS+= -L$(JSON_C_DIR)/lib -ljson-c
  42. ```