define([AC_ARG_WITH_RESOLV],
[AC_ARG_WITH([resolv],
[ --with-resolv Use -lresolv for host name lookups.
--without-resolv Do not use -lresolv for host name lookups.],
[sed_downcase='y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'
val=`echo "$withval" | sed -e "$sed_downcase"`
case "$val" in
"" ) ac_use_resolv=yes ;;
yes | no | maybe ) ac_use_resolv=$val ;;
* ) AC_MSG_ERROR([$withval: invalid argument to --with-resolv]) ;;
esac
],[ ac_use_resolv=no
])])
define([AC_USE_RESOLV],[
ac_resolv_support=no
if test $ac_use_resolv != no ; then
AC_CHECK_LIB(resolv, gethostbyname)
if eval test '$'ac_cv_lib_resolv_gethostbyname = yes; then
ac_resolv_support=yes
elif test $ac_use_resolv = yes; then
AC_MSG_ERROR([Cannot link with -lresolv. Is it missing?])
fi
fi])
define([AC_ARG_ENABLE_XAUTH],
[AC_ARG_ENABLE([xauth],
[ --enable-xauth Support XAUTH authentication support.
--disable-xauth Do not support XAUTH authentication support.],
[sed_downcase='y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'
val=`echo "$enableval" | sed -e "$sed_downcase"`
case "$val" in
yes | no | try ) require_xauth=$val ;;
* ) AC_MSG_ERROR([$enableval: invalid argument to --enable-xauth]) ;;
esac],[require_xauth=try])])
define([AC_HAVE_XAUTH],
[AC_PATH_X
AC_SUBST(LIBXAUTH)
if test "$require_xauth" != "no" ; then
if test "$have_x" = yes; then
o_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -I$x_includes -L$x_libraries"
fi
AC_CHECK_HEADER(X11/Xauth.h,[use_xauth=yes],[use_xauth=no])
AC_CHECK_LIB(Xau, XauGetAuthByAddr, [use_xauth=yes], [use_xauth=no])
if test "$have_x" = yes ; then
CPPFLAGS="$o_CPPFLAGS"
fi
if test "$use_xauth" = "yes" ; then
AC_DEFINE(HAVE_XAUTH)
LIBXAUTH="-lXau"
if test "$have_x" = yes ; then
LIBXAUTH="-L$x_libraries $LIBXAUTH"
CPPFLAGS="$CPPFLAGS -I$x_includes"
fi
elif test "$require_xauth" = "yes" ; then
AC_MSG_ERROR([Cannot find headers or libraries for XAUTH support.])
fi
fi])