3 AC_DEFUN(jm_CHECK_DECLARATION,
5 AC_REQUIRE([AC_HEADER_STDC])dnl
6 test -z "$ac_cv_header_memory_h" && AC_CHECK_HEADERS(memory.h)
7 test -z "$ac_cv_header_string_h" && AC_CHECK_HEADERS(string.h)
8 test -z "$ac_cv_header_strings_h" && AC_CHECK_HEADERS(strings.h)
9 test -z "$ac_cv_header_stdlib_h" && AC_CHECK_HEADERS(stdlib.h)
10 test -z "$ac_cv_header_unistd_h" && AC_CHECK_HEADERS(unistd.h)
11 AC_MSG_CHECKING([whether $1 is declared])
12 AC_CACHE_VAL(jm_cv_func_decl_$1,
16 char *(*pfn) = (char *(*)) $1
19 eval "jm_cv_func_decl_$1=yes",
20 eval "jm_cv_func_decl_$1=no")])
22 if eval "test \"`echo '$jm_cv_func_decl_'$1`\" = yes"; then
24 ifelse([$3], , :, [$3])
32 dnl jm_CHECK_DECLARATIONS(INCLUDES, FUNCTION... [, ACTION-IF-DECLARED
33 dnl [, ACTION-IF-NOT-DECLARED]])
34 AC_DEFUN(jm_CHECK_DECLARATIONS,
38 jm_CHECK_DECLARATION($jm_func, $1,
40 jm_tr_func=HAVE_DECL_`echo $jm_func | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`
41 AC_DEFINE_UNQUOTED($jm_tr_func) $3], $4)dnl