conserver/configure.in

569 lines
17 KiB
Plaintext
Raw Normal View History

2002-10-14 21:03:35 +00:00
dnl ### autoheader templates ########################################
2002-09-23 21:31:15 +00:00
AH_TEMPLATE([CONFIGINVOCATION], [./configure invocation])
AH_TEMPLATE([DEFPORT], [Socket used to communicate])
AH_TEMPLATE([DEFBASEPORT], [Base socket used for secondary channel])
AH_TEMPLATE([MASTERHOST], [Hostname of console server])
AH_TEMPLATE([CONFIGFILE], [Config file path])
AH_TEMPLATE([PASSWDFILE], [Password file path])
AH_TEMPLATE([LOGFILEPATH], [Logfile path])
AH_TEMPLATE([MAXMEMB], [Number of consoles per child process])
AH_TEMPLATE([CONNECTTIMEOUT], [TCP connection timeout])
AH_TEMPLATE([PIDFILE], [pidfile to write to])
AH_TEMPLATE([USE_LIBWRAP], [use tcp_wrappers libwrap])
2003-09-22 20:49:53 +00:00
dnl AH_TEMPLATE([HAVE_POSIX_REGCOMP], [have POSIX regcomp])
2002-10-14 21:03:35 +00:00
AH_TEMPLATE([HAVE_PAM], [have PAM support])
AH_TEMPLATE([HAVE_OPENSSL], [have openssl support])
2003-03-11 02:08:07 +00:00
AH_TEMPLATE([HAVE_DMALLOC], [have dmalloc support])
2003-09-22 20:49:53 +00:00
AH_TEMPLATE([HAVE_SA_LEN],[Defined if sa_len member exists in struct sockaddr])
AH_TEMPLATE([TRUST_REVERSE_DNS],[Defined if we trust reverse DNS])
2004-03-11 17:54:13 +00:00
AH_TEMPLATE([USE_EXTENDED_MESSAGES],[Defined if we produce extended messages])
2004-04-13 20:30:28 +00:00
AH_TEMPLATE([USE_UNIX_DOMAIN_SOCKETS],[Defined if we use Unix domain sockets])
AH_TEMPLATE([UDSDIR], [Directory for Unix domain sockets])
2002-09-23 21:31:15 +00:00
2001-02-19 06:50:29 +00:00
dnl ### Normal initialization. ######################################
2002-03-12 09:12:20 +00:00
AC_INIT
2004-04-13 20:30:28 +00:00
AC_PREREQ(2.59)
2002-03-12 09:12:20 +00:00
AC_CONFIG_SRCDIR([conserver/main.c])
2001-02-19 06:50:29 +00:00
AC_CONFIG_HEADER(config.h)
2002-03-12 09:12:20 +00:00
AC_DEFINE_UNQUOTED(CONFIGINVOCATION, "$0 $@")
2001-02-19 06:50:29 +00:00
dnl ### Set some option defaults. ###################################
if test -z "$CFLAGS"; then
CFLAGS="-O"
fi
MKDIR="mkdir -p -m 755"
AC_SUBST(MKDIR)
dnl ### Custom settings. ############################################
2003-09-22 20:49:53 +00:00
dnl AC_MSG_CHECKING(whether to allow 64bit compilation)
dnl AC_ARG_WITH(64bit,
dnl AC_HELP_STRING([--with-64bit],[Allow 64bit compilation]),
dnl [case "$withval" in
dnl yes)
dnl with_64bit=yes
dnl ;;
dnl *)
dnl with_64bit=no
dnl ;;
dnl esac], [with_64bit=no])
dnl AC_MSG_RESULT($with_64bit)
2002-03-12 09:12:20 +00:00
2001-02-19 06:50:29 +00:00
AC_MSG_CHECKING(for port number specification)
AC_ARG_WITH(port,
2004-04-13 20:30:28 +00:00
AS_HELP_STRING([--with-port=PORT],[Specify port number @<:@conserver@:>@]),
2003-04-09 15:30:48 +00:00
[case "$withval" in
yes|no)
2001-07-05 16:18:19 +00:00
AC_DEFINE_UNQUOTED(DEFPORT, "conserver")
AC_MSG_RESULT(port 'conserver')
2003-04-09 15:30:48 +00:00
;;
*)
AC_DEFINE_UNQUOTED(DEFPORT, "$withval")
AC_MSG_RESULT(port '$withval')
;;
esac],
2001-07-05 16:18:19 +00:00
[AC_DEFINE_UNQUOTED(DEFPORT, "conserver")
AC_MSG_RESULT(port 'conserver')])
2001-02-19 06:50:29 +00:00
2001-07-27 00:05:04 +00:00
AC_MSG_CHECKING(for secondary channel base port)
AC_ARG_WITH(base,
2004-04-13 20:30:28 +00:00
AS_HELP_STRING([--with-base=PORT], [Base port for secondary channel @<:@0@:>@]),
2003-04-09 15:30:48 +00:00
[case "$withval" in
yes|no)
2001-07-27 00:05:04 +00:00
AC_DEFINE_UNQUOTED(DEFBASEPORT, "0")
AC_MSG_RESULT(port '0')
2003-04-09 15:30:48 +00:00
;;
*)
AC_DEFINE_UNQUOTED(DEFBASEPORT, "$withval")
AC_MSG_RESULT(port '$withval')
;;
esac],
2001-07-27 00:05:04 +00:00
[AC_DEFINE_UNQUOTED(DEFBASEPORT, "0")
AC_MSG_RESULT(port '0')])
2001-02-19 06:50:29 +00:00
AC_MSG_CHECKING(for master conserver hostname)
AC_ARG_WITH(master,
2004-04-13 20:30:28 +00:00
AS_HELP_STRING([--with-master=MASTER],[Specify master server hostname @<:@console@:>@]),
2003-04-09 15:30:48 +00:00
[case "$withval" in
yes|no)
2001-02-19 06:50:29 +00:00
AC_DEFINE_UNQUOTED(MASTERHOST, "console")
AC_MSG_RESULT('console')
2003-04-09 15:30:48 +00:00
;;
*)
AC_DEFINE_UNQUOTED(MASTERHOST, "$withval")
AC_MSG_RESULT('$withval')
;;
esac],
2001-02-19 06:50:29 +00:00
[AC_DEFINE_UNQUOTED(MASTERHOST, "console")
AC_MSG_RESULT('console')])
AC_MSG_CHECKING(for configuration filename)
AC_ARG_WITH(cffile,
2004-04-13 20:30:28 +00:00
AS_HELP_STRING([--with-cffile=CFFILE],[Specify config filename @<:@SYSCONFDIR/conserver.cf@:>@]),
2003-04-09 15:30:48 +00:00
[case "$withval" in
yes|no)
2002-10-14 21:03:35 +00:00
AC_DEFINE_UNQUOTED(CONFIGFILE, [SYSCONFDIR "/conserver.cf"])
2002-03-12 09:12:20 +00:00
AC_MSG_RESULT('$sysconfdir/conserver.cf')
2003-04-09 15:30:48 +00:00
;;
[[\\/]]* | ?:[[\\/]]* )
AC_DEFINE_UNQUOTED(CONFIGFILE, ["$withval"])
AC_MSG_RESULT('$withval')
;;
*)
AC_DEFINE_UNQUOTED(CONFIGFILE, [SYSCONFDIR "/$withval"])
AC_MSG_RESULT('$sysconfdir/$withval')
;;
esac],
2002-10-14 21:03:35 +00:00
[AC_DEFINE_UNQUOTED(CONFIGFILE, [SYSCONFDIR "/conserver.cf"])
2002-03-12 09:12:20 +00:00
AC_MSG_RESULT('$sysconfdir/conserver.cf')])
2001-02-19 06:50:29 +00:00
AC_MSG_CHECKING(for password filename)
AC_ARG_WITH(pwdfile,
2004-04-13 20:30:28 +00:00
AS_HELP_STRING([--with-pwdfile=PWDFILE],[Specify password filename @<:@SYSCONFDIR/conserver.passwd@:>@]),
2003-04-09 15:30:48 +00:00
[case "$withval" in
yes|no)
2002-10-14 21:03:35 +00:00
AC_DEFINE_UNQUOTED(PASSWDFILE, [SYSCONFDIR "/conserver.passwd"])
2002-03-12 09:12:20 +00:00
AC_MSG_RESULT('$sysconfdir/conserver.passwd')
2003-04-09 15:30:48 +00:00
;;
[[\\/]]* | ?:[[\\/]]* )
AC_DEFINE_UNQUOTED(PASSWDFILE, ["$withval"])
AC_MSG_RESULT('$withval')
;;
*)
AC_DEFINE_UNQUOTED(PASSWDFILE, [SYSCONFDIR "/$withval"])
AC_MSG_RESULT('$sysconfdir/$withval')
;;
esac],
2002-10-14 21:03:35 +00:00
[AC_DEFINE_UNQUOTED(PASSWDFILE, [SYSCONFDIR "/conserver.passwd"])
2002-03-12 09:12:20 +00:00
AC_MSG_RESULT('$sysconfdir/conserver.passwd')])
2001-02-19 06:50:29 +00:00
2001-07-05 16:18:19 +00:00
AC_MSG_CHECKING(for log filename)
AC_ARG_WITH(logfile,
2004-04-13 20:30:28 +00:00
AS_HELP_STRING([--with-logfile=LOGFILE],[Specify log filename @<:@/var/log/conserver@:>@]),
2003-04-09 15:30:48 +00:00
[case "$withval" in
yes|no)
2001-07-05 16:18:19 +00:00
AC_DEFINE_UNQUOTED(LOGFILEPATH, "/var/log/conserver")
AC_MSG_RESULT('/var/log/conserver')
2003-04-09 15:30:48 +00:00
;;
*)
AC_DEFINE_UNQUOTED(LOGFILEPATH, "$withval")
AC_MSG_RESULT('$withval')
;;
esac],
2001-07-05 16:18:19 +00:00
[AC_DEFINE_UNQUOTED(LOGFILEPATH, "/var/log/conserver")
AC_MSG_RESULT('/var/log/conserver')])
2003-04-09 15:30:48 +00:00
AC_SUBST(PIDFILE)
2001-05-03 13:44:08 +00:00
AC_MSG_CHECKING(for PID filename)
AC_ARG_WITH(pidfile,
2004-04-13 20:30:28 +00:00
AS_HELP_STRING([--with-pidfile=PIDFILE],[Specify PID filepath @<:@/var/run/conserver.pid@:>@]),
2003-04-09 15:30:48 +00:00
[case "$withval" in
yes|no)
PIDFILE="/var/run/conserver.pid"
;;
*)
PIDFILE="$withval"
;;
esac],
[PIDFILE="/var/run/conserver.pid"])
AC_DEFINE_UNQUOTED(PIDFILE, "$PIDFILE")
AC_MSG_RESULT('$PIDFILE')
2001-05-03 13:44:08 +00:00
2001-02-19 06:50:29 +00:00
AC_MSG_CHECKING(for MAXMEMB setting)
AC_ARG_WITH(maxmemb,
2004-04-13 20:30:28 +00:00
AS_HELP_STRING([--with-maxmemb=MAXMEMB],[Specify maximum consoles per process @<:@16@:>@]),
2003-04-09 15:30:48 +00:00
[case "$withval" in
yes|no)
2001-02-19 06:50:29 +00:00
AC_DEFINE_UNQUOTED(MAXMEMB, 16)
AC_MSG_RESULT(16)
2003-04-09 15:30:48 +00:00
;;
*)
if expr "$withval" : '[[0-9]]*$' >/dev/null 2>&1 &&
test "$withval" -gt 0 -a "$withval" -lt 256; then
AC_DEFINE_UNQUOTED(MAXMEMB, $withval)
AC_MSG_RESULT($withval)
else
AC_DEFINE_UNQUOTED(MAXMEMB, 16)
AC_MSG_RESULT([value out of bounds (0<x<256) - setting to 16])
fi
;;
esac],
2001-02-19 06:50:29 +00:00
[AC_DEFINE_UNQUOTED(MAXMEMB, 16)
AC_MSG_RESULT(16)])
AC_MSG_CHECKING(for connect() timeout)
AC_ARG_WITH(timeout,
2004-04-13 20:30:28 +00:00
AS_HELP_STRING([--with-timeout=TIMEOUT],[Specify connect() timeout in seconds @<:@10@:>@]),
2003-04-09 15:30:48 +00:00
[if expr "$withval" : '[[0-9]]*$' >/dev/null 2>&1 &&
test "$withval" -gt 0 -a "$withval" -lt 300; then
2001-02-19 06:50:29 +00:00
AC_DEFINE_UNQUOTED(CONNECTTIMEOUT, $withval)
AC_MSG_RESULT($withval)
else
AC_DEFINE_UNQUOTED(CONNECTTIMEOUT, 10)
2003-04-09 15:30:48 +00:00
AC_MSG_RESULT([value out of bounds (0<x<300) - setting to 10])
2001-02-19 06:50:29 +00:00
fi],
[AC_DEFINE_UNQUOTED(CONNECTTIMEOUT, 10)
AC_MSG_RESULT(10)])
2003-09-22 20:49:53 +00:00
AC_MSG_CHECKING(whether to trust reverse DNS)
AC_ARG_WITH(trustrevdns,
2004-04-13 20:30:28 +00:00
AS_HELP_STRING([--with-trustrevdns],[Trust reverse DNS information]),
2003-09-22 20:49:53 +00:00
[case "$withval" in
yes)
AC_DEFINE(TRUST_REVERSE_DNS)
AC_MSG_RESULT(yes)
;;
*)
AC_MSG_RESULT(no)
;;
esac],[AC_MSG_RESULT(no)])
2004-03-11 17:54:13 +00:00
AC_MSG_CHECKING(whether to display extended messages)
AC_ARG_WITH(extmsgs,
2004-04-13 20:30:28 +00:00
AS_HELP_STRING([--with-extmsgs],[Produce extended messages]),
2004-03-11 17:54:13 +00:00
[case "$withval" in
yes)
AC_DEFINE(USE_EXTENDED_MESSAGES)
AC_MSG_RESULT(yes)
;;
*)
AC_MSG_RESULT(no)
;;
esac],[AC_MSG_RESULT(no)])
2003-09-22 20:49:53 +00:00
2004-04-13 20:30:28 +00:00
AC_MSG_CHECKING(whether to use Unix domain sockets)
AC_ARG_WITH(uds,
AS_HELP_STRING([--with-uds@<:@=DIR@:>@ ],
[Use Unix domain sockets for client/server communication @<:@/tmp/conserver@:>@]),
[case "$withval" in
yes)
AC_DEFINE_UNQUOTED(UDSDIR, "/tmp/conserver")
AC_DEFINE(USE_UNIX_DOMAIN_SOCKETS)
AC_MSG_RESULT([/tmp/conserver])
;;
no)
AC_MSG_RESULT(no)
;;
*)
AC_DEFINE_UNQUOTED(UDSDIR, "$withval")
AC_DEFINE(USE_UNIX_DOMAIN_SOCKETS)
AC_MSG_RESULT('$withval')
if expr "$withval" : '/' >/dev/null 2>&1; then
:
else
echo "*** WARNING *** you may have better success using a fully-qualified path"
echo "*** WARNING *** instead of '$withval'"
fi
;;
esac],[AC_MSG_RESULT(no)])
2001-02-19 06:50:29 +00:00
dnl ### Check for compiler et al. ###################################
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
2003-04-09 15:30:48 +00:00
2001-02-19 06:50:29 +00:00
dnl ### Compiler characteristics. ##################################
AC_AIX
AC_C_CONST
2003-03-11 02:08:07 +00:00
AC_C_PROTOTYPES
2001-02-19 06:50:29 +00:00
2003-09-22 20:49:53 +00:00
dnl AC_CHECK_SIZEOF(long)
dnl if test "$ac_cv_sizeof_long" -gt 4; then
dnl if test "$with_64bit" != "yes"; then
dnl AC_MSG_ERROR([cannot build on >32bit systems (to override use --with-64bit)])
dnl else
dnl AC_MSG_WARN([building a 64bit version of conserver - good luck!])
dnl fi
dnl fi
2002-03-12 09:12:20 +00:00
2001-02-19 06:50:29 +00:00
dnl ### Checks for header files. ###################################
AC_HEADER_STDC
AC_CHECK_HEADERS(sys/ioctl.h)
2003-09-22 20:49:53 +00:00
AC_SYS_POSIX_TERMIOS
if test "$ac_cv_sys_posix_termios" != "yes"; then
AC_MSG_ERROR([POSIX termios interface required])
2001-02-19 06:50:29 +00:00
fi
2003-11-20 14:49:09 +00:00
AC_CHECK_HEADERS(unistd.h getopt.h sys/vlimit.h sys/resource.h ttyent.h sys/ttold.h sys/uio.h sys/ioctl_compat.h usersec.h sys/select.h stropts.h sys/audit.h shadow.h sys/time.h crypt.h sysexits.h types.h sys/sockio.h sys/param.h)
dnl sys/proc.h needs sys/param.h on openbsd, apparently
AC_CHECK_HEADERS(sys/proc.h, [], [],
[#if HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
])
2001-02-19 06:50:29 +00:00
AC_HEADER_TIME
AC_HEADER_SYS_WAIT
AC_TYPE_MODE_T
AC_TYPE_SIGNAL
2003-03-11 02:08:07 +00:00
AC_TYPE_PID_T
2004-01-18 17:31:24 +00:00
AC_TYPE_SIZE_T
2001-02-19 06:50:29 +00:00
2002-09-23 21:31:15 +00:00
AC_CHECK_TYPE([sig_atomic_t],,
AC_DEFINE(sig_atomic_t, volatile int,
[Define if <signal.h> does not define sig_atomic_t]),
[#include <signal.h>])
2001-02-19 06:50:29 +00:00
2002-09-23 21:31:15 +00:00
AC_CHECK_TYPE([in_addr_t],[AC_DEFINE(HAVE_IN_ADDR_T,1,
[Defined if in_addr_t exists])],,[$ac_includes_default
2002-03-12 09:12:20 +00:00
#include <netinet/in.h>])
2002-09-23 21:31:15 +00:00
AC_CHECK_TYPE([socklen_t],[AC_DEFINE(HAVE_SOCKLEN_T,1,
[Defined if socklen_t exists])],,[$ac_includes_default
#include <sys/socket.h>])
2001-02-19 06:50:29 +00:00
2003-09-22 20:49:53 +00:00
AC_MSG_CHECKING(for sa_len in struct sockaddr)
AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/socket.h>],
[struct sockaddr s; s.sa_len=0;],
[AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_SA_LEN)],
[AC_MSG_RESULT(no)])
2002-10-14 21:03:35 +00:00
2003-04-09 15:30:48 +00:00
dnl ### Host specific checks. ######################################
AC_CANONICAL_HOST
case "$host" in
*-*-hpux*)
CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED=1"
AC_CHECK_LIB(xnet,t_error,,AC_MSG_ERROR([-lxnet needed on HP-UX]))
AC_CHECK_LIB(sec,getspnam)
AC_CHECK_HEADERS(hpsecurity.h prot.h)
AC_CHECK_FUNCS(bigcrypt iscomsec getprpwnam)
;;
esac
2001-02-19 06:50:29 +00:00
dnl ### Check for libraries. #######################################
2001-10-16 05:49:17 +00:00
AC_SEARCH_LIBS(socket,socket)
AC_SEARCH_LIBS(gethostbyname,nsl)
AC_SEARCH_LIBS(crypt,crypt)
2002-09-23 21:31:15 +00:00
AC_SUBST(CONSLIBS)
AC_SUBST(CONSCPPFLAGS)
AC_SUBST(CONSLDFLAGS)
2001-10-16 05:49:17 +00:00
AC_ARG_WITH(libwrap,
2004-04-13 20:30:28 +00:00
AS_HELP_STRING([--with-libwrap@<:@=PATH@:>@],
2001-10-16 05:49:17 +00:00
[Compile in libwrap (tcp_wrappers) support]),
2002-03-26 02:03:03 +00:00
[if test "$withval" != "no"; then
if test "$withval" != "yes"; then
WRAPCPPFLAGS="-I$withval/include"
WRAPLDFLAGS="-L$withval/lib"
2001-10-16 05:49:17 +00:00
else
WRAPCPPFLAGS=""
WRAPLDFLAGS=""
fi
oCPPFLAGS="$CPPFLAGS"
oLDFLAGS="$LDFLAGS"
oLIBS="$LIBS"
CPPFLAGS="$CPPFLAGS $WRAPCPPFLAGS"
LDFLAGS="$LDFLAGS $WRAPLDFLAGS"
AC_CHECK_HEADER(tcpd.h,
[LIBS="$LIBS -lwrap"
AC_MSG_CHECKING(for TCP wrappers library -lwrap)
AC_TRY_LINK([#include <tcpd.h>
int allow_severity = 0;
int deny_severity = 0;
],[hosts_access((void *)0)],
[AC_MSG_RESULT(yes)
2003-09-22 20:49:53 +00:00
AC_DEFINE(USE_LIBWRAP)
CONSLIBS="$CONSLIBS -lwrap"
CONSLDFLAGS="$CONSLDFLAGS $WRAPLDFLAGS"
CONSCPPFLAGS="$CONSCPPFLAGS $WRAPCPPFLAGS"],
[AC_MSG_RESULT(no)
LIBS="$LIBS -lnsl"
AC_MSG_CHECKING(for TCP wrappers library -lwrap with -lnsl)
AC_TRY_LINK([#include <tcpd.h>
int allow_severity = 0;
int deny_severity = 0;
],[hosts_access((void *)0)],
[AC_MSG_RESULT(yes)
AC_DEFINE(USE_LIBWRAP)
CONSLIBS="$CONSLIBS -lwrap -lnsl"
CONSLDFLAGS="$CONSLDFLAGS $WRAPLDFLAGS"
CONSCPPFLAGS="$CONSCPPFLAGS $WRAPCPPFLAGS"],
[AC_MSG_RESULT(no)])])],)
2001-10-16 05:49:17 +00:00
LIBS="$oLIBS"
CPPFLAGS="$oCPPFLAGS"
LDFLAGS="$oLDFLAGS"
fi]
)
2001-02-19 06:50:29 +00:00
2002-10-14 21:03:35 +00:00
AC_ARG_WITH(openssl,
2004-04-13 20:30:28 +00:00
AS_HELP_STRING([--with-openssl@<:@=PATH@:>@],
2002-10-14 21:03:35 +00:00
[Compile in OpenSSL support]),
[if test "$withval" != "no"; then
if test "$withval" != "yes"; then
OPENSSLCPPFLAGS="-I$withval/include"
OPENSSLLDFLAGS="-L$withval/lib"
else
OPENSSLCPPFLAGS=""
OPENSSLLDFLAGS=""
fi
oCPPFLAGS="$CPPFLAGS"
oLDFLAGS="$LDFLAGS"
oLIBS="$LIBS"
have_openssl=no
CPPFLAGS="$CPPFLAGS $OPENSSLCPPFLAGS"
LDFLAGS="$LDFLAGS $OPENSSLLDFLAGS"
AC_CHECK_HEADER([openssl/ssl.h],
[LIBS="$LIBS -lssl -lcrypto"
AC_MSG_CHECKING(for openssl libraries -lssl and -lcrypto)
AC_TRY_LINK([#include <openssl/ssl.h>
],[SSL_library_init()],
[AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_OPENSSL)
have_openssl=yes],
[AC_MSG_RESULT(no)])],)
if test $have_openssl = no; then
LIBS="$oLIBS"
CPPFLAGS="$oCPPFLAGS"
LDFLAGS="$oLDFLAGS"
fi
fi]
)
2003-03-11 02:08:07 +00:00
AC_ARG_WITH(dmalloc,
2004-04-13 20:30:28 +00:00
AS_HELP_STRING([--with-dmalloc@<:@=PATH@:>@],
2003-03-11 02:08:07 +00:00
[Compile in dmalloc support]),
[if test "$withval" != "no"; then
if test "$withval" != "yes"; then
DMALLOCCPPFLAGS="-I$withval/include"
DMALLOCLDFLAGS="-L$withval/lib"
else
DMALLOCCPPFLAGS=""
DMALLOCLDFLAGS=""
fi
oCPPFLAGS="$CPPFLAGS"
oLDFLAGS="$LDFLAGS"
oLIBS="$LIBS"
have_dmalloc=no
CPPFLAGS="$CPPFLAGS $DMALLOCCPPFLAGS"
LDFLAGS="$LDFLAGS $DMALLOCLDFLAGS"
AC_CHECK_HEADER([dmalloc.h],
[LIBS="$LIBS -ldmalloc"
AC_MSG_CHECKING(for dmalloc libraries -ldmalloc)
AC_TRY_LINK([#include <dmalloc.h>
],[dmalloc_debug(0)],
[AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_DMALLOC)
have_dmalloc=yes],
[AC_MSG_RESULT(no)])],)
if test $have_dmalloc = no; then
LIBS="$oLIBS"
CPPFLAGS="$oCPPFLAGS"
LDFLAGS="$oLDFLAGS"
fi
fi]
)
2001-02-19 06:50:29 +00:00
2001-06-16 00:44:07 +00:00
dnl ### Check for needed functions. ################################
2002-03-26 02:03:03 +00:00
2003-09-22 20:49:53 +00:00
dnl dnl The following basically stollen from the less-358 distribution, but
dnl dnl modified for my own purposes
dnl AC_MSG_CHECKING(for POSIX regex)
dnl AC_ARG_WITH(regex,
dnl AC_HELP_STRING([--with-regex],
dnl [Use regular expressions in conserver.passwd]),
dnl [if test "$withval" = yes; then
dnl AC_TRY_RUN([
dnl #include <sys/types.h>
dnl #include <regex.h>
dnl main() { regex_t r; regmatch_t rm; char *text = "xabcy";
dnl if (regcomp(&r, "abc", 0)) exit(1);
dnl if (regexec(&r, text, 1, &rm, 0)) exit(1);
dnl if (rm.rm_so != 1) exit(1); /* check for correct offset */
dnl exit(0); }
dnl ],have_posix_regex=yes,have_posix_regex=no,have_posix_regex=unknown)
dnl if test $have_posix_regex = yes; then
dnl AC_MSG_RESULT(yes)
dnl AC_DEFINE(HAVE_POSIX_REGCOMP)
dnl elif test $have_posix_regex = unknown; then
dnl AC_TRY_LINK([
dnl #include <sys/types.h>
dnl #include <regex.h>],
dnl [regex_t *r; regfree(r);],
dnl AC_MSG_RESULT(yes)
dnl AC_DEFINE(HAVE_POSIX_REGCOMP))
dnl else
dnl AC_MSG_RESULT(no)
dnl fi
dnl else
dnl AC_MSG_RESULT(no)
dnl fi],[AC_MSG_RESULT(no)])
2002-03-26 02:03:03 +00:00
2003-04-09 15:30:48 +00:00
AC_MSG_CHECKING(for PAM support)
2002-09-23 21:31:15 +00:00
AC_ARG_WITH(pam,
2004-04-13 20:30:28 +00:00
AS_HELP_STRING([--with-pam],
2002-10-14 21:03:35 +00:00
[Enable PAM support]),
2002-09-23 21:31:15 +00:00
[if test "$withval" = yes; then
oLIBS="$LIBS"
AC_CHECK_HEADER(security/pam_appl.h,
[LIBS="$LIBS -lpam"
AC_MSG_CHECKING(for PAM library -lpam)
AC_TRY_LINK_FUNC([pam_start],
[AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_PAM)
CONSLIBS="$CONSLIBS -lpam"],
[LIBS="$LIBS -ldl"
AC_MSG_RESULT(no)
AC_MSG_CHECKING(for PAM library -lpam with -ldl)
AC_TRY_LINK_FUNC([pam_end],
[AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_PAM)
CONSLIBS="$CONSLIBS -lpam -ldl"],
[AC_MSG_RESULT(no)])])],)
LIBS="$oLIBS"
2003-04-09 15:30:48 +00:00
else
AC_MSG_RESULT(no)
fi],[AC_MSG_RESULT(no)])
2002-09-23 21:31:15 +00:00
2003-09-22 20:49:53 +00:00
dnl Checks for pty allocation...
dnl According to the xemacs distribution:
dnl getpt() is the preferred pty allocation method on glibc systems.
dnl _getpty() is the preferred pty allocation method on SGI systems.
dnl grantpt(), unlockpt(), ptsname() are defined by Unix98.
dnl openpty() is the preferred pty allocation method on BSD and Tru64 systems.
dnl openpty() might be declared in:
dnl - pty.h (Tru64 or Linux)
dnl - libutil.h (FreeBSD)
dnl - util.h (NetBSD)
dnl Conserver doesn't support getpt() or _getpt() yet.
AC_CHECK_HEADERS(pty.h libutil.h util.h)
AC_CHECK_LIB(util, openpty)
AC_CHECK_FUNCS(openpty)
2003-10-31 18:15:09 +00:00
AC_CHECK_FUNCS(getopt strerror getrlimit getsid setsid getuserattr setgroups tcgetpgrp tcsetpgrp tcgetattr tcsetattr tcsendbreak setpgrp getutent setttyent getspnam setlinebuf setvbuf ptsname grantpt unlockpt sigaction setsockopt getdtablesize putenv memset memcpy memcmp memmove sysconf getlogin inet_aton setproctitle)
2001-06-16 00:44:07 +00:00
AC_FUNC_SETPGRP
2003-04-09 15:30:48 +00:00
AC_CHECK_FUNC(strcasecmp,
[AC_DEFINE(HAVE_STRCASECMP, 1, [Define if strcasecmp is available])],
[AC_CHECK_FUNC(stricmp,
[AC_DEFINE(HAVE_STRICMP, 1, [Define if stricmp is available])],
[AC_MSG_ERROR([strcasecmp or stricmp must be available])])])
2001-06-16 00:44:07 +00:00
2002-09-23 21:31:15 +00:00
dnl Checks for libbsm functions
AC_CHECK_HEADERS(bsm/audit.h)
AC_CHECK_LIB(bsm, getaudit)
2003-04-09 15:30:48 +00:00
AC_CHECK_FUNCS(getaudit getaudit_addr)
2002-09-23 21:31:15 +00:00
2001-06-16 00:44:07 +00:00
2001-02-19 06:50:29 +00:00
dnl ### Create output files. #######################################
2003-09-29 15:50:27 +00:00
AC_CONFIG_FILES([Makefile conserver/Makefile conserver.cf/Makefile console/Makefile autologin/Makefile contrib/chat/Makefile])
2003-04-09 15:30:48 +00:00
AC_CONFIG_FILES([conserver/conserver.rc], [chmod +x conserver/conserver.rc])
2002-03-12 09:12:20 +00:00
AC_OUTPUT