1stMUD4.0/bin/
1stMUD4.0/doc/MPDocs/
1stMUD4.0/player/
1stMUD4.0/win32/
1stMUD4.0/win32/rom/
dnl Process this file with autoconf to produce a configure script.
AC_INIT
dnl Procesas this file with autoheader to produce a config.h file.
AC_CONFIG_HEADER(../h/config.h:config.h.in)

AC_PROG_MAKE_SET
AC_PROG_CXX
AC_PROG_INSTALL

dnl Do we want to disable web server?
AC_ARG_ENABLE(web, [web : Disables web server.], 
	AC_DEFINE(NO_WEB, 1, [Define to disable web server can be set with configure --disable-web]))

dnl Checks for libraries.
AC_CHECK_LIB(crypt, crypt)
AC_CHECK_LIB(z, deflate)
AC_CHECK_LIB(socket, socket)
AC_CHECK_LIB(nsl, gethostbyname)
AC_CHECK_LIB(resolv, inet_aton)

dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h malloc.h memory.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h strings.h sys/stat.h sys/file.h sys/ioctl.h sys/socket.h sys/time.h unistd.h crypt.h zlib.h])

if test -n "$ac_cv_have_libcrypt" -a -n "$ac_cv_have_crypt_h"; then
	AC_DEFINE(NOCRYPT, 1, [Turns off encrypted passwords.])
fi

if test -n "$ac_cv_have_libz"; then
	AC_DEFINE(NO_MCCP, 1, [Turns off MUD Compression Protocol.])
fi

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SIGNAL
AC_HEADER_TIME
AC_STRUCT_TM

dnl Check sizes.
AC_CHECK_SIZEOF(short, 0)
AC_CHECK_SIZEOF(int, 0)
AC_CHECK_SIZEOF(long, 0)
AC_CHECK_SIZEOF(long long, 0)
AC_CHECK_SIZEOF(char, 0)

dnl Checks for library functions.
AC_FUNC_MEMCMP
AC_FUNC_STRFTIME
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([alarm atexit dup2 getcwd popen gethostbyaddr gethostbyname gethostname getpagesize gettimeofday inet_ntoa isascii memchr memmove memset mkdir select socket strcasecmp strchr strerror strncasecmp strpbrk strrchr strstr strtoul execl fork random srandom rand srand psignal strsignal])

if test -n "$ac_cv_have_random"; then
	if test -n "$ac_cv_have_rand"; then
		norandom=true
	else
		AC_DEFINE(random, rand, [Define as rand if not found and rand exists.])
	fi
fi

if test -n "$ac_cv_have_srandom"; then
	if test -n "$ac_cv_have_srand"; then
		nosrandom=true
	else
		AC_DEFINE(srandom, srand, [Define as srand if not found and srand exists.])
	fi
fi

if test x$norandom = xtrue -o x$nosrandom = xtrue; then
	AC_DEFINE(OLD_RAND, 1, [Use the old random number system.])
fi

dnl Check for makedepend.
AC_CHECK_PROGS(MAKEDEP,[makedepend mkdep],error)

dnl Check for programs used by signal handling.
if test ! -n "$ac_cv_have_popen"; then
	AC_CHECK_PROG(TEST_GDB,gdb,yes)
	if test ! -n "$ac_cv_test_gdb"; then
		AC_DEFINE(HAVE_GDB, 1,[Have the gdb program.])
	fi

	AC_CHECK_PROG(TEST_MAIL,sendmail,yes)
	if test ! -n "$ac_cv_test_mail"; then
		AC_DEFINE(HAVE_SENDMAIL, 1, [Have the sendmail program.])
	fi
fi

AC_OUTPUT([../Makefile:Makefile.in],[echo > stamp-h])