Michael Clark | 4504df7 | 2007-03-13 08:26:20 +0000 | [diff] [blame] | 1 | AC_PREREQ(2.52) |
| 2 | |
| 3 | # Process this file with autoconf to produce a configure script. |
Eric Haszlakiewicz | 4207147 | 2013-04-02 21:22:59 -0500 | [diff] [blame] | 4 | AC_INIT([json-c], 0.11.99, [json-c@googlegroups.com]) |
Michael Clark | 4504df7 | 2007-03-13 08:26:20 +0000 | [diff] [blame] | 5 | |
| 6 | AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) |
| 7 | |
Eric Haszlakiewicz | 1e89ba6 | 2012-04-22 10:27:50 -0500 | [diff] [blame] | 8 | AC_PROG_MAKE_SET |
| 9 | |
Eric Haszlakiewicz | 075b783 | 2012-07-29 17:48:22 -0500 | [diff] [blame] | 10 | AC_ARG_ENABLE(oldname-compat, |
| 11 | AS_HELP_STRING([--disable-oldname-compat], |
| 12 | [Don't include the old libjson.so library and include/json directory.]), |
| 13 | [], |
| 14 | [enable_oldname_compat=yes] |
| 15 | ) |
| 16 | AM_CONDITIONAL(ENABLE_OLDNAME_COMPAT, [test "x${enable_oldname_compat}" != "xno"]) |
| 17 | |
Michael Clark | 4504df7 | 2007-03-13 08:26:20 +0000 | [diff] [blame] | 18 | # Checks for programs. |
| 19 | |
| 20 | # Checks for libraries. |
| 21 | |
| 22 | # Checks for header files. |
Ross Burton | 89535bb | 2013-11-18 16:25:14 +0000 | [diff] [blame^] | 23 | AM_PROG_CC_C_O |
Thomas Gstädtner | 36ec47d | 2013-03-03 00:17:25 +0100 | [diff] [blame] | 24 | AC_CONFIG_HEADER(config.h) |
| 25 | AC_CONFIG_HEADER(json_config.h) |
Michael Clark | 4504df7 | 2007-03-13 08:26:20 +0000 | [diff] [blame] | 26 | AC_HEADER_STDC |
Remi Collet | 16a4a32 | 2012-11-27 11:06:49 +0100 | [diff] [blame] | 27 | AC_CHECK_HEADERS(fcntl.h limits.h strings.h syslog.h unistd.h [sys/cdefs.h] [sys/param.h] stdarg.h locale.h) |
Eric Haszlakiewicz | b21b137 | 2012-02-15 20:44:54 -0600 | [diff] [blame] | 28 | AC_CHECK_HEADER(inttypes.h,[AC_DEFINE([JSON_C_HAVE_INTTYPES_H],[1],[Public define for json_inttypes.h])]) |
Michael Clark | 4504df7 | 2007-03-13 08:26:20 +0000 | [diff] [blame] | 29 | |
| 30 | # Checks for typedefs, structures, and compiler characteristics. |
| 31 | AC_C_CONST |
| 32 | AC_TYPE_SIZE_T |
| 33 | |
| 34 | # Checks for library functions. |
| 35 | AC_FUNC_VPRINTF |
| 36 | AC_FUNC_MEMCMP |
| 37 | AC_FUNC_MALLOC |
| 38 | AC_FUNC_REALLOC |
Even Rouault | 1a957c2 | 2013-08-12 20:49:19 +0200 | [diff] [blame] | 39 | AC_CHECK_FUNCS(strcasecmp strdup strerror snprintf vsnprintf vasprintf open vsyslog strncasecmp setlocale) |
Michael Clark | 4504df7 | 2007-03-13 08:26:20 +0000 | [diff] [blame] | 40 | |
Lin Xu | e7e0600 | 2012-09-09 17:33:35 -0700 | [diff] [blame] | 41 | #check if .section.gnu.warning accepts long strings (for __warn_references) |
| 42 | AC_LANG_PUSH([C]) |
| 43 | |
| 44 | AC_MSG_CHECKING([if .gnu.warning accepts long strings]) |
| 45 | AC_LINK_IFELSE([[ |
| 46 | extern void json_object_get(); |
| 47 | __asm__(".section .gnu.json_object_get,\n\t.ascii \"Please link against libjson-c instead of libjson\"\n\t.text"); |
| 48 | |
| 49 | int main(int c,char* v) {return 0;} |
| 50 | ]], [ |
| 51 | AC_DEFINE(HAS_GNU_WARNING_LONG, 1, [Define if .gnu.warning accepts long strings.]) |
| 52 | AC_MSG_RESULT(yes) |
| 53 | ], [ |
| 54 | AC_MSG_RESULT(no) |
| 55 | ]) |
| 56 | |
| 57 | AC_LANG_POP([C]) |
| 58 | |
Michael Clark | 4504df7 | 2007-03-13 08:26:20 +0000 | [diff] [blame] | 59 | AM_PROG_LIBTOOL |
| 60 | |
Eric Haszlakiewicz | 1e89ba6 | 2012-04-22 10:27:50 -0500 | [diff] [blame] | 61 | AC_CONFIG_FILES([ |
Michael Clark | 4504df7 | 2007-03-13 08:26:20 +0000 | [diff] [blame] | 62 | Makefile |
Eric Haszlakiewicz | 1f9d199 | 2012-07-29 18:25:09 -0500 | [diff] [blame] | 63 | json.pc |
Keith Derrick | 30dd367 | 2012-03-30 12:28:32 -0700 | [diff] [blame] | 64 | json-c.pc |
Eric Haszlakiewicz | 1e89ba6 | 2012-04-22 10:27:50 -0500 | [diff] [blame] | 65 | tests/Makefile |
Eric Haszlakiewicz | 1f9d199 | 2012-07-29 18:25:09 -0500 | [diff] [blame] | 66 | json-c-uninstalled.pc |
Michael Clark | 4504df7 | 2007-03-13 08:26:20 +0000 | [diff] [blame] | 67 | ]) |
Eric Haszlakiewicz | 1e89ba6 | 2012-04-22 10:27:50 -0500 | [diff] [blame] | 68 | |
| 69 | AC_OUTPUT |
| 70 | |