1 dnl $Heimdal: check-xau.m4 15454 2005-06-16 21:02:16Z lha $
4 dnl check for Xau{Read,Write}Auth and XauFileName
6 AC_DEFUN([AC_CHECK_XAU],[
8 CFLAGS="$X_CFLAGS $CFLAGS"
10 dnl LIBS="$X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS $LIBS"
11 LIBS="$X_PRE_LIBS $X_EXTRA_LIBS $LIBS"
12 save_LDFLAGS="$LDFLAGS"
13 LDFLAGS="$LDFLAGS $X_LIBS"
15 ## check for XauWriteAuth first, so we detect the case where
16 ## XauReadAuth is in -lX11, but XauWriteAuth is only in -lXau this
17 ## could be done by checking for XauReadAuth in -lXau first, but this
20 AC_FIND_FUNC_NO_LIBS(XauWriteAuth, X11 Xau,[#include <X11/Xauth.h>],[0,0])
22 LIBS="$LIB_XauWriteAuth $LIBS"
23 AC_FIND_FUNC_NO_LIBS(XauReadAuth, X11 Xau,[#include <X11/Xauth.h>],[0])
24 LIBS="$LIB_XauReadAauth $LIBS"
25 AC_FIND_FUNC_NO_LIBS(XauFileName, X11 Xau,[#include <X11/Xauth.h>])
28 ## set LIB_XauReadAuth to union of these tests, since this is what the
29 ## Makefiles are using
30 case "$ac_cv_funclib_XauWriteAuth" in
33 *) if test "$ac_cv_funclib_XauReadAuth" = yes; then
34 if test "$ac_cv_funclib_XauFileName" = yes; then
35 LIB_XauReadAuth="$LIB_XauWriteAuth"
37 LIB_XauReadAuth="$LIB_XauWriteAuth $LIB_XauFileName"
40 if test "$ac_cv_funclib_XauFileName" = yes; then
41 LIB_XauReadAuth="$LIB_XauReadAuth $LIB_XauWriteAuth"
43 LIB_XauReadAuth="$LIB_XauReadAuth $LIB_XauWriteAuth $LIB_XauFileName"
49 if test "$AUTOMAKE" != ""; then
50 AM_CONDITIONAL(NEED_WRITEAUTH, test "$ac_cv_func_XauWriteAuth" != "yes")
52 AC_SUBST(NEED_WRITEAUTH_TRUE)
53 AC_SUBST(NEED_WRITEAUTH_FALSE)
54 if test "$ac_cv_func_XauWriteAuth" != "yes"; then
56 NEED_WRITEAUTH_FALSE='#'
58 NEED_WRITEAUTH_TRUE='#'