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 1.0 kB

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