@@ -595,10 +595,13 @@ AC_DEFINE(OF_HAVE_LINK, 1, [Whether we have link()]) ]) AC_CHECK_FUNC(symlink, [ AC_DEFINE(OF_HAVE_SYMLINK, 1, [Whether we have symlink()]) ]) +AC_CHECK_FUNC(pipe, [ + AC_DEFINE(OF_HAVE_PIPE, 1, [Whether we have pipe()]) +]) AC_ARG_ENABLE(sockets, AS_HELP_STRING([--disable-sockets], [disable socket support])) AS_IF([test x"$enable_sockets" != x"no"], [ AC_DEFINE(OF_HAVE_SOCKETS, 1, [Whether we have sockets]) @@ -606,10 +609,16 @@ AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket") AC_CHECK_LIB(network, socket, LIBS="$LIBS -lnetwork") AC_CHECK_LIB(ws2_32, main, LIBS="$LIBS -lws2_32") + AC_CHECK_HEADER(sys/socket.h, [ + AC_DEFINE(OF_HAVE_SYS_SOCKET_H, 1, + [Whether we have sys/socket.h]) + ]) + AC_CHECK_HEADERS([netinet/in.h arpa/inet.h netdb.h]) + AC_CHECK_FUNC(kqueue, [ AC_DEFINE(HAVE_KQUEUE, 1, [Whether we have kqueue]) AC_SUBST(OFSTREAMOBSERVER_KQUEUE_M, "OFStreamObserver_kqueue.m") ]) AC_CHECK_HEADER(poll.h, [ @@ -618,10 +627,11 @@ ]) AC_CHECK_HEADER(sys/select.h, [ AC_DEFINE(HAVE_SYS_SELECT_H, 1, [Whether we have sys/select.h]) AC_SUBST(OFSTREAMOBSERVER_SELECT_M, "OFStreamObserver_select.m") ]) + case "$host_os" in mingw*) AC_SUBST(OFSTREAMOBSERVER_SELECT_M, "OFStreamObserver_select.m") ;; @@ -699,16 +709,19 @@ ]) AS_IF([test x"$have_threadsafe_getaddrinfo" = x"yes"], [ AC_DEFINE(HAVE_THREADSAFE_GETADDRINFO, 1, [Whether getaddrinfo is thread-safe]) + ], [ + AC_CHECK_FUNCS([h_errno hstrerror]) ]) AC_MSG_RESULT($have_threadsafe_getaddrinfo) ]) ], [ AC_MSG_RESULT(no) + AC_CHECK_FUNCS([h_errno hstrerror]) ]) ]) AS_IF([test x"$enable_sockets" != x"no" -a x"$enable_threads" != x"no"], [ AC_SUBST(OFHTTPCLIENTTESTS_M, "OFHTTPClientTests.m") @@ -717,11 +730,11 @@ case "$host" in *-*-mingw*) have_processes="yes" ;; *) - AC_CHECK_FUNCS([fork pipe dup2 execvp kill], [ + AC_CHECK_FUNCS([fork dup2 execvp kill], [ if test x"$ac_cv_func_fork" = x"yes" \ -a x"$ac_cv_func_pipe" = x"yes" \ -a x"$ac_cv_func_dup2" = x"yes" \ -a x"$ac_cv_func_execvp" = x"yes" \ -a x"$ac_cv_func_kill" = x"yes"; then