Add additional functionality to the upcall support to allow us to wait for
[dragonfly.git] / crypto / heimdal / cf / have-struct-field.m4
1 dnl $Id: have-struct-field.m4,v 1.6 1999/07/29 01:44:32 assar Exp $
2 dnl
3 dnl check for fields in a structure
4 dnl
5 dnl AC_HAVE_STRUCT_FIELD(struct, field, headers)
6
7 AC_DEFUN(AC_HAVE_STRUCT_FIELD, [
8 define(cache_val, translit(ac_cv_type_$1_$2, [A-Z ], [a-z_]))
9 AC_CACHE_CHECK([for $2 in $1], cache_val,[
10 AC_TRY_COMPILE([$3],[$1 x; x.$2;],
11 cache_val=yes,
12 cache_val=no)])
13 if test "$cache_val" = yes; then
14         define(foo, translit(HAVE_$1_$2, [a-z ], [A-Z_]))
15         AC_DEFINE(foo, 1, [Define if $1 has field $2.])
16         undefine([foo])
17 fi
18 undefine([cache_val])
19 ])