Sync usage with man page.
[netbsd-mini2440.git] / crypto / dist / heimdal / cf / check-xau.m4
blob1b865c2fcbde029517435ec0cbf34dedc1c4206b
1 dnl $Heimdal: check-xau.m4 15454 2005-06-16 21:02:16Z lha $
2 dnl $NetBSD$
3 dnl
4 dnl check for Xau{Read,Write}Auth and XauFileName
5 dnl
6 AC_DEFUN([AC_CHECK_XAU],[
7 save_CFLAGS="$CFLAGS"
8 CFLAGS="$X_CFLAGS $CFLAGS"
9 save_LIBS="$LIBS"
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
18 ## breaks in IRIX 6.5
20 AC_FIND_FUNC_NO_LIBS(XauWriteAuth, X11 Xau,[#include <X11/Xauth.h>],[0,0])
21 ac_xxx="$LIBS"
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>])
26 LIBS="$ac_xxx"
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
31 yes)    ;;
32 no)     ;;
33 *)      if test "$ac_cv_funclib_XauReadAuth" = yes; then
34                 if test "$ac_cv_funclib_XauFileName" = yes; then
35                         LIB_XauReadAuth="$LIB_XauWriteAuth"
36                 else
37                         LIB_XauReadAuth="$LIB_XauWriteAuth $LIB_XauFileName"
38                 fi
39         else
40                 if test "$ac_cv_funclib_XauFileName" = yes; then
41                         LIB_XauReadAuth="$LIB_XauReadAuth $LIB_XauWriteAuth"
42                 else
43                         LIB_XauReadAuth="$LIB_XauReadAuth $LIB_XauWriteAuth $LIB_XauFileName"
44                 fi
45         fi
46         ;;
47 esac
49 if test "$AUTOMAKE" != ""; then
50         AM_CONDITIONAL(NEED_WRITEAUTH, test "$ac_cv_func_XauWriteAuth" != "yes")
51 else
52         AC_SUBST(NEED_WRITEAUTH_TRUE)
53         AC_SUBST(NEED_WRITEAUTH_FALSE)
54         if test "$ac_cv_func_XauWriteAuth" != "yes"; then
55                 NEED_WRITEAUTH_TRUE=
56                 NEED_WRITEAUTH_FALSE='#'
57         else
58                 NEED_WRITEAUTH_TRUE='#'
59                 NEED_WRITEAUTH_FALSE=
60         fi
62 CFLAGS=$save_CFLAGS
63 LIBS=$save_LIBS
64 LDFLAGS=$save_LDFLAGS