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.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. $ touch aclocal.m4 Makefile.in # hack around automake dependencies
  20. $ make
  21. $ make install
  22. To build and run the test programs run
  23. $ make check
  24. Linking to libjson-c
  25. If your system has pkgconfig then you can just add this to your makefile
  26. CFLAGS += $(shell pkg-config --cflags json-c)
  27. LDFLAGS += $(shell pkg-config --libs json-c)
  28. Without pkgconfig, you would do something like this:
  29. JSON_C_DIR=/path/to/json_c/install
  30. CFLAGS += -I$(JSON_C_DIR)/include/json-c
  31. LDFLAGS+= -L$(JSON_C_DIR)/lib -ljson-c