dnl ### Normal initialization. ###################################### AC_INIT(conserver/main.c) AC_CONFIG_HEADER(config.h) dnl ### Set some option defaults. ################################### if test -z "$CFLAGS"; then CFLAGS="-O" fi MKDIR="mkdir -p -m 755" AC_SUBST(MKDIR) dnl ### Custom settings. ############################################ AC_MSG_CHECKING(for port number specification) AC_ARG_WITH(port, [ --with-port=PORT Specify port number [conserver]], [if test "$withval" != yes -a "$withval" != no; then if expr "$withval" : '.*[[^0-9]]' >/dev/null 2>&1; then AC_DEFINE_UNQUOTED(SERVICENAME, "$withval") AC_MSG_RESULT(/etc/services name '$withval') else AC_DEFINE_UNQUOTED(PORTNUMBER, $withval) AC_MSG_RESULT(port $withval) fi else AC_DEFINE_UNQUOTED(SERVICENAME, "conserver") AC_MSG_RESULT(/etc/services name 'conserver') fi], [AC_DEFINE_UNQUOTED(SERVICENAME, "conserver") AC_MSG_RESULT(/etc/services name 'conserver')]) AC_MSG_CHECKING(for master conserver hostname) AC_ARG_WITH(master, [ --with-master=MASTER Specify master server hostname [console]], [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, [ --with-cffile=CFFILE Specify config filename [conserver.cf] ], [if test "$withval" != yes; then AC_DEFINE_UNQUOTED(CONFIGFILE, "$withval") AC_MSG_RESULT('$withval') else AC_DEFINE_UNQUOTED(CONFIGFILE, "conserver.cf") AC_MSG_RESULT('conserver.cf') fi], [AC_DEFINE_UNQUOTED(CONFIGFILE, "conserver.cf") AC_MSG_RESULT('conserver.cf')]) AC_MSG_CHECKING(for password filename) AC_ARG_WITH(pwdfile, [ --with-pwdfile=PWDFILE Specify password filename [conserver.passwd] ], [if test "$withval" != yes; then AC_DEFINE_UNQUOTED(PASSWDFILE, "$withval") AC_MSG_RESULT('$withval') else AC_DEFINE_UNQUOTED(PASSWDFILE, "conserver.passwd") AC_MSG_RESULT('conserver.passwd') fi], [AC_DEFINE_UNQUOTED(PASSWDFILE, "conserver.passwd") AC_MSG_RESULT('conserver.passwd')]) AC_MSG_CHECKING(for MAXMEMB setting) AC_ARG_WITH(maxmemb, [ --with-maxmemb=MAXMEMB Specify maximum consoles per process [16]], [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 MAXGRP setting) AC_ARG_WITH(maxgrp, [ --with-maxgrp=MAXGRP Specify maximum number of processes [32]], [if test "$withval" != yes; then AC_DEFINE_UNQUOTED(MAXGRP, $withval) AC_MSG_RESULT($withval) else AC_DEFINE_UNQUOTED(MAXGRP, 32) AC_MSG_RESULT(32) fi], [AC_DEFINE_UNQUOTED(MAXGRP, 32) AC_MSG_RESULT(32)]) AC_MSG_CHECKING(for 8bit setting) AC_ARG_ENABLE(8bit, [ --enable-8bit Enable 8bit data path ], [AC_DEFINE_UNQUOTED(CPARITY, 0) AC_MSG_RESULT(yes)], [AC_DEFINE_UNQUOTED(CPARITY, 1) AC_MSG_RESULT(no)]) AC_MSG_CHECKING(for connect() timeout) AC_ARG_WITH(timeout, [ --with-timeout=TIMEOUT Specify connect() timeout in seconds [10]], [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 AC_C_CONST 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 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) 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 ], [ 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 does not define sig_atomic_t]) fi AC_CACHE_CHECK([if socklen_t is defined], ac_cv_type_socklen_t, AC_TRY_LINK([ #include ], [ socklen_t len = 0; printf("len == %d\n", len); ], ac_cv_type_socklen_t=yes, ac_cv_type_socklen_t=no ) ) if test "$ac_cv_type_socklen_t" != "yes"; then AC_DEFINE(socklen_t, int, [Define if does not define socklen_t]) fi dnl ### Check for needed functions. ################################ AC_CHECK_FUNCS(getopt strerror getrlimit getsid setsid getuserattr setgroups tcgetpgrp tcsetpgrp tcgetattr tcsetattr tcsendbreak setpgrp getutent setttyent wait3 getspnam setlinebuf setvbuf getpseudo ptsname flock sigaction setsockopt getdtablesize putenv memset memcpy memcmp) AC_FUNC_SETPGRP dnl ### Check for libraries. ####################################### AC_CHECK_LIB(socket,socket) AC_CHECK_LIB(nsl,gethostbyname) AC_CHECK_LIB(crypt,crypt) dnl ### Create output files. ####################################### AC_SUBST(LIBOBJS) AC_OUTPUT(Makefile conserver/Makefile conserver.cf/Makefile console/Makefile autologin/Makefile)