3 dnl check for Xau{Read,Write}Auth and XauFileName
5 AC_DEFUN([AC_CHECK_XAU],[
7 CFLAGS="$X_CFLAGS $CFLAGS"
9 dnl LIBS="$X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS $LIBS"
10 LIBS="$X_PRE_LIBS $X_EXTRA_LIBS $LIBS"
11 save_LDFLAGS="$LDFLAGS"
12 LDFLAGS="$LDFLAGS $X_LIBS"
14 ## check for XauWriteAuth first, so we detect the case where
15 ## XauReadAuth is in -lX11, but XauWriteAuth is only in -lXau this
16 ## could be done by checking for XauReadAuth in -lXau first, but this
19 AC_FIND_FUNC_NO_LIBS(XauWriteAuth, X11 Xau,[#include <X11/Xauth.h>],[0,0])
21 LIBS="$LIB_XauWriteAuth $LIBS"
22 AC_FIND_FUNC_NO_LIBS(XauReadAuth, X11 Xau,[#include <X11/Xauth.h>],[0])
23 LIBS="$LIB_XauReadAauth $LIBS"
24 AC_FIND_FUNC_NO_LIBS(XauFileName, X11 Xau,[#include <X11/Xauth.h>])
27 ## set LIB_XauReadAuth to union of these tests, since this is what the
28 ## Makefiles are using
29 case "$ac_cv_funclib_XauWriteAuth" in
32 *) if test "$ac_cv_funclib_XauReadAuth" = yes; then
33 if test "$ac_cv_funclib_XauFileName" = yes; then
34 LIB_XauReadAuth="$LIB_XauWriteAuth"
36 LIB_XauReadAuth="$LIB_XauWriteAuth $LIB_XauFileName"
39 if test "$ac_cv_funclib_XauFileName" = yes; then
40 LIB_XauReadAuth="$LIB_XauReadAuth $LIB_XauWriteAuth"
42 LIB_XauReadAuth="$LIB_XauReadAuth $LIB_XauWriteAuth $LIB_XauFileName"
48 if test "$AUTOMAKE" != ""; then
49 AM_CONDITIONAL(NEED_WRITEAUTH, test "$ac_cv_func_XauWriteAuth" != "yes")
51 AC_SUBST(NEED_WRITEAUTH_TRUE)
52 AC_SUBST(NEED_WRITEAUTH_FALSE)
53 if test "$ac_cv_func_XauWriteAuth" != "yes"; then
55 NEED_WRITEAUTH_FALSE='#'
57 NEED_WRITEAUTH_TRUE='#'