Author: Isomer <isomer@undernet.org>
[ircu2.10.12-pk.git] / configure.in
index 298eab7004af8671a5d212418ea997a61605f010..88ec8c71f848bd8de6622551009f10f8f35d9da4 100644 (file)
@@ -41,8 +41,8 @@ ac_default_prefix=$unet_cv_prefix
 dnl Define the input and output configuration header file.
 AC_CONFIG_HEADER([config.h])
 
-dnl Demand at least version 2.13 of autoconf
-AC_PREREQ(2.13)
+dnl Demand at least version 2.50 of autoconf
+AC_PREREQ(2.50)
 
 dnl Find out what type of system we are
 AC_CANONICAL_HOST
@@ -108,7 +108,7 @@ AC_LIBRARY_NET
 
 dnl Checks for header files.
 AC_HEADER_STDC
-AC_CHECK_HEADERS(crypt.h poll.h stdint.h sys/devpoll.h sys/epoll.h sys/event.h sys/param.h sys/socket.h)
+AC_CHECK_HEADERS(crypt.h poll.h inttypes.h stdint.h sys/devpoll.h sys/epoll.h sys/event.h sys/param.h sys/socket.h)
 
 dnl Checks for typedefs, structures, and compiler characteristics
 dnl AC_C_CONST
@@ -119,6 +119,8 @@ AC_STRUCT_TM
 AC_TYPE_UID_T
 unet_CHECK_TYPE_SIZES
 AC_CHECK_TYPE(socklen_t, unsigned int)
+AC_CHECK_TYPE(struct sockaddr_in6, [unet_have_sockaddr_in6="yes"], [unet_have_sockaddr_in6="no"], [#include <sys/types.h>
+#include <netinet/in.h>])
 
 dnl Checks for library functions.
 AC_CHECK_FUNCS([kqueue setrlimit getrusage times])
@@ -135,13 +137,34 @@ AC_PROG_AWK
 AC_PROG_MAKE_SET
 AC_PROG_INSTALL
 AC_PROG_LN_S
-AC_PROG_LEX
-AC_PROG_YACC
 AC_PATH_PROGS(RMPROG, rm, /bin/rm)
 AC_PATH_PROGS(SHPROG, sh, /bin/sh)
 
+dnl (F)LEX - needed for the new conf file parser
+AC_PROG_LEX
+if test -x "$LEX"
+then 
+  AC_MSG_ERROR([Cannot find flex.])
+fi
+
+if test -z "$LEXLIB"
+then
+  AC_MSG_FAILURE([
+  Cannot find a library with yywrap() in, but flex was found.  
+  It's possible the compiler you're using ($CC) is incompatible with the 
+  installed library.])
+fi
+
 LIBS="$LEXLIB $LIBS"
 
+dnl YACC - ditto
+AC_PROG_YACC
+if test -z "$YACC"
+then
+  AC_MSG_ERROR([Cannot find yacc.])
+fi
+
+
 unet_NONBLOCKING
 unet_SIGNALS
 
@@ -255,6 +278,15 @@ if test x"$unet_cv_with_leak_detect" != xno; then
     fi
 fi
 
+AC_ARG_WITH([ipv6],
+    AS_HELP_STRING([--without-ipv6], [disable IPv6 support (default is autodetect)]),
+    [ac_cv_use_ipv6=$withval],
+    [ac_cv_use_ipv6=$unet_have_sockaddr_in6])
+AC_CACHE_CHECK([whether to use IPv6], [ac_cv_use_ipv6], [ac_cv_use_ipv6=no])
+if test x"$ac_cv_use_ipv6" != "xno" ; then
+    AC_DEFINE([IPV6], , [Enable IPv6 support])
+fi
+
 dnl And now for --disable-asserts
 AC_MSG_CHECKING([whether to enable asserts])
 AC_ARG_ENABLE([asserts],
@@ -713,7 +745,7 @@ AC_DEFINE_UNQUOTED(MAXCONNECTIONS, $unet_cv_with_maxcon,
 [Maximum number of network connections])
 
 dnl Finally really generate all output files:
-AC_OUTPUT(Makefile ircd/Makefile doc/Makefile, [echo timestamp > stamp-h])
+AC_OUTPUT(Makefile ircd/Makefile ircd/test/Makefile doc/Makefile, [echo timestamp > stamp-h])
 
 dnl Report configuration
 AC_OUTPUT_COMMANDS([echo "