xref: /minix3/crypto/external/bsd/heimdal/dist/cf/need-proto.m4 (revision ebfedea0ce5bbe81e252ddf32d732e40fb633fae)
1*ebfedea0SLionel Sambucdnl Id
2*ebfedea0SLionel Sambucdnl
3*ebfedea0SLionel Sambucdnl
4*ebfedea0SLionel Sambucdnl Check if we need the prototype for a function
5*ebfedea0SLionel Sambucdnl
6*ebfedea0SLionel Sambuc
7*ebfedea0SLionel Sambucdnl AC_NEED_PROTO(includes, function)
8*ebfedea0SLionel Sambuc
9*ebfedea0SLionel SambucAC_DEFUN([AC_NEED_PROTO], [
10*ebfedea0SLionel Sambucif test "$ac_cv_func_$2+set" != set -o "$ac_cv_func_$2" = yes; then
11*ebfedea0SLionel SambucAC_CACHE_CHECK([if $2 needs a prototype], ac_cv_func_$2_noproto,
12*ebfedea0SLionel SambucAC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$1
13*ebfedea0SLionel Sambucstruct foo { int foo; } xx;
14*ebfedea0SLionel Sambucextern int $2 (struct foo*);]],[[$2(&xx)]])],
15*ebfedea0SLionel Sambuc[eval "ac_cv_func_$2_noproto=yes"],
16*ebfedea0SLionel Sambuc[eval "ac_cv_func_$2_noproto=no"]))
17*ebfedea0SLionel Sambucif test "$ac_cv_func_$2_noproto" = yes; then
18*ebfedea0SLionel Sambuc	AC_DEFINE(AS_TR_CPP(NEED_[]$2[]_PROTO), 1,
19*ebfedea0SLionel Sambuc		[define if the system is missing a prototype for $2()])
20*ebfedea0SLionel Sambucfi
21*ebfedea0SLionel Sambucfi
22*ebfedea0SLionel Sambuc])
23