1 |
nmav |
1.1 |
AC_DEFUN([AC_CHECK_STRUCT_FOR],[ |
2 |
|
|
ac_safe_struct=`echo "$2" | sed 'y%./+-%__p_%'` |
3 |
|
|
ac_safe_member=`echo "$3" | sed 'y%./+-%__p_%'` |
4 |
|
|
ac_safe_all="ac_cv_struct_${ac_safe_struct}_has_${ac_safe_member}" |
5 |
|
|
changequote(, )dnl |
6 |
|
|
ac_uc_define=STRUCT_`echo "${ac_safe_struct}_HAS_${ac_safe_member}" | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` |
7 |
|
|
changequote([, ])dnl |
8 |
|
|
|
9 |
|
|
AC_MSG_CHECKING([for $2.$3]) |
10 |
|
|
AC_CACHE_VAL($ac_safe_all, |
11 |
|
|
[ |
12 |
|
|
if test "x$4" = "x"; then |
13 |
|
|
defineit="= 0" |
14 |
|
|
elif test "x$4" = "xno"; then |
15 |
|
|
defineit="" |
16 |
|
|
else |
17 |
|
|
defineit="$4" |
18 |
|
|
fi |
19 |
|
|
AC_TRY_COMPILE([ |
20 |
|
|
$1 |
21 |
|
|
],[ |
22 |
|
|
struct $2 testit; |
23 |
|
|
testit.$3 $defineit; |
24 |
|
|
], eval "${ac_safe_all}=yes", eval "${ac_safe_all}=no" ) |
25 |
|
|
]) |
26 |
|
|
|
27 |
|
|
if eval "test \"x$`echo ${ac_safe_all}`\" = \"xyes\""; then |
28 |
|
|
AC_MSG_RESULT(yes) |
29 |
|
|
AC_DEFINE_UNQUOTED($ac_uc_define) |
30 |
|
|
else |
31 |
|
|
AC_MSG_RESULT(no) |
32 |
|
|
fi |
33 |
|
|
]) |
34 |
|
|
|
35 |
|
|
dnl AC_CHECK_STRUCT_FOR(INCLUDES,STRUCT,MEMBER,DEFINE,[no]) |
36 |
|
|
dnl 1.1 (2000/09/19) |
37 |
|
|
dnl Wes Hardaker <wjhardaker@ucdavis.edu> |
38 |
|
|
|
39 |
|
|
dnl ---------------------------------------------------------- |
40 |
|
|
|