Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Check for AI_ADDRCONFIG existence in ./configure

Thanks to fred for reporting this.
  • Loading branch information...
commit 1d3ea7c68ba3545f3b14e7aee0680f182e303253 1 parent ff0a8bc
Alexey Sokolov DarthGandalf authored
Showing with 28 additions and 8 deletions.
  1. +28 −8 configure.ac
36 configure.ac
View
@@ -202,22 +202,42 @@ AC_SEARCH_LIBS([dlopen], [dl], [],
# ----- Check for pthreads
+DNS_TEXT=blocking
if test "x$TDNS" != "xno"; then
old_TDNS=$TDNS
AX_PTHREAD([
- TDNS=yes
+ AC_MSG_CHECKING([whether getaddrinfo() supports AI_ADDRCONFIG])
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([[
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netdb.h>
+ ]], [[
+ int x = AI_ADDRCONFIG;
+ ]])
+ ], [
+ AC_MSG_RESULT([yes])
+ TDNS=yes
+ ], [
+ AC_MSG_RESULT([no])
+ TDNS=no
+ # Note that broken systems, such as OpenBSD, NetBSD, which don't support AI_ADDRCONFIG,
+ # also have thread-unsafe getaddrinfo().
+ ])
+ ], [
+ TDNS=no
+ ])
+ if test "x$TDNS" = "xyes"; then
DNS_TEXT=threads
AC_DEFINE([HAVE_THREADED_DNS], [1], [Define if threaded DNS is enabled])
appendCXX "$PTHREAD_CFLAGS"
appendLib "$PTHREAD_LIBS"
- ], [
- TDNS=no
- DNS_TEXT=blocking
+ else
ZNC_AUTO_FAIL([TDNS],
- [threads not found. Try --disable-tdns.
-Disabling threads may result in a slight performance decrease but will not have any other side-effects],
- [threads not found, so DNS resolving will be blocking])
- ])
+ [support for threaded DNS not found. Try --disable-tdns.
+Disabling it may result in a slight performance decrease but will not have any other side-effects],
+ [support for threaded DNS not found, so DNS resolving will be blocking])
+ fi
fi
# ----- Check for openssl
Please sign in to comment.
Something went wrong with that request. Please try again.