# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.57) AC_INIT() AC_CONFIG_AUX_DIR(autotools) AC_CONFIG_SRCDIR([src/main.c]) AC_CONFIG_HEADER([include/config.h]) AC_CONFIG_HEADER([lib/gdbm/autoconf.h]) AC_PREFIX_DEFAULT(~/NeoStats3.0) AC_CACHE_LOAD #Standard Defines for autoconf here x_maj=3 x_min='0' x_rev="a2-dev" x_package='NeoStats' MODULES="connectserv hostserv loveserv moraleserv statserv ircdauth extauth" #dont edit anything after this line! x_version=$x_maj.$x_min.$x_rev AM_INIT_AUTOMAKE($x_package, $x_version) AM_MAINTAINER_MODE AC_DEFINE_UNQUOTED(MAJOR, $x_maj, "Major Version Number") AC_DEFINE_UNQUOTED(MINOR, $x_min, "Minor Version Number") AC_DEFINE_UNQUOTED(REV, $x_rev, "Revision Version Number") AC_DEFINE_UNQUOTED(VERSION, $x_version, "Full Version") AC_MSG_HEADER([Configuring Core Now]) AC_LIBTOOL_DLOPEN dnl AC_DISABLE_SHARED dnl AC_LIBTOOL_WIN32_DLL dnl AC_LIBLTDL_CONVENIENCE # Checks for programs. AC_PROG_CC AC_PROG_LIBTOOL AC_PROG_YACC AC_PROG_LEX AC_PATH_PROG( SED, sed, , $PATH:/usr/bin:/usr/local/bin) # Checks for libraries. # AC_LIB_LTDL AC_CHECK_LIB(dl, dlopen) AC_CHECK_LIB(socket, socket) AC_REPLACE_FUNCS(getopt) AC_CHECK_MEMBERS([struct stat.st_blksize]) # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS( sys/types.h \ sys/time.h \ sys/select.h \ sys/socket.h \ unistd.h \ malloc.h \ assert.h \ ctype.h \ errno.h \ stddef.h \ stdio.h \ stdlib.h \ stdarg.h \ arpa/inet.h \ arpa/nameser.h \ net/if.h \ netinet/in.h \ netdb.h \ sys/sockio.h \ sys/stat.h \ sys/param.h \ sys/resource.h \ termios.h \ termio.h \ sgtty.h \ fcntl.h \ dlfcn.h \ alloca.h \ winsock.h \ time.h \ io.h \ pwd.h \ utime.h \ limits.h \ sys/utime.h \ sys/poll.h \ setjmp.h \ string.h \ sys/file.h \ inttypes.h \ stdint.h \ poll.h \ signal.h \ sys/epoll.h \ sys/queue.h \ sys/event.h \ sys/ioctl.h \ sys/devpoll.h \ memory.y, dnl to do if not found [], dnl to do if found [], dnl default includes [ #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_TIME_H #include #endif #ifdef HAVE_SYS_SELECT_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif ] ) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE AC_TYPE_OFF_T AC_TYPE_SIZE_T AC_TYPE_PID_T AC_HEADER_TIME AC_STRUCT_TM AC_C_VOLATILE AC_CHECK_SIZEOF(off_t) AC_CHECK_TYPE(u_int64_t, unsigned long long) AC_CHECK_TYPE(u_int32_t, unsigned int) AC_CHECK_TYPE(u_int16_t, unsigned short) AC_CHECK_TYPE(u_int8_t, unsigned char) AC_CHECK_TYPE(long long, [AC_DEFINE(HAVE_LONGLONG, 1, [if your compiler supports 'long long'])]) # check for ssize_t AC_CHECK_TYPE(ssize_t, , AC_DEFINE(ssize_t, int, [the signed version of size_t])) TYPE_SOCKLEN_T TYPE_IN_ADDR_T AC_FUNC_SELECT_ARGTYPES AC_CHECK_FUNCS( socket \ select \ strdup \ strstr \ strtok_r \ strftime \ uname \ strcasecmp \ stricmp \ strcmpi \ gethostbyaddr \ gettimeofday \ inet_addr \ inet_ntoa \ inet_pton \ inet_ntop \ tcsetattr \ tcgetattr \ perror \ closesocket \ siginterrupt \ sigaction \ signal \ getpass_r \ strlcat \ getpwuid \ geteuid \ dlopen \ utime \ sigsetjmp \ memmove \ bcopy \ strerror \ poll \ rename \ ftruncate \ flock \ fsync \ vasprintf \ fcntl, dnl if found [], dnl if not found, $ac_func is the name we check for func="$ac_func" AC_MSG_CHECKING([deeper for $func]) AC_TRY_LINK( [], [ $func ();], AC_MSG_RESULT(yes!) eval "ac_cv_func_$func=yes" def=`echo "HAVE_$func" | tr 'a-z' 'A-Z'` AC_DEFINE_UNQUOTED($def, 1, [If you have $func]), AC_MSG_RESULT(but still no) ) ) ADNS_C_GCCATTRIB # Checks for library functions. AC_REPLACE_FNMATCH AC_FUNC_FORK AC_PROG_GCC_TRADITIONAL AC_FUNC_SELECT_ARGTYPES AC_TYPE_SIGNAL AC_FUNC_STAT AC_FUNC_STRFTIME AC_FUNC_STRNLEN AC_FUNC_STRTOD AC_FUNC_VPRINTF AC_CHECK_FUNCS(strnlen strlcpy strlcat strndup) dnl backtrace is used for segv reporting AC_CHECK_FUNC(backtrace, [AC_DEFINE(HAVE_BACKTRACE, 1, 'backtrace function available') LIBS="-g $LIBS"] ) dnl **** Check for underscore on external symbols **** AC_CACHE_CHECK(whether external symbols need an underscore prefix, ac_cv_c_extern_prefix, [saved_libs=$LIBS LIBS="conftest_asm.s $LIBS" cat > conftest_asm.s < header file.]) AC_CHECK_LIB(db, db_create, LIBDB="-ldb")) dnl How to copy one va_list to another? AC_CACHE_CHECK([for va_copy], ns_va_copy, [AC_LINK_IFELSE( [AC_LANG_PROGRAM([#include ], [va_list ap1, ap2; va_copy(ap1, ap2);])], [ns_va_copy="yes"], [ns_va_copy="no"] )]) if test "$ns_va_copy" = "yes" ; then AC_DEFINE(HAVE_VA_COPY, 1, [Define if we have va_copy]) fi AC_CACHE_CHECK([for __va_copy], ns___va_copy, [AC_LINK_IFELSE( [AC_LANG_PROGRAM([#include ], [va_list ap1, ap2; __va_copy(ap1, ap2);])], [ns___va_copy="yes"], [ns___va_copy="no"] )]) if test "$ns___va_copy" = "yes" ; then AC_DEFINE(HAVE___VA_COPY, 1, [Define if we have __va_copy]) fi dnl Set NEO_PREFIX in config.h. if test "x${prefix}" = "xNONE"; then AC_DEFINE_UNQUOTED(NEO_PREFIX, "${ac_default_prefix}", "Installation Prefix") else AC_DEFINE_UNQUOTED(NEO_PREFIX, "${prefix}", "Installation Prefix") fi AX_PATH_LIB_PCRE AX_PATH_LIB_CURL AC_DEFINE_UNQUOTED(NS_HOST, "$host_os", "Operating System Host") AC_MSG_HEADER([Configuring CCDV Now]) wi_ARG_DISABLE_CCDV wi_PROG_CCDV AC_MSG_HEADER([Configuring LibEvent Now]) CHK_LIBEVNT AC_MSG_HEADER([NeoStats Configuration Summary:]) dnl check if we are running with Debug.... AC_MSG_CHECKING(Whether to Enable Debuging...) AC_ARG_ENABLE(debug, [ --enable-debug - Enable Debuging], [ case "$enableval" in yes) AC_DEFINE(DEBUG, 1, 'Enable Debugging') CFLAGS="$CFLAGS -ggdb -Wall -DCURLDEBUG" AC_MSG_RESULT(yes - Watch your Log Files) ;; *) CFLAGS="$CFLAGS -DNDEBUG" AC_MSG_RESULT(no) ;; esac], CFLAGS="$CFLAGS -DNDEBUG" AC_MSG_RESULT(no) ) AC_MSG_CHECKING(To Enable AutoTools Debug Mode?) AC_ARG_ENABLE(autodebug, [ --enable-autodebug - Enable AutoTools Debug], [ case "$enableval" in yes) AC_MSG_RESULT(yes) ;; *) AC_MSG_RESULT(no) AX_MAINTAINER_MODE_AUTO_SILENT ;; esac], AC_MSG_RESULT(no) AX_MAINTAINER_MODE_AUTO_SILENT ) AC_MSG_CHECKING(To Enable Raw command?) AC_ARG_ENABLE(raw, [ --enable-raw - Enable Raw command], [ case "$enableval" in yes) AC_DEFINE(USE_RAW, 1, 'Use Raw command') AC_MSG_RESULT(yes) ;; *) AC_MSG_RESULT(no) ;; esac], AC_MSG_RESULT(no) ) AC_MSG_CHECKING(The Modules that will be automatically compiled) AC_MSG_RESULT($MODULES) AC_MSG_CHECKING(The additional modules to compile?) AC_ARG_WITH(modules, [ --with-modules - Additional Modules to compile], MODULES="$MODULES $withval" AC_MSG_RESULT($withval), AC_MSG_RESULT("None")) CFLAGS="$CFLAGS -fno-strict-aliasing" AC_SUBST(PROTOCOL) AC_SUBST(SED) AC_SUBST(LIBTOOL_DEPS) AC_SUBST(MODULES) AC_SUBST(LIBDB) AC_SUBST(CCDV) AC_SUBST(EVNTLIBOBJS) AC_CONFIG_FILES([Makefile include/Makefile src/Makefile src/protocol/Makefile src/dbm/Makefile lib/Makefile lib/curl/Makefile lib/adns/Makefile lib/pcre/Makefile lib/rta/Makefile lib/event/Makefile modules/Makefile modules/connectserv/Makefile modules/extauth/Makefile modules/hostserv/Makefile modules/ircdauth/Makefile modules/loveserv/Makefile modules/moraleserv/Makefile modules/statserv/Makefile neostats]) AC_CACHE_SAVE AC_OUTPUT AC_MSG_HEADER([Configuration complete.]) if test ! -f .hush; then \ read -p "Press Enter key to read the release notes"; \ clear; \ more RELNOTES; \ echo "Run 'make' (or 'gmake' on some systems) to compile NeoStats."; \ echo "If you require support, see the README file."; \ fi;