Author: hikari <hikari@undernet.org>
[ircu2.10.12-pk.git] / configure.in
index 35a68eff75c885731c7b797f1d7ec7d7968bf9e2..3244abcaee63f9fec2789dbc102dcdcab2b3064a 100644 (file)
@@ -106,14 +106,9 @@ AC_SEARCH_LIBS(crypt, descrypt crypt, ,
 dnl Do all the checks necessary to figure out -lnsl / -lsocket stuff
 AC_LIBRARY_NET
 
-dnl Look for res_mkquery.  Done after AC_LIBRARY_NET in case res_mkquery
-dnl is in one of those libraries somewhere.
-AC_SEARCH_LIBS(res_mkquery, resolv, ,
-[AC_MSG_ERROR([Unable to find library containing res_mkquery()])])
-
 dnl Checks for header files.
 AC_HEADER_STDC
-AC_CHECK_HEADERS(poll.h sys/devpoll.h sys/epoll.h sys/event.h)
+AC_CHECK_HEADERS(crypt.h poll.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
@@ -123,6 +118,9 @@ AC_HEADER_TIME
 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])
@@ -142,6 +140,31 @@ AC_PROG_LN_S
 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
 
@@ -154,7 +177,6 @@ case "$host" in
     *-linux*)
        AC_MSG_RESULT([Linux ($host) found.])
        unet_poll_syscall=yes
-       OSDEP_C=os_linux.c
        ;;
 
     *-solaris*)
@@ -164,13 +186,11 @@ case "$host" in
        else
            unet_poll_syscall=no
        fi
-       OSDEP_C=os_solaris.c
        ;;
 
     *-sunos*)
        AC_MSG_RESULT([Solaris ($host) found.])
        unet_poll_syscall=no
-       OSDEP_C=os_solaris.c
        ;;
 
     *-openbsd*)
@@ -180,7 +200,6 @@ case "$host" in
        else
            unet_poll_syscall=no
        fi
-       OSDEP_C=os_openbsd.c
        ;;
 
     *-*bsd*)
@@ -190,23 +209,19 @@ case "$host" in
        else
            unet_poll_syscall=no
        fi
-       OSDEP_C=os_bsd.c
        ;;
 
     *-darwin*)
        AC_MSG_RESULT([Darwin (Mac OS X) ($host) found.])
        unet_poll_syscall=no
-       OSDEP_C=os_bsd.c
        ;;
 
     *)
        AC_MSG_RESULT([Unknown system type $host found.])
        AC_MSG_WARN([Unknown OS type; using generic routines.])
        unet_poll_syscall=no
-       OSDEP_C=os_generic.c
        ;;
 esac
-AC_SUBST(OSDEP_C)
 
 dnl Check user configuration options
 dnl Start with --enable-poll
@@ -263,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],
@@ -405,33 +429,24 @@ if test x"$unet_cv_enable_epoll" != xno; then
     ENGINE_C="engine_epoll.c $ENGINE_C"
 fi
 
-dnl --disable-adns check...
-AC_MSG_CHECKING([whether to enable the adns resolver engine])
-AC_ARG_ENABLE([adns],
-[  --disable-adns          Disable adns resolver],
-[unet_cv_enable_adns=$enable_adns],
-[AC_CACHE_VAL(unet_cv_enable_adns,
-[unet_cv_enable_adns=yes])])
-
-AC_MSG_RESULT([$unet_cv_enable_adns])
-
-if test x"$unet_cv_enable_adns" != xno; then
-    AC_DEFINE([USE_ADNS], , [Define to enable the adns resolver])
-    AC_CONFIG_SUBDIRS([adns])
-    RES_C="res_adns.c"
-    LIBS="../adns/src/libadns.a $LIBS"
-    ADNS_SUBDIR="adns"
-else
-    RES_C="res_libresolv.c"
-    ADNS_SUBDIR=""
+dnl How to copy one va_list to another?
+AC_CACHE_CHECK([for va_copy], unet_cv_c_va_copy, [AC_LINK_IFELSE(
+  [AC_LANG_PROGRAM([#include <stdarg.h>], [va_list ap1, ap2; va_copy(ap1, ap2);])],
+  [unet_cv_c_va_copy="yes"],
+  [unet_cv_c_va_copy="no"]
+)])
+if test "$unet_cv_c_va_copy" = "yes" ; then
+  AC_DEFINE(HAVE_VA_COPY, 1, [Define if we have va_copy])
+fi
 
-    dnl Look for res_mkquery.  Done after AC_LIBRARY_NET in case res_mkquery
-    dnl is in one of those libraries somewhere.
-    AC_SEARCH_LIBS(res_mkquery, resolv, ,
-    [AC_MSG_ERROR([Unable to find library containing res_mkquery()])])
+AC_CACHE_CHECK([for __va_copy], unet_cv_c___va_copy, [AC_LINK_IFELSE(
+  [AC_LANG_PROGRAM([#include <stdarg.h>], [va_list ap1, ap2; __va_copy(ap1, ap2);])],
+  [unet_cv_c___va_copy="yes"],
+  [unet_cv_c___va_copy="no"]
+)])
+if test "$unet_cv_c___va_copy" = "yes" ; then
+  AC_DEFINE(HAVE___VA_COPY, 1, [Define if we have __va_copy])
 fi
-AC_SUBST(RES_C)
-AC_SUBST(ADNS_SUBDIR)
 
 dnl --with-symlink lets us set the name of the symlink; defaults to "ircd"
 AC_MSG_CHECKING([what name to give the symlink])
@@ -709,6 +724,9 @@ AC_DEFINE_UNQUOTED(LPATH, "$unet_lpath", [Path to debugging log file])
 
 dnl --with-maxcon allows us to set the maximum connections
 unet_maxcon=`ulimit -Hn`
+if test x"$unet_maxcon" = xunlimited; then
+    unet_maxcon=`ulimit -Sn`
+fi
 unet_maxcon=`expr $unet_maxcon - 4`
 AC_MSG_CHECKING([max connections])
 AC_ARG_WITH([maxcon],
@@ -739,18 +757,17 @@ ircu is now hopefully configured for your system.
   Warnings:            $unet_cv_enable_warnings
   Debug:               $unet_cv_enable_debug
   Profile:             $unet_cv_enable_profile
-  Head-in-sand:        $unet_cv_enable_headinsand
-  ADNS:                $unet_cv_enable_adns
   Owner/mode:          $unet_cv_with_owner.$unet_cv_with_group ($unet_cv_with_mode)
   Chroot:              $unet_cv_with_chroot
-  
+
   Domain:              $unet_cv_with_domain
   DPath:               $unet_cv_with_dpath
   CPath:               $unet_cv_with_cpath
   LPath:               $unet_cv_with_lpath
   Maximum connections: $unet_cv_with_maxcon
-  
+
   poll() engine:       $unet_cv_enable_poll
   kqueue() engine:     $unet_cv_enable_kqueue
   /dev/poll engine:    $unet_cv_enable_devpoll
+  epoll() engine:      $unet_cv_enable_epoll
 "])