]> jfr.im git - solanum.git/blobdiff - librb/configure.ac
Merge branch 'master' into release/4
[solanum.git] / librb / configure.ac
index 511ab467dd0fbc301162e692507bbd776ccf928c..0f5f3f5936c74957837ccaf96b1fb1d50048d002 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,7 +7,6 @@ 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([librb],[devel])
 AM_INIT_AUTOMAKE([subdir-objects])
 AM_SILENT_RULES([yes])
@@ -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 *);
 ],[
@@ -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
@@ -352,9 +352,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
@@ -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
@@ -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