check-var.m4 revision 1.1.1.2 1 1.1.1.2 elric dnl Id
2 1.1 elric dnl
3 1.1 elric dnl rk_CHECK_VAR(variable, includes)
4 1.1 elric AC_DEFUN([rk_CHECK_VAR], [
5 1.1 elric AC_MSG_CHECKING(for $1)
6 1.1 elric AC_CACHE_VAL(ac_cv_var_$1, [
7 1.1 elric m4_ifval([$2],[
8 1.1 elric AC_LINK_IFELSE([AC_LANG_PROGRAM([[$2
9 1.1 elric void * foo(void) { return &$1; }]],[[foo()]])],
10 1.1 elric [ac_cv_var_$1=yes],[ac_cv_var_$1=no])])
11 1.1 elric if test "$ac_cv_var_$1" != yes ; then
12 1.1 elric AC_LINK_IFELSE([AC_LANG_PROGRAM([[$2
13 1.1 elric extern int $1;
14 1.1 elric int foo(void) { return $1; }]],[[foo()]])],
15 1.1 elric [ac_cv_var_$1=yes],[ac_cv_var_$1=no])
16 1.1 elric fi
17 1.1 elric ])
18 1.1 elric ac_foo=`eval echo \\$ac_cv_var_$1`
19 1.1 elric AC_MSG_RESULT($ac_foo)
20 1.1 elric if test "$ac_foo" = yes; then
21 1.1 elric AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_[]$1), 1,
22 1.1 elric [Define if you have the `]$1[' variable.])
23 1.1 elric m4_ifval([$2], AC_CHECK_DECLS([$1],[],[],[$2]))
24 1.1 elric fi
25 1.1 elric ])
26 1.1 elric
27 1.1 elric AC_WARNING_ENABLE([obsolete])
28 1.1 elric AU_DEFUN([AC_CHECK_VAR], [rk_CHECK_VAR([$2], [$1])], [foo])
29