# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.53) AC_INIT([BtOnline-BTechMux], [0.6]) AC_CONFIG_HEADERS([src/autoconf.h]) # Checks for programs. AC_PROG_AWK AC_PROG_CC AC_PROG_CPP AC_ISC_POSIX AC_MINIX # Checks for libraries. AC_CHECK_LIB(bsd, main) AC_CHECK_LIB(crypt, crypt) AC_CHECK_LIB(m, tan) AC_CHECK_LIB(nsl, main) AC_CHECK_LIB(event, event_init, [], AC_MSG_ERROR([Was unable to locate libevent]) ) # Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS([arpa/inet.h errno.h fcntl.h limits.h memory.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/file.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h time.h unistd.h]) AC_CHECK_HEADER(event.h, [], AC_MSG_ERROR([Was unable to locate event.h]) ) # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL AC_C_CHAR_UNSIGNED AC_C_CONST AC_C_INLINE AC_TYPE_PID_T AC_TYPE_SIZE_T AC_HEADER_TIME AC_STRUCT_TM AC_STRUCT_TIMEZONE AC_CHECK_TYPES([ptrdiff_t]) # Checks for library functions. AC_FUNC_CLOSEDIR_VOID AC_FUNC_FORK AC_FUNC_LSTAT AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK AC_FUNC_MALLOC AC_FUNC_REALLOC AC_FUNC_SELECT_ARGTYPES AC_TYPE_SIGNAL AC_FUNC_STAT AC_FUNC_VPRINTF AC_FUNC_WAIT3 AC_CHECK_FUNCS([alarm bzero dup2 floor getdtablesize gethostbyaddr gethostbyname getpagesize getrusage gettimeofday inet_ntoa isascii localtime memmove memset mktime pow regcomp rint select socket sqrt srandom stpcpy strcasecmp strchr strcspn strdup strerror strncasecmp strndup strnlen strrchr strstr strtol timelocal tzset]) AC_MSG_CHECKING(for linger) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [#include <sys/socket.h>], [struct linger ling; ling.l_onoff = 1;] )], [AC_DEFINE([HAVE_LINGER], [1], [Define if sys/socket.h has struct linger]) AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)] ) if test "$ac_cv_func_socket" = "yes"; then AC_CHECK_LIB(socket, main) fi if test "$ac_cv_func_gethostbyaddr" = "yes"; then AC_CHECK_LIB(inet, main) fi # Check the various enable code sections AC_MSG_CHECKING([Should we enable support for graphical HUDs [[default=yes]]]) AC_ARG_ENABLE([hudinfo-support], AS_HELP_STRING([--disable-hudinfo-support], [Disable the code to support graphical HUDs [[default=enabled]]]) AS_HELP_STRING([ ], [ ]), [ case "${enableval}" in yes) AC_DEFINE([HUDINFO_SUPPORT], [1], [Should the HUDINFO code be enabled]) AC_MSG_RESULT([yes]) ;; no) AC_MSG_RESULT([no]) ;; *) AC_MSG_ERROR(bad value "${enableval}" for hudinfo-support option) ;; esac ], [ AC_DEFINE([HUDINFO_SUPPORT], [1], [Should the HUDINFO code be enabled]) AC_MSG_RESULT([yes]) ] ) AC_MSG_CHECKING([Should we enable the advanced econ system [[default=yes]]]) AC_ARG_ENABLE([bt-advanced-econ], AS_HELP_STRING([--disable-bt-advanced-econ], [Disable the advanced econ system [[default=enabled]]]) AS_HELP_STRING([ ], [ ]), [ case "${enableval}" in yes) AC_DEFINE([BT_ADVANCED_ECON], [1], [Should the advanced econ system be enabled]) AC_MSG_RESULT([yes]) ;; no) AC_MSG_RESULT([no]) ;; *) AC_MSG_ERROR(bad value "${enableval}" for bt-advanced-econ option) ;; esac ], [ AC_MSG_RESULT([yes]) AC_DEFINE([BT_ADVANCED_ECON], [1], [Should the advanced econ system be enabled]) ] ) AC_MSG_CHECKING([Should we enable MW3-like stats and skills [[default=yes]]]) AC_ARG_ENABLE([bt-mw3stats], AS_HELP_STRING([--disable-bt-mw3stats], [Disable MW3-like stats and skills [[default=enabled]]]) AS_HELP_STRING([ ], [ ]), [ case "${enableval}" in yes) AC_DEFINE([BT_EXILE_MW3STATS], [1], [Should MW3-like stats and skills be enabled]) AC_MSG_RESULT([yes]) ;; no) AC_MSG_RESULT([no]) ;; *) AC_MSG_ERROR(bad value "${enableval}" for bt-mw3stats option) ;; esac ], [ AC_MSG_RESULT([yes]) AC_DEFINE([BT_EXILE_MW3STATS], [1], [Should MW3-like stats and skills be enabled]) ] ) AC_MSG_CHECKING([Should we enable advanced movement modes [[default=yes]]]) AC_ARG_ENABLE([bt-movement-modes], AS_HELP_STRING([--disable-bt-movement-modes], [Disable advanced movement modes [[default=enabled]]]) AS_HELP_STRING([ ], [ ]), [ case "${enableval}" in yes) AC_DEFINE([BT_MOVEMENT_MODES], [1], [Should the advanced movement modes be enabled]) AC_MSG_RESULT([yes]) ;; no) AC_MSG_RESULT([no]) ;; *) AC_MSG_ERROR(bad value "${enableval}" for bt-movement-modes option) ;; esac ], [ AC_MSG_RESULT([yes]) AC_DEFINE([BT_MOVEMENT_MODES], [1], [Should the advanced movement modes be enabled]) ] ) AC_MSG_CHECKING([Should we copy freqs to MW on disembark [[default=yes]]]) AC_ARG_ENABLE([bt-mwfreqs], AS_HELP_STRING([--disable-bt-mwfreqs], [Disable MW freq copying [[default=enabled]]]) AS_HELP_STRING([ ], [ ]), [ case "${enableval}" in yes) AC_DEFINE([COPY_CHANS_ON_EJECT], [1], [Should copying freqs to MWs be enabled]) AC_MSG_RESULT([yes]) ;; no) AC_MSG_RESULT([no]) ;; *) AC_MSG_ERROR(bad value "${enableval}" for bt-mwfreqs option) ;; esac ], [ AC_MSG_RESULT([yes]) AC_DEFINE([COPY_CHANS_ON_EJECT], [1], [Should copying freqs to MWs be enabled]) ] ) AC_MSG_CHECKING([Should we enable enhanced logging [[default=yes]]]) AC_ARG_ENABLE([enhanced-logging], AS_HELP_STRING([--disable-enhanced-logging], [Disable support for arbitrary server logs [[default=enabled]]]) AS_HELP_STRING([ ], [ ]), [ case "${enableval}" in yes) AC_MSG_RESULT([yes]) AC_DEFINE([ARBITRARY_LOGFILES], [1], [Should Enhanced Logging be enabled]) logcache=' src/logcache.o \'; AC_SUBST([LOGCACHE], [${logcache}]) ;; no) logcache=' \'; AC_SUBST([LOGCACHE], [${logcache}]) AC_MSG_RESULT([no]) ;; *) AC_MSG_ERROR(bad value "${enableval}" for enhanced-logging option) ;; esac ], [ AC_MSG_RESULT([yes]) AC_DEFINE([ARBITRARY_LOGFILES], [1], [Should Enhanced Logging be enabled]) logcache=' src/logcache.o \'; AC_SUBST([LOGCACHE], [${logcache}]) ] ) AC_MSG_CHECKING([Should we enable the code for complex repairs [[default=no]]]) AC_ARG_ENABLE([bt-complexrepairs], AS_HELP_STRING([--enable-bt-complexrepairs], [Enable code for complex repairs [[default=disabled]]]) AS_HELP_STRING([ ], [ ]), [ case "${enableval}" in yes) AC_DEFINE([BT_COMPLEXREPAIRS], [1], [Should complex repairs be enabled]) AC_MSG_RESULT([yes]) ;; no) AC_MSG_RESULT([no]) ;; *) AC_MSG_ERROR(bad value "${enableval}" for bt-complexrepairs option) ;; esac ], [ AC_MSG_RESULT([no]) ] ) AC_MSG_CHECKING([Should we allow mech overspeeding [[default=no]]]) AC_ARG_ENABLE([bt-overspeeding], AS_HELP_STRING([--enable-bt-overspeeding], [Enable mech overspeeding [[default=disabled]]]) AS_HELP_STRING([ ], [ ]), [ case "${enableval}" in yes) AC_DEFINE([WEIGHT_OVERSPEEDING], [1], [Should mech overspeeding be enabled]) AC_MSG_RESULT([yes]) ;; no) AC_MSG_RESULT([no]) ;; *) AC_MSG_ERROR(bad value "${enableval}" for bt-overspeeding option) ;; esac ], [ AC_MSG_RESULT([no]) ] ) AC_MSG_CHECKING([Should we enable the code for freetechtime [[default=no]]]) AC_ARG_ENABLE([bt-freetechtime], AS_HELP_STRING([--enable-bt-freetechtime], [Enable code to give near instant techtime [[default=disabled]]]) AS_HELP_STRING([ ], [ ]), [ case "${enableval}" in yes) AC_DEFINE([BT_FREETECHTIME], [1], [Should the freetechtime code be enabled]) AC_MSG_RESULT([yes]) ;; no) AC_MSG_RESULT([no]) ;; *) AC_MSG_ERROR(bad value "${enableval}" for bt-freetechtime option) ;; esac ], [ AC_MSG_RESULT([no]) ] ) AC_MSG_CHECKING([Should we enable sql support [[default=no]]]) AC_ARG_ENABLE([sql-support], AS_HELP_STRING([--enable-sql-support], [Enable support for sql. Needs libdbi with mysql driver [[default=disabled]]]) AS_HELP_STRING([ ], [ ]), [ case "${enableval}" in yes) AC_MSG_RESULT([yes]) AC_CHECK_HEADER([dbi/dbi.h]) AC_CHECK_LIB(dbi, dbi_conn_new) if test "$ac_cv_header_dbi_dbi_h" = "yes" && test "$ac_cv_lib_dbi_dbi_conn_new" = "yes" ; then AC_DEFINE([SQL_SUPPORT], [1], [Should SQL Support be enabled]) sqlchild=' src/sqlchild.o \'; AC_SUBST([SQLCHILD], [${sqlchild}]) else AC_MSG_ERROR([Was unable to locate ldbi]) fi ;; no) sqlchild=' \'; AC_SUBST([SQLCHILD], [${sqlchild}]) AC_MSG_RESULT([no]) ;; *) AC_MSG_ERROR(bad value "${enableval}" for sql-support option) ;; esac ], [ sqlchild=' \'; AC_SUBST([SQLCHILD], [${sqlchild}]) AC_MSG_RESULT([no]) ] ) AC_CONFIG_FILES([Makefile]) AC_OUTPUT