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