* locate/Makefile.am: remove creation of updatedb, since it is now
[findutils.git] / m4 / decl.m4
blob69438b706a7ace8e5c1d5af161baa894c138a7f1
1 #serial 3
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,
13     [AC_TRY_COMPILE($2,
14       [
15 #ifndef $1
16 char *(*pfn) = (char *(*)) $1
17 #endif
18       ],
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
23     AC_MSG_RESULT(yes)
24     ifelse([$3], , :, [$3])
25   else
26     AC_MSG_RESULT(no)
27     ifelse([$4], , , [$4
28 ])dnl
29   fi
30 ])dnl
32 dnl jm_CHECK_DECLARATIONS(INCLUDES, FUNCTION... [, ACTION-IF-DECLARED
33 dnl                       [, ACTION-IF-NOT-DECLARED]])
34 AC_DEFUN(jm_CHECK_DECLARATIONS,
36   for jm_func in $2
37   do
38     jm_CHECK_DECLARATION($jm_func, $1,
39     [
40       jm_tr_func=HAVE_DECL_`echo $jm_func | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`
41       AC_DEFINE_UNQUOTED($jm_tr_func) $3], $4)dnl
42   done