]> jfr.im git - solanum.git/blobdiff - librb/configure.ac
m_sasl: fix coding style
[solanum.git] / librb / configure.ac
index b1f4c484a11f6268957dc0caddf580d01fb353e9..9565cd9d65f6cc3e037b73ba3735f4660557d48a 100644 (file)
@@ -1,4 +1,3 @@
-dnl $Id: configure.ac 26260 2008-12-10 04:08:39Z androsyn $
 dnl Process this file with autoconf to produce a configure script.
 
 dnl TODO: clean up all the OpenSSL and shared module checking stuff;
@@ -8,21 +7,20 @@ dnl said functions need to be just about as complex as they already are.
 AC_PREREQ(2.63)
 AUTOMAKE_OPTIONS = 1.10
 dnl Sneaky way to get an Id tag into the configure script
-AC_COPYRIGHT([$Id: configure.ac 26260 2008-12-10 04:08:39Z androsyn $])
-AC_INIT([libratbox],[devel])
+AC_INIT([librb],[devel])
 AM_INIT_AUTOMAKE([subdir-objects])
 AM_SILENT_RULES([yes])
 
-AM_CONFIG_HEADER(include/libratbox_config.h)
+AM_CONFIG_HEADER(include/librb_config.h)
 
-AC_PREFIX_DEFAULT(/usr/local/libratbox)
+AC_PREFIX_DEFAULT(/usr/local/librb)
 AC_GNU_SOURCE
 
 dnl Checks for programs.
 AC_PROG_CC_C99
 
 if test x"$ac_cv_prog_cc_c99" = "xno"; then
-       AC_ERROR([ircd-ratbox requires a C99 capable compiler])
+       AC_ERROR([charybdis requires a C99 capable compiler])
 fi
 
 
@@ -64,7 +62,7 @@ case "$host_os" in
      AC_DEFINE_UNQUOTED(CYGWIN,1,[This is a Cygwin system])
      AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system])
      ;;
-*mingw*)
+*mingw* | *msys*)
      AC_DEFINE_UNQUOTED(MINGW,1,[This is a MinGW system])
      AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system])
      AC_CHECK_HEADER(windows.h, , [AC_MSG_ERROR([** MinGW and no windows.h.  I give up.])])
@@ -106,7 +104,7 @@ AC_TYPE_UID_T
 dnl Checks for header files.
 AC_HEADER_STDC
 
-AC_CHECK_HEADERS([crypt.h unistd.h sys/socket.h sys/stat.h sys/time.h time.h netinet/in.h arpa/inet.h errno.h sys/uio.h spawn.h sys/poll.h sys/epoll.h sys/select.h sys/devpoll.h sys/event.h port.h signal.h sys/signalfd.h sys/timerfd.h linux/tcp.h])
+AC_CHECK_HEADERS([crypt.h unistd.h sys/socket.h sys/stat.h sys/time.h time.h netinet/in.h netinet/tcp.h arpa/inet.h errno.h sys/uio.h spawn.h sys/poll.h sys/epoll.h sys/select.h sys/devpoll.h sys/event.h port.h signal.h sys/signalfd.h sys/timerfd.h])
 AC_HEADER_TIME
 
 dnl Networking Functions
@@ -146,6 +144,7 @@ AC_CHECK_TYPE([socklen_t], rb_cv_socklen_t=socklen_t,[
 #endif
 #ifdef HAVE_WINSOCK2_H
 #include <winsock2.h>
+#include <ws2tcpip.h>
 #endif
 int getpeername (int, $arg2 *, $t *);
 ],[
@@ -203,7 +202,7 @@ AC_CHECK_TYPES([struct sockaddr_storage],[
 
 
 dnl Check for stdarg.h - if we cant find it, halt configure
-AC_CHECK_HEADER(stdarg.h, , [AC_MSG_ERROR([** stdarg.h could not be found - libratbox will not compile without it **])])
+AC_CHECK_HEADER(stdarg.h, , [AC_MSG_ERROR([** stdarg.h could not be found - librb will not compile without it **])])
 
 AC_CHECK_TYPE([sa_family_t], [],
 [AC_DEFINE(sa_family_t, [u_int16_t], [If system does not define sa_family_t, define it here.])],
@@ -212,8 +211,9 @@ AC_CHECK_TYPE([sa_family_t], [],
 
 
 dnl check for various functions...
-AC_CHECK_FUNCS([snprintf vsnprintf socketpair gettimeofday writev sendmsg gmtime_r strtok_r usleep posix_spawn strlcpy strlcat strnlen fstat signalfd select poll kevent port_create epoll_ctl arc4random getrusage timerfd_create])   
+AC_CHECK_FUNCS([snprintf vsnprintf socketpair gettimeofday writev sendmsg gmtime_r strtok_r usleep posix_spawn getexecname strlcpy strlcat strnlen strcasestr strcasecmp strncasecmp fstat signalfd select poll kevent port_create epoll_ctl arc4random getrusage timerfd_create])     
 
+AC_SEARCH_LIBS(dlinfo, dl, AC_DEFINE(HAVE_DLINFO, 1, [Define if you have dlinfo]))
 AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP, 1, [Define if you have nanosleep]))
 AC_SEARCH_LIBS(timer_create, rt, AC_DEFINE(HAVE_TIMER_CREATE, 1, [Define if you have timer_create]))
 RB_CHECK_TIMER_CREATE
@@ -439,7 +439,7 @@ if test "$profile" = yes; then
        if test "$ac_cv_c_compiler_gnu" = yes; then
                CFLAGS="$CFLAGS -pg -static"
                AC_MSG_RESULT([yes, adding -pg -static])
-               AC_DEFINE(RATBOX_PROFILE, 1, [Defined to mark profiling is enabled])
+               AC_DEFINE(RB_PROFILE, 1, [Defined to mark profiling is enabled])
        else
                AC_MSG_RESULT([no, profile builds only work with gcc])
        fi
@@ -463,7 +463,7 @@ AC_SUBST(MBEDTLS_CFLAGS)
 AC_SUBST(MBEDTLS_LIBS)
 
 if test "$prefix" = "NONE"; then
-       AC_DEFINE_UNQUOTED(RB_PREFIX, "$ac_default_prefix", [Prefix where libratbox is installed.])
+       AC_DEFINE_UNQUOTED(RB_PREFIX, "$ac_default_prefix", [Prefix where librb is installed.])
 
 else
 
@@ -471,7 +471,7 @@ dnl Don't get bitten by Cygwin's stupidity if the user specified
 dnl a custom prefix with a trailing slash
 
        prefix=`echo $prefix | sed 's/\/$//'`
-       AC_DEFINE_UNQUOTED(RB_PREFIX, "$prefix", [Prefix where libratbox is installed.])
+       AC_DEFINE_UNQUOTED(RB_PREFIX, "$prefix", [Prefix where librb is installed.])
 
 fi
 
@@ -482,7 +482,7 @@ AC_CONFIG_COMMANDS([include/librb-config.h],
        outfile=include/librb-config.h.tmp
        cat > $outfile  <<\_______EOF
 /*
- * librb-config.h: libratbox config file. Please modify configure.ac
+ * librb-config.h: librb config file. Please modify configure.ac
  */
 
 #ifndef __LIBRB_CONFIG_H
@@ -498,6 +498,7 @@ if test "x$rb_windows_h" = "xyes"; then
        echo '#define WIN32_LEAN_AND_MEAN 1' >> $outfile
        echo '#include <windows.h>' >> $outfile
        echo '#include <winsock2.h>' >> $outfile
+       echo '#include <ws2tcpip.h>' >> $outfile
        echo '#include <iphlpapi.h>' >> $outfile
 fi
 
@@ -545,6 +546,10 @@ if test "x$rb_netinet_in_h" = "xyes"; then
        echo '#include <netinet/in.h>' >> $outfile
 fi
 
+if test "x$rb_netinet_tcp_h" == "xyes"; then
+       echo '#include <netinet/tcp.h>' >> $outfile
+fi
+
 if test "x$rb_arpa_inet_h" = "xyes"; then
        echo '#include <arpa/inet.h>' >> $outfile
 fi
@@ -631,6 +636,9 @@ fi
        if test x$ac_cv_header_netinet_in_h = xyes; then
                rb_netinet_in_h=yes
        fi
+       if test x$ac_cv_header_netinet_tcp_h = xyes; then
+               rb_netinet_tcp_h=yes
+       fi
 
        if test x$ac_cv_header_crypt_h = xyes; then
                rb_crypt_h=yes