]> jfr.im git - solanum.git/blobdiff - librb/configure.ac
Combine stats A output parameters (#35)
[solanum.git] / librb / configure.ac
index 0e434c930699110ef8b0ca9e836625ddab5c58f9..f44d8443c8f1384b27aab66c1a46891dd9a6ebe1 100644 (file)
@@ -20,7 +20,7 @@ dnl Checks for programs.
 AC_PROG_CC_C99
 
 if test x"$ac_cv_prog_cc_c99" = "xno"; then
-       AC_ERROR([charybdis requires a C99 capable compiler])
+       AC_ERROR([solanum requires a C99 capable compiler])
 fi
 
 
@@ -62,8 +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*)
-*msys*)
+*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.])])
@@ -105,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 netinet/sctp.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
@@ -173,27 +172,6 @@ rb_socklen_t=$rb_cv_socklen_t
 
 
 
-AC_ARG_ENABLE(ipv6,AC_HELP_STRING([--disable-ipv6],[Disable IPv6 support]),[ipv6=$enableval],[ipv6=yes])
-
-if test x$ipv6 != xyes; then
-       have_v6="no"
-else
-
-have_v6=yes
-RB_PROTO_INET6([], [
-               AC_MSG_NOTICE([Disabling IPv6 support: PF_INET6 not found])
-               have_v6=no
-               ])
-
-       if test "X$have_v6" = "Xyes"; then
-       RB_TYPE_STRUCT_SOCKADDR_IN6([], [
-               AC_MSG_NOTICE([Disabling IPv6 support: struct sockaddr_in6 not found])
-               have_v6=no
-               ])
-       fi
-
-fi
-
 AC_CHECK_TYPES([struct sockaddr_storage],[
        rb_have_sockaddr_storage=yes
         ],[], [
@@ -212,8 +190,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
@@ -352,9 +331,9 @@ if test "$cf_enable_mbedtls" != no; then
        save_LIBS="$LIBS"
        LIBS="$LIBS $MBEDTLS_LIBS"
        AC_CHECK_LIB(mbedtls, mbedtls_ssl_init, [
-               MBEDTLS_LIBS="$MBEDTLS_LIBS -lmbedtls -lmbedcrypto -lmbedx509"
+               MBEDTLS_LIBS="$MBEDTLS_LIBS -lmbedtls -lmbedx509 -lmbedcrypto"
                cf_enable_mbedtls=yes
-       ], [cf_enable_mbedtls=no], [-lmbedcrypto -lmbedx509])
+       ], [cf_enable_mbedtls=no], [-lmbedx509 -lmbedcrypto])
 fi
 
 dnl GnuTLS support
@@ -413,6 +392,27 @@ dnl End OpenSSL detection
 
 
 
+AC_ARG_WITH(sctp-path,
+AC_HELP_STRING([--with-sctp-path=DIR],[Path to libsctp.so for SCTP support.]),
+[LIBS="$LIBS -L$withval"],)
+
+AC_ARG_ENABLE(sctp,
+AC_HELP_STRING([--disable-sctp],[Disable SCTP support]),
+[sctp=$enableval],[sctp=yes])
+
+if test "$sctp" = yes; then
+
+AC_CHECK_HEADER(netinet/sctp.h, [
+       AC_CHECK_LIB(sctp, sctp_bindx,
+       [
+               AC_SUBST(LIBSCTP_LD, -lsctp)
+               AC_DEFINE(HAVE_LIBSCTP, 1, [Define to 1 if libsctp (-lsctp) is available.])
+       ], sctp=no)
+], sctp=no)
+
+fi
+
+
 
 dnl Debug-related options
 dnl =====================
@@ -449,7 +449,7 @@ fi
 
 AC_ARG_ENABLE(warnings,
 AC_HELP_STRING([--enable-warnings],[Enable all sorts of warnings for debugging.]),
-[CFLAGS="$CFLAGS -Wall -Werror -Wcast-qual -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings -W -Wno-unused -Wunused-function -Wunused-variable"],[])
+[CFLAGS="$CFLAGS -Wall -Werror -Wcast-qual -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings -W -Wno-unused -Wunused-function -Wunused-variable -Wno-unused-parameter"],[])
 
 AC_SUBST(LDFLAGS)
 AC_SUBST(PICFLAGS)
@@ -490,10 +490,6 @@ AC_CONFIG_COMMANDS([include/librb-config.h],
 
 _______EOF
 
-if test "x$rb_have_ipv6" = "xyes"; then
-       echo "#define RB_IPV6 1" >> $outfile
-fi
-
 if test "x$rb_windows_h" = "xyes"; then
        echo '#define WIN32_LEAN_AND_MEAN 1' >> $outfile
        echo '#include <windows.h>' >> $outfile
@@ -546,6 +542,14 @@ 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_netinet_sctp_h" == "xyes"; then
+       echo '#include <netinet/sctp.h>' >> $outfile
+fi
+
 if test "x$rb_arpa_inet_h" = "xyes"; then
        echo '#include <arpa/inet.h>' >> $outfile
 fi
@@ -632,6 +636,12 @@ 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_netinet_sctp_h = xyes; then
+               rb_netinet_sctp_h=yes
+       fi
 
        if test x$ac_cv_header_crypt_h = xyes; then
                rb_crypt_h=yes
@@ -657,8 +667,6 @@ fi
                rb_sockaddr_storage="no"
        fi
 
-       rb_have_ipv6="$have_v6"
-
        rb_mv="$MV"
        rb_rm="$RM"
 
@@ -684,7 +692,7 @@ echo
 
 echo "Installing into: $prefix"
 
-echo "IPv6 support ................... $have_v6"
 echo "Assert debugging ............... $assert"
 echo "SSL Type........................ $SSL_TYPE"
+echo "SCTP............................ $sctp"
 echo