dnl Process this file with autoconf to produce a configure script.
AC_INIT(server.cc)
AC_CONFIG_HEADER(config.h)
dnl Checks for programs.
AC_PROG_YACC
AC_PROG_CC
AC_PROG_CPP
AC_PROG_LEX
AC_PROG_CXX
AC_LANG_CPLUSPLUS
dnl Checks for libraries.
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h malloc.h sys/time.h unistd.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_TYPE_SIGNAL
AC_HEADER_TIME
dnl Checks for library functions.
AC_FUNC_MMAP
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(ftime gettimeofday select socket vsnprintf crypt)
dnl Check for bool
AC_MSG_CHECKING(for working bool)
AC_TRY_COMPILE( ,
bool b;,
ac_cv_have_bool=yes,
ac_cv_have_bool=no)
if test "$ac_cv_have_bool" = "yes"; then
AC_MSG_RESULT(found)
else
AC_MSG_RESULT(not found)
fi
dnl Check for isblank
AC_MSG_CHECKING(for isblank macro)
AC_TRY_LINK(
[#include "ctype.h"],
isblank("a");,
ac_cv_have_isblank=yes,
ac_cv_have_isblank=no)
if test "$ac_cv_have_isblank" = "yes"; then
AC_MSG_RESULT(found)
else
AC_MSG_RESULT(not found)
fi
dnl Crypt missing ?
if test "$ac_cv_func_crypt" = "no"; then
CRYPTOBJS="osaddon/crypt.o osaddon/crypt_util.o"
else
CRYPTOBJS=""
fi
AC_SUBST(CRYPTOBJS)
AC_OUTPUT(x/Makefile Makefile)
mv config.h conftestconfig.h
cat > config.h << EOF
#ifndef _CONFIG_H
#define _CONFIG_H
EOF
cat conftestconfig.h >> config.h
rm -f conftestconfig.h
if test "$ac_cv_have_bool" = "no"; then
cat >> config.h << EOF
typedef unsigned char bool;
const unsigned char true = 1;
const unsigned char false = 0;
EOF
fi
if test "$ac_cv_func_vsnprintf" = "no"; then
cat >> config.h << EOF
#define vsnprintf( str, size, fmt, ap ) vsprintf( str, fmt, ap )
EOF
fi
if test "$ac_cv_have_isblank" = "no"; then
cat >> config.h << EOF
#define isblank( x ) ( (x == ' ') || (x == '\t') )
EOF
fi
cat >> config.h << EOF
typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned int u32;
typedef signed short s16;
typedef signed int s32;
inline void mudpp_exit( int a ) { exit(a); }
#endif // _CONFIG_H
EOF