3 dnl This is just a wrapper function to encapsulate this kludge.
4 dnl Putting it in a separate file like this helps share it between
5 dnl different packages.
6 AC_DEFUN(jm_CHECK_DECLS,
8 AC_REQUIRE([_jm_DECL_HEADERS])
9 AC_REQUIRE([AC_HEADER_TIME])
13 # if !STDC_HEADERS && HAVE_MEMORY_H
29 #include <sys/types.h>
30 #if TIME_WITH_SYS_TIME
31 # include <sys/time.h>
35 # include <sys/time.h>
43 dnl This code is deliberately never run via ./configure.
44 dnl FIXME: this is a gross hack to make autoheader put entries
45 dnl for each of these symbols in the config.h.in.
46 dnl Otherwise, I'd have to update acconfig.h every time I change
47 dnl this list of functions.
48 AC_DEFINE(HAVE_DECL_FREE, 1, [Define if this function is declared.])
49 AC_DEFINE(HAVE_DECL_LSEEK, 1, [Define if this function is declared.])
50 AC_DEFINE(HAVE_DECL_MALLOC, 1, [Define if this function is declared.])
51 AC_DEFINE(HAVE_DECL_MEMCHR, 1, [Define if this function is declared.])
52 AC_DEFINE(HAVE_DECL_REALLOC, 1, [Define if this function is declared.])
53 AC_DEFINE(HAVE_DECL_STPCPY, 1, [Define if this function is declared.])
54 AC_DEFINE(HAVE_DECL_STRSTR, 1, [Define if this function is declared.])
55 AC_DEFINE(HAVE_DECL_STRTOUL, 1, [Define if this function is declared.])
56 AC_DEFINE(HAVE_DECL_STRTOULL, 1, [Define if this function is declared.])
57 AC_DEFINE(HAVE_DECL_NANOSLEEP, 1, [Define if this function is declared.])
60 jm_CHECK_DECLARATIONS($headers, free lseek malloc \
61 memchr nanosleep realloc stpcpy strstr strtoul strtoull)
64 dnl FIXME: when autoconf has support for it.
65 dnl This is a little helper so we can require these header checks.
66 AC_DEFUN(_jm_DECL_HEADERS,
68 AC_REQUIRE([AC_HEADER_STDC])
69 AC_CHECK_HEADERS(memory.h string.h strings.h stdlib.h unistd.h sys/time.h)