No empty .Rs/.Re
[netbsd-mini2440.git] / crypto / dist / heimdal / cf / check-var.m4
blobc0e0babfc1b26ab58deeec3921a884538f1c51e4
1 dnl $Heimdal: check-var.m4 15422 2005-06-16 18:59:29Z lha $
2 dnl $NetBSD$
3 dnl
4 dnl rk_CHECK_VAR(variable, includes)
5 AC_DEFUN([rk_CHECK_VAR], [
6 AC_MSG_CHECKING(for $1)
7 AC_CACHE_VAL(ac_cv_var_$1, [
8 m4_ifval([$2],[
9         AC_LINK_IFELSE([AC_LANG_PROGRAM([[$2
10         void * foo(void) { return &$1; }]],[[foo()]])],
11             [ac_cv_var_$1=yes],[ac_cv_var_$1=no])])
12 if test "$ac_cv_var_$1" != yes ; then
13 AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern int $1;
14 int foo(void) { return $1; }]],[[foo()]])],
15             [ac_cv_var_$1=yes],[ac_cv_var_$1=no])
18 ac_foo=`eval echo \\$ac_cv_var_$1`
19 AC_MSG_RESULT($ac_foo)
20 if test "$ac_foo" = yes; then
21         AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_[]$1), 1, 
22                 [Define if you have the `]$1[' variable.])
23         m4_ifval([$2], AC_CHECK_DECLS([$1],[],[],[$2]))
27 AC_WARNING_ENABLE([obsolete])
28 AU_DEFUN([AC_CHECK_VAR], [rk_CHECK_VAR([$2], [$1])], [foo])