2001-02-19 06:50:29 +00:00
|
|
|
dnl ### Normal initialization. ######################################
|
2002-03-12 09:12:20 +00:00
|
|
|
AC_INIT
|
|
|
|
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. ############################################
|
2002-03-12 09:12:20 +00:00
|
|
|
ac_cv_allow_64bit=no
|
|
|
|
AC_MSG_CHECKING(whether to allow 64bit compilation)
|
|
|
|
AC_ARG_WITH(64bit,
|
|
|
|
AC_HELP_STRING([--with-64bit],[Allow 64bit compilation]),
|
|
|
|
[if test "$withval" = yes; then
|
|
|
|
ac_cv_allow_64bit=yes
|
|
|
|
fi])
|
|
|
|
AC_MSG_RESULT($ac_cv_allow_64bit)
|
|
|
|
|
2001-02-19 06:50:29 +00:00
|
|
|
AC_MSG_CHECKING(for port number specification)
|
|
|
|
AC_ARG_WITH(port,
|
2001-10-16 05:49:17 +00:00
|
|
|
AC_HELP_STRING([--with-port=PORT],[Specify port number @<:@conserver@:>@]),
|
2001-02-19 06:50:29 +00:00
|
|
|
[if test "$withval" != yes -a "$withval" != no; then
|
2001-07-05 16:18:19 +00:00
|
|
|
AC_DEFINE_UNQUOTED(DEFPORT, "$withval")
|
|
|
|
AC_MSG_RESULT(port '$withval')
|
2001-02-19 06:50:29 +00:00
|
|
|
else
|
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
|
|
|
fi],
|
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,
|
2001-10-16 05:49:17 +00:00
|
|
|
AC_HELP_STRING([--with-base=PORT], [Base port for secondary channel @<:@0@:>@]),
|
2001-07-27 00:05:04 +00:00
|
|
|
[if test "$withval" != yes -a "$withval" != no; then
|
|
|
|
AC_DEFINE_UNQUOTED(DEFBASEPORT, "$withval")
|
|
|
|
AC_MSG_RESULT(port '$withval')
|
|
|
|
else
|
|
|
|
AC_DEFINE_UNQUOTED(DEFBASEPORT, "0")
|
|
|
|
AC_MSG_RESULT(port '0')
|
|
|
|
fi],
|
|
|
|
[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,
|
2001-10-16 05:49:17 +00:00
|
|
|
AC_HELP_STRING([--with-master=MASTER],[Specify master server hostname @<:@console@:>@]),
|
2001-02-19 06:50:29 +00:00
|
|
|
[if test "$withval" != yes; then
|
|
|
|
AC_DEFINE_UNQUOTED(MASTERHOST, "$withval")
|
|
|
|
AC_MSG_RESULT('$withval')
|
|
|
|
else
|
|
|
|
AC_DEFINE_UNQUOTED(MASTERHOST, "console")
|
|
|
|
AC_MSG_RESULT('console')
|
|
|
|
fi],
|
|
|
|
[AC_DEFINE_UNQUOTED(MASTERHOST, "console")
|
|
|
|
AC_MSG_RESULT('console')])
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(for configuration filename)
|
|
|
|
AC_ARG_WITH(cffile,
|
2001-10-16 05:49:17 +00:00
|
|
|
AC_HELP_STRING([--with-cffile=CFFILE],[Specify config filename @<:@conserver.cf@:>@]),
|
2001-02-19 06:50:29 +00:00
|
|
|
[if test "$withval" != yes; then
|
|
|
|
AC_DEFINE_UNQUOTED(CONFIGFILE, "$withval")
|
2002-03-12 09:12:20 +00:00
|
|
|
AC_MSG_RESULT('$sysconfdir/$withval')
|
2001-02-19 06:50:29 +00:00
|
|
|
else
|
|
|
|
AC_DEFINE_UNQUOTED(CONFIGFILE, "conserver.cf")
|
2002-03-12 09:12:20 +00:00
|
|
|
AC_MSG_RESULT('$sysconfdir/conserver.cf')
|
2001-02-19 06:50:29 +00:00
|
|
|
fi],
|
|
|
|
[AC_DEFINE_UNQUOTED(CONFIGFILE, "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,
|
2001-10-16 05:49:17 +00:00
|
|
|
AC_HELP_STRING([--with-pwdfile=PWDFILE],[Specify password filename @<:@conserver.passwd@:>@]),
|
2001-02-19 06:50:29 +00:00
|
|
|
[if test "$withval" != yes; then
|
|
|
|
AC_DEFINE_UNQUOTED(PASSWDFILE, "$withval")
|
2002-03-12 09:12:20 +00:00
|
|
|
AC_MSG_RESULT('$sysconfdir/$withval')
|
2001-02-19 06:50:29 +00:00
|
|
|
else
|
|
|
|
AC_DEFINE_UNQUOTED(PASSWDFILE, "conserver.passwd")
|
2002-03-12 09:12:20 +00:00
|
|
|
AC_MSG_RESULT('$sysconfdir/conserver.passwd')
|
2001-02-19 06:50:29 +00:00
|
|
|
fi],
|
|
|
|
[AC_DEFINE_UNQUOTED(PASSWDFILE, "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,
|
2001-10-16 05:49:17 +00:00
|
|
|
AC_HELP_STRING([--with-logfile=LOGFILE],[Specify log filename @<:@/var/log/conserver@:>@]),
|
2001-07-05 16:18:19 +00:00
|
|
|
[if test "$withval" != yes; then
|
|
|
|
AC_DEFINE_UNQUOTED(LOGFILEPATH, "$withval")
|
|
|
|
AC_MSG_RESULT('$withval')
|
|
|
|
else
|
|
|
|
AC_DEFINE_UNQUOTED(LOGFILEPATH, "/var/log/conserver")
|
|
|
|
AC_MSG_RESULT('/var/log/conserver')
|
|
|
|
fi],
|
|
|
|
[AC_DEFINE_UNQUOTED(LOGFILEPATH, "/var/log/conserver")
|
|
|
|
AC_MSG_RESULT('/var/log/conserver')])
|
|
|
|
|
2001-05-03 13:44:08 +00:00
|
|
|
AC_MSG_CHECKING(for PID filename)
|
|
|
|
AC_ARG_WITH(pidfile,
|
2001-10-16 05:49:17 +00:00
|
|
|
AC_HELP_STRING([--with-pidfile=PIDFILE],[Specify PID filepath @<:@/var/run/conserver.pid@:>@]),
|
2001-05-03 13:44:08 +00:00
|
|
|
[if test "$withval" != yes; then
|
|
|
|
AC_DEFINE_UNQUOTED(PIDFILE, "$withval")
|
|
|
|
AC_MSG_RESULT('$withval')
|
|
|
|
else
|
|
|
|
AC_DEFINE_UNQUOTED(PIDFILE, "/var/run/conserver.pid")
|
|
|
|
AC_MSG_RESULT('/var/run/conserver.pid')
|
|
|
|
fi],
|
|
|
|
[AC_DEFINE_UNQUOTED(PIDFILE, "/var/run/conserver.pid")
|
|
|
|
AC_MSG_RESULT('/var/run/conserver.pid')])
|
|
|
|
|
2001-02-19 06:50:29 +00:00
|
|
|
AC_MSG_CHECKING(for MAXMEMB setting)
|
|
|
|
AC_ARG_WITH(maxmemb,
|
2001-10-16 05:49:17 +00:00
|
|
|
AC_HELP_STRING([--with-maxmemb=MAXMEMB],[Specify maximum consoles per process @<:@16@:>@]),
|
2001-02-19 06:50:29 +00:00
|
|
|
[if test "$withval" != yes; then
|
|
|
|
AC_DEFINE_UNQUOTED(MAXMEMB, $withval)
|
|
|
|
AC_MSG_RESULT($withval)
|
|
|
|
else
|
|
|
|
AC_DEFINE_UNQUOTED(MAXMEMB, 16)
|
|
|
|
AC_MSG_RESULT(16)
|
|
|
|
fi],
|
|
|
|
[AC_DEFINE_UNQUOTED(MAXMEMB, 16)
|
|
|
|
AC_MSG_RESULT(16)])
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(for connect() timeout)
|
|
|
|
AC_ARG_WITH(timeout,
|
2001-10-16 05:49:17 +00:00
|
|
|
AC_HELP_STRING([--with-timeout=TIMEOUT],[Specify connect() timeout in seconds @<:@10@:>@]),
|
2001-02-19 06:50:29 +00:00
|
|
|
[if test "$withval" -gt 0 -o "$withval" -lt 300; then
|
|
|
|
AC_DEFINE_UNQUOTED(CONNECTTIMEOUT, $withval)
|
|
|
|
AC_MSG_RESULT($withval)
|
|
|
|
else
|
|
|
|
AC_DEFINE_UNQUOTED(CONNECTTIMEOUT, 10)
|
|
|
|
AC_MSG_RESULT(10)
|
|
|
|
fi],
|
|
|
|
[AC_DEFINE_UNQUOTED(CONNECTTIMEOUT, 10)
|
|
|
|
AC_MSG_RESULT(10)])
|
|
|
|
|
|
|
|
dnl ### Check for compiler et al. ###################################
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_LN_S
|
|
|
|
AC_PROG_MAKE_SET
|
|
|
|
dnl ### Compiler characteristics. ##################################
|
|
|
|
AC_AIX
|
2002-03-12 09:12:20 +00:00
|
|
|
AC_PROG_CC_STDC
|
2001-02-19 06:50:29 +00:00
|
|
|
AC_C_CONST
|
|
|
|
|
2002-03-12 09:12:20 +00:00
|
|
|
AC_CHECK_SIZEOF(long)
|
|
|
|
if test "$ac_cv_sizeof_long" -gt 4; then
|
|
|
|
if test "$ac_cv_allow_64bit" != "yes"; then
|
|
|
|
AC_MSG_ERROR([cannot build on >32bit systems (to override use --with-64bit)])
|
|
|
|
else
|
|
|
|
AC_MSG_WARN([building a 64bit version of conserver - good luck!])
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$ac_cv_prog_cc_stdc" != "no"; then
|
|
|
|
AC_DEFINE_UNQUOTED(USE_ANSI_PROTO, 1)
|
|
|
|
fi
|
2001-02-19 06:50:29 +00:00
|
|
|
|
|
|
|
dnl ### Checks for header files. ###################################
|
|
|
|
AC_HEADER_STDC
|
|
|
|
AC_CHECK_HEADERS(sys/ioctl.h)
|
|
|
|
|
|
|
|
dnl ### POSIX terminal I/O
|
|
|
|
AC_CHECK_HEADERS(termios.h)
|
|
|
|
if test "$ac_cv_header_termios_h" != "yes"; then
|
|
|
|
dnl ### SysV terminal I/O
|
|
|
|
AC_CHECK_HEADERS(termio.h)
|
|
|
|
if test "$ac_cv_header_termio_h" != "yes"; then
|
|
|
|
dnl ### BSD terminal I/O
|
|
|
|
AC_CHECK_HEADERS(sgtty.h)
|
|
|
|
if test "$ac_cv_header_sgtty_h" != "yes"; then
|
|
|
|
AC_MSG_ERROR([no usable terminal interface detected])
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2001-07-27 00:05:04 +00:00
|
|
|
AC_CHECK_HEADERS(unistd.h getopt.h sys/vlimit.h sys/resource.h ttyent.h sys/ttold.h sys/uio.h sys/proc.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)
|
2001-02-19 06:50:29 +00:00
|
|
|
AC_HEADER_TIME
|
|
|
|
AC_HEADER_SYS_WAIT
|
|
|
|
AC_TYPE_MODE_T
|
|
|
|
AC_TYPE_SIGNAL
|
|
|
|
|
|
|
|
AC_CACHE_CHECK([if sig_atomic_t is defined], ac_cv_type_sig_atomic_t,
|
|
|
|
AC_TRY_LINK([
|
|
|
|
#include <signal.h>
|
|
|
|
], [
|
|
|
|
sig_atomic_t sigatom;
|
|
|
|
sigatom = 1;
|
|
|
|
],
|
|
|
|
ac_cv_type_sig_atomic_t=yes,
|
|
|
|
ac_cv_type_sig_atomic_t=no
|
|
|
|
)
|
|
|
|
)
|
|
|
|
if test "$ac_cv_type_sig_atomic_t" != "yes"; then
|
|
|
|
AC_DEFINE(sig_atomic_t, volatile int, [Define if <signal.h> does not define sig_atomic_t])
|
|
|
|
fi
|
|
|
|
|
2002-03-12 09:12:20 +00:00
|
|
|
AC_CHECK_TYPES(in_addr_t,,,[$ac_includes_default
|
|
|
|
#include <netinet/in.h>])
|
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)
|
|
|
|
|
|
|
|
AC_SUBST(WRAPLIBS)
|
|
|
|
AC_SUBST(WRAPINCS)
|
|
|
|
AC_ARG_WITH(libwrap,
|
|
|
|
AC_HELP_STRING([--with-libwrap@<:@=PATH@:>@],
|
|
|
|
[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_MSG_CHECKING(for TCP wrappers header tcpd.h)
|
|
|
|
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)
|
|
|
|
AC_DEFINE(USE_LIBWRAP)
|
|
|
|
WRAPLIBS="$WRAPLDFLAGS -lwrap"
|
|
|
|
WRAPINCS="$WRAPCPPFLAGS"],
|
|
|
|
[AC_MSG_RESULT(no)])],)
|
|
|
|
|
|
|
|
LIBS="$oLIBS"
|
|
|
|
CPPFLAGS="$oCPPFLAGS"
|
|
|
|
LDFLAGS="$oLDFLAGS"
|
|
|
|
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
|
|
|
|
|
|
|
dnl The following basically stollen from the less-358 distribution, but
|
|
|
|
dnl modified for my own purposes
|
|
|
|
AC_MSG_CHECKING(for POSIX regex)
|
|
|
|
AC_ARG_WITH(regex,
|
|
|
|
AC_HELP_STRING([--with-regex],
|
|
|
|
[Use regular expressions in conserver.passwd]),
|
|
|
|
[if test "$withval" = yes; then
|
|
|
|
AC_TRY_RUN([
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <regex.h>
|
|
|
|
main() { regex_t r; regmatch_t rm; char *text = "xabcy";
|
|
|
|
if (regcomp(&r, "abc", 0)) exit(1);
|
|
|
|
if (regexec(&r, text, 1, &rm, 0)) exit(1);
|
|
|
|
if (rm.rm_so != 1) exit(1); /* check for correct offset */
|
|
|
|
exit(0); }
|
|
|
|
],have_posix_regex=yes,have_posix_regex=no,have_posix_regex=unknown)
|
|
|
|
if test $have_posix_regex = yes; then
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE(HAVE_POSIX_REGCOMP)
|
|
|
|
elif test $have_posix_regex = unknown; then
|
|
|
|
AC_TRY_LINK([
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <regex.h>],
|
|
|
|
[regex_t *r; regfree(r);],
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE(HAVE_POSIX_REGCOMP))
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi],[AC_MSG_RESULT(no)])
|
|
|
|
|
2001-08-05 04:11:57 +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 flock sigaction setsockopt getdtablesize putenv memset memcpy memcmp sysconf getpassphrase getlogin)
|
2001-06-16 00:44:07 +00:00
|
|
|
AC_FUNC_SETPGRP
|
|
|
|
|
|
|
|
|
2001-02-19 06:50:29 +00:00
|
|
|
dnl ### Create output files. #######################################
|
|
|
|
AC_SUBST(LIBOBJS)
|
2002-03-12 09:12:20 +00:00
|
|
|
AC_CONFIG_FILES([Makefile conserver/Makefile conserver.cf/Makefile console/Makefile autologin/Makefile])
|
|
|
|
AC_OUTPUT
|