dnl Process this file with autoconf to produce a configure script. AC_INIT(mudconf.h) AC_CONFIG_HEADER(autoconf.h) AC_PROG_CC AC_PROG_CPP AC_ISC_POSIX AC_MINIX AC_STDC_HEADERS AC_HAVE_HEADERS(unistd.h memory.h string.h errno.h malloc.h sys/select.h) AC_TIME_WITH_SYS_TIME AC_VFORK AC_VPRINTF AC_HAVE_FUNCS(setrlimit getrusage timelocal mktime srandom) AC_HAVE_FUNCS(getpagesize getdtablesize socket gethostbyaddr) AC_HAVE_FUNCS(gettimeofday) AC_RETSIGTYPE AC_COMPILE_CHECK([struct sigcontext argument in signal handlers], [#include <sys/signal.h>],[struct sigcontext scp;], AC_DEFINE(HAVE_STRUCT_SIGCONTEXT))dnl AC_WAIT3 AC_STRUCT_TM AC_TIMEZONE AC_PID_T AC_COMPILE_CHECK([union wait], [#include <sys/wait.h>],[union wait stat;], AC_DEFINE(HAVE_UNION_WAIT)) echo checking for extended string dcls AC_HEADER_EGREP(rindex,string.h, ,AC_DEFINE(NEED_INDEX_DCL)) echo checking for malloc dcl AC_HEADER_EGREP(realloc,stdlib.h, ,AC_DEFINE(NEED_MALLOC_DCL)) echo checking for vsprintf dcl AC_HEADER_EGREP(vsprintf,stdio.h, ,AC_DEFINE(NEED_VSPRINTF_DCL)) echo checking for sprintf dcl AC_HEADER_EGREP(\<sprintf|\<*sprintf,stdio.h, ,AC_DEFINE(NEED_SPRINTF_DCL)) echo checking for extended stdio dcls AC_HEADER_EGREP(fread,stdio.h,AC_DEFINE(EXTENDED_STDIO_DCLS)) echo checking for extended socket dcls AC_HEADER_EGREP(setsockopt,sys/socket.h,AC_DEFINE(EXTENDED_SOCKET_DCLS)) echo checking for signal SIGCHLD braindamage AC_TEST_PROGRAM([ #include <sys/signal.h> #ifndef SIGCHLD #define SIGCHLD SIGCLD #endif int rlev; sighand(sig,code) int sig, code; { int stat; if (rlev++ > 2) exit(1); signal(SIGCHLD, sighand); wait(&stat); return; } main(argc, argv) int argc; char **argv; { rlev = 0; signal(SIGCHLD, sighand); if (fork()) { sleep(10); } else { sleep(2); exit(1); } exit(0); } ],,[AC_DEFINE(SIGNAL_SIGCHLD_BRAINDAMAGE)]) AC_FUNC_CHECK(sys_siglist, AC_DEFINE(HAVE_SYS_SIGLIST), siglist_missing=1) if test -n "$siglist_missing"; then AC_FUNC_CHECK(_sys_siglist, AC_DEFINE(HAVE__SYS_SIGLIST)) fi case "$DEFS" in *HAVE_SYS_SIGLIST*) echo checking for sys_siglist dcl AC_HEADER_EGREP(sys_siglist,signal.h, ,AC_DEFINE(NEED_SYS_SIGLIST_DCL)) ;; *) case "$DEFS" in *HAVE__SYS_SIGLIST*) AC_HEADER_EGREP(_sys_siglist,signal.h, ,AC_DEFINE(NEED__SYS_SIGLIST_DCL)) ;; esac ;; esac case "$DEFS" in *HAVE_ERRNO_H*) AC_DEFINE(NEED_SYS_ERRLIST_DCL) ;; *) echo checking for sys_errlist dcl AC_HEADER_EGREP(sys_errlist,errno.h, ,AC_DEFINE(NEED_SYS_ERRLIST_DCL)) ;; esac echo checking for perror dcl AC_HEADER_EGREP(perror,errno.h, ,AC_DEFINE(NEED_PERROR_DCL)) echo checking for getrusage dcl AC_HEADER_EGREP(getrusage,sys/resource.h, ,AC_DEFINE(NEED_GETRUSAGE_DCL)) echo checking for getrlimit dcl AC_HEADER_EGREP(getrlimit,sys/resource.h, ,AC_DEFINE(NEED_GETRLIMIT_DCL)) AC_CONST AC_CHAR_UNSIGNED AC_INLINE AC_COMPILE_CHECK([linger], [#include <sys/socket.h>],[struct linger ling; ling.l_onoff = 1;], AC_DEFINE(HAVE_LINGER))dnl dnl dnl Check for the presence of ndbm or dbm routines as follows dnl ndbm routines in libc dnl existence of libndbm dnl ndbm routines in libdbm dnl existence of libsdbm dnl dbm routines in libc dnl dbm routines in libdbm dnl echo "checking for ndbm routines in libc:" LIBS_predbm="$LIBS" AC_FUNC_CHECK(dbm_close,AC_DEFINE(HAVE_NDBM)) case "$DEFS" in *HAVE_NDBM*) ;; *) AC_HAVE_LIBRARY(ndbm) case "$DEFS" in *HAVE_LIBNDBM*) AC_DEFINE(HAVE_NDBM) ;; *) AC_HAVE_LIBRARY(dbm) case "$DEFS" in *HAVE_LIBDBM*) echo "checking for ndbm routines in libdbm:" AC_FUNC_CHECK(dbm_close,AC_DEFINE(HAVE_NDBM)) case "$DEFS" in *HAVE_NDBM*) ;; *) LIBS_withdbm="$LIBS" LIBS="$LIBS_predbm" AC_HAVE_LIBRARY(sdbm) case "$DEFS" in *HAVE_SDBM*) AC_DEFINE(HAVE_NDBM) ;; *) LIBS="$LIBS_withdbm" ;; esac ;; esac ;; esac ;; esac ;; esac case "$DEFS" in *HAVE_NDBM*) ;; *) LIBS="$LIBS_predbm" echo checking for dbm routines in libc AC_FUNC_CHECK(dbmclose,AC_DEFINE(HAVE_DBM)) case "$DEFS" in *HAVE_DBM*) ;; *) case "$DEFS" in *HAVE_LIBDBM*) AC_DEFINE(HAVE_DBM) LIBS="$LIBS_withdbm" ;; esac ;; esac case "$DEFS" in *HAVE_DBM*) ;; *) LIBOBJS="$LIBOBJS myndbm.o" ;; esac ;; esac AC_HAVE_LIBRARY(resolv) case "$DEFS" in *HAVE_SOCKET*) ;; *) AC_HAVE_LIBRARY(socket) ;; esac case "$DEFS" in *HAVE_GETHOSTBYADDR*) ;; *) AC_HAVE_LIBRARY(inet) ;; esac AC_DYNIX_SEQ AC_IRIX_SUN AC_HAVE_LIBRARY(nsl) AC_SUBST(LIBOBJS) AC_OUTPUT(Makefile)