File: aclocal.m4

package info (click to toggle)
gnuserv 3.12.8-12
  • links: PTS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 832 kB
  • sloc: ansic: 5,138; lisp: 1,572; makefile: 419; sh: 268
file content (114 lines) | stat: -rw-r--r-- 4,028 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
dnl Copyright (C) 1996 Noah S. Friedman <friedman@prep.ai.mit.edu>

dnl $Id: aclocal.m4,v 1.3 2007/10/22 01:26:48 martins Exp $

dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2, or (at your option)
dnl any later version.
dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, you can either send email to this
dnl program's maintainer or write to: The Free Software Foundation,
dnl Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA.

dnl ############################################################

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
   ],[# Default is not to link with resolv.
      ac_use_resolv=no
   ])dnl
])

dnl ############################################################

define([AC_USE_RESOLV],[
# Check whether resolv support is desired.
# If --with-resolv is specified to configure, support for resolv must
#   be available or configure will exit with an error.
# If --without-resolv is specified, no attempt is made to look for
#   resolv headers or libraries.
# By default, configure will use resolv if all the necessary support is
#   available, otherwise it won't.  No fatal errors should occur in either
#   circumstance.

# Default if not otherwise found
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])

dnl ############################################################

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])])

dnl ############################################################

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"
    if test -n "$x_includes" ; then
      CPPFLAGS="$CPPFLAGS -I$x_includes"
    fi
    if test -n "$x_libraries" ; then
      CPPFLAGS="$CPPFLAGS -L$x_libraries"
    fi
  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
      if test -n "$x_libraries" ; then
        LIBXAUTH="-L$x_libraries $LIBXAUTH"
      fi
      if test -n "$x_includes" ; then
        CPPFLAGS="$CPPFLAGS -I$x_includes"
      fi
    fi
  elif test "$require_xauth" = "yes" ; then
    AC_MSG_ERROR([Cannot find headers or libraries for XAUTH support.])
  fi
fi])

dnl aclocal.m4 ends here