xref: /freebsd-src/contrib/libevent/m4/ax_check_funcs_ex.m4 (revision b50261e21f39a6c7249a49e7b60aa878c98512a8)
1*b50261e2SCy Schubert# Check if the function is available.
2*b50261e2SCy Schubert# HAVE_XXX will be defined if yes.
3*b50261e2SCy Schubert
4*b50261e2SCy Schubert# $1: the name of function
5*b50261e2SCy Schubert# $2: the headers in where the function declared
6*b50261e2SCy SchubertAC_DEFUN([AX_CHECK_DECL_EX], [dnl
7*b50261e2SCy Schubert	AS_IF([test "x$2" = "x"], [AC_MSG_ERROR([header not privided])])
8*b50261e2SCy Schubert	AS_VAR_PUSHDEF([have_func_var], [HAVE_[]m4_toupper($1)])
9*b50261e2SCy Schubert	AC_CHECK_DECL([$1],dnl
10*b50261e2SCy Schubert		[AC_DEFINE([have_func_var], [1], [Define to 1 if you have the `$1' function.])],,dnl
11*b50261e2SCy Schubert		[$2]dnl
12*b50261e2SCy Schubert	)
13*b50261e2SCy Schubert	AS_VAR_POPDEF([have_func_var])dnl
14*b50261e2SCy Schubert])
15*b50261e2SCy Schubert
16*b50261e2SCy SchubertAC_DEFUN([AX_CHECK_DECLS_EX], [dnl
17*b50261e2SCy Schubert	AS_IF([test "x$2" = "x"], [AC_MSG_ERROR([header not privided])])
18*b50261e2SCy Schubert	m4_foreach([decl],dnl
19*b50261e2SCy Schubert		m4_split(m4_normalize($1)),dnl
20*b50261e2SCy Schubert		[AX_CHECK_DECL_EX([decl], [$2])]dnl
21*b50261e2SCy Schubert	)
22*b50261e2SCy Schubert])
23