1*ebfedea0SLionel Sambucdnl Id 2*ebfedea0SLionel Sambucdnl 3*ebfedea0SLionel Sambucdnl rk_CHECK_VAR(variable, includes) 4*ebfedea0SLionel SambucAC_DEFUN([rk_CHECK_VAR], [ 5*ebfedea0SLionel SambucAC_MSG_CHECKING(for $1) 6*ebfedea0SLionel SambucAC_CACHE_VAL(ac_cv_var_$1, [ 7*ebfedea0SLionel Sambucm4_ifval([$2],[ 8*ebfedea0SLionel Sambuc AC_LINK_IFELSE([AC_LANG_PROGRAM([[$2 9*ebfedea0SLionel Sambuc void * foo(void) { return &$1; }]],[[foo()]])], 10*ebfedea0SLionel Sambuc [ac_cv_var_$1=yes],[ac_cv_var_$1=no])]) 11*ebfedea0SLionel Sambucif test "$ac_cv_var_$1" != yes ; then 12*ebfedea0SLionel SambucAC_LINK_IFELSE([AC_LANG_PROGRAM([[$2 13*ebfedea0SLionel Sambucextern int $1; 14*ebfedea0SLionel Sambucint foo(void) { return $1; }]],[[foo()]])], 15*ebfedea0SLionel Sambuc [ac_cv_var_$1=yes],[ac_cv_var_$1=no]) 16*ebfedea0SLionel Sambucfi 17*ebfedea0SLionel Sambuc]) 18*ebfedea0SLionel Sambucac_foo=`eval echo \\$ac_cv_var_$1` 19*ebfedea0SLionel SambucAC_MSG_RESULT($ac_foo) 20*ebfedea0SLionel Sambucif test "$ac_foo" = yes; then 21*ebfedea0SLionel Sambuc AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_[]$1), 1, 22*ebfedea0SLionel Sambuc [Define if you have the `]$1[' variable.]) 23*ebfedea0SLionel Sambuc m4_ifval([$2], AC_CHECK_DECLS([$1],[],[],[$2])) 24*ebfedea0SLionel Sambucfi 25*ebfedea0SLionel Sambuc]) 26*ebfedea0SLionel Sambuc 27*ebfedea0SLionel SambucAC_WARNING_ENABLE([obsolete]) 28*ebfedea0SLionel SambucAU_DEFUN([AC_CHECK_VAR], [rk_CHECK_VAR([$2], [$1])], [foo]) 29