source: heimdal/trunk/cf/have-struct-field.m4

Last change on this file was 1, checked in by Paul Smedley, 10 years ago

Initial commit of Heimdal 1.5.3

File size: 547 bytes
Line 
1dnl $Id$
2dnl
3dnl check for fields in a structure
4dnl
5dnl AC_HAVE_STRUCT_FIELD(struct, field, headers)
6
7AC_DEFUN([AC_HAVE_STRUCT_FIELD], [
8define(cache_val, translit(ac_cv_type_$1_$2, [A-Z ], [a-z_]))
9AC_CACHE_CHECK([for $2 in $1], cache_val,[
10AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$3]],
11 [[$1 x; memset(&x, 0, sizeof(x)); x.$2]])],
12 [cache_val=yes],
13 [cache_val=no])
14])
15if test "$cache_val" = yes; then
16 define(foo, translit(HAVE_$1_$2, [a-z ], [A-Z_]))
17 AC_DEFINE(foo, 1, [Define if $1 has field $2.])
18 undefine([foo])
19fi
20undefine([cache_val])
21])
Note: See TracBrowser for help on using the repository browser.