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.

configure.in 1.8 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. AC_PREREQ(2.52)
  2. # Process this file with autoconf to produce a configure script.
  3. AC_INIT([json-c], 0.10, [json-c@googlegroups.com])
  4. AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
  5. AC_PROG_MAKE_SET
  6. AC_ARG_ENABLE(oldname-compat,
  7. AS_HELP_STRING([--disable-oldname-compat],
  8. [Don't include the old libjson.so library and include/json directory.]),
  9. [],
  10. [enable_oldname_compat=yes]
  11. )
  12. AM_CONDITIONAL(ENABLE_OLDNAME_COMPAT, [test "x${enable_oldname_compat}" != "xno"])
  13. # Checks for programs.
  14. # Checks for libraries.
  15. # Checks for header files.
  16. AM_CONFIG_HEADER(config.h)
  17. AM_CONFIG_HEADER(json_config.h)
  18. AC_HEADER_STDC
  19. AC_CHECK_HEADERS(fcntl.h limits.h strings.h syslog.h unistd.h [sys/cdefs.h] [sys/param.h] stdarg.h locale.h)
  20. AC_CHECK_HEADER(inttypes.h,[AC_DEFINE([JSON_C_HAVE_INTTYPES_H],[1],[Public define for json_inttypes.h])])
  21. # Checks for typedefs, structures, and compiler characteristics.
  22. AC_C_CONST
  23. AC_TYPE_SIZE_T
  24. # Checks for library functions.
  25. AC_FUNC_VPRINTF
  26. AC_FUNC_MEMCMP
  27. AC_FUNC_MALLOC
  28. AC_FUNC_REALLOC
  29. AC_CHECK_FUNCS(strcasecmp strdup strndup strerror snprintf vsnprintf vasprintf open vsyslog strncasecmp setlocale)
  30. #check if .section.gnu.warning accepts long strings (for __warn_references)
  31. AC_LANG_PUSH([C])
  32. AC_MSG_CHECKING([if .gnu.warning accepts long strings])
  33. AC_LINK_IFELSE([[
  34. extern void json_object_get();
  35. __asm__(".section .gnu.json_object_get,\n\t.ascii \"Please link against libjson-c instead of libjson\"\n\t.text");
  36. int main(int c,char* v) {return 0;}
  37. ]], [
  38. AC_DEFINE(HAS_GNU_WARNING_LONG, 1, [Define if .gnu.warning accepts long strings.])
  39. AC_MSG_RESULT(yes)
  40. ], [
  41. AC_MSG_RESULT(no)
  42. ])
  43. AC_LANG_POP([C])
  44. AM_PROG_LIBTOOL
  45. AC_CONFIG_FILES([
  46. Makefile
  47. json.pc
  48. json-c.pc
  49. tests/Makefile
  50. json-c-uninstalled.pc
  51. ])
  52. AC_OUTPUT