1 dnl ---------------------------------------------------------------------------
2 dnl Check if a function is declared by including a set of include files.
3 dnl Invoke the corresponding actions according to whether it is found or not.
5 dnl Gcc (unlike other compilers) will only warn about the miscast assignment
6 dnl in the first test, but most compilers will oblige with an error in the
9 dnl CF_CHECK_FUNCDECL(INCLUDES, FUNCTION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
10 AC_DEFUN([CF_CHECK_FUNCDECL],
12 AC_MSG_CHECKING([for $2 declaration])
13 AC_CACHE_VAL(ac_cv_func_decl_$2,
16 extern int ${ac_func}();
20 int (*p)() = ${ac_func};
22 eval "ac_cv_func_decl_$2=yes"],[
23 eval "ac_cv_func_decl_$2=no"])],[
24 eval "ac_cv_func_decl_$2=yes"])])
25 if eval "test \"`echo '$ac_cv_func_'decl_$2`\" = yes"; then
27 ifelse([$3], , :, [$3])
34 dnl ---------------------------------------------------------------------------
35 dnl Check if functions are declared by including a set of include files.
36 dnl and define DECL_XXX if not.
38 dnl CF_CHECK_FUNCDECLS(INCLUDES, FUNCTION... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
39 AC_DEFUN([CF_CHECK_FUNCDECLS],
42 CF_CHECK_FUNCDECL([$1], $ac_func,
44 CF_UPPER(ac_tr_func,HAVE_$ac_func)
45 AC_DEFINE_UNQUOTED($ac_tr_func) $3],
49 dnl CF_UPPER(ac_tr_func,DECL_$ac_func)
50 dnl AC_DEFINE_UNQUOTED($ac_tr_func) $4])dnl
53 dnl ---------------------------------------------------------------------------
54 dnl Make an uppercase version of a variable
59 $1=`echo $2 | tr '[a-z]' '[A-Z]'`
62 dnl ---------------------------------------------------------------------------