diff options
author | Gert Doering <gert@greenie.muc.de> | 2015-04-27 21:27:21 +0200 |
---|---|---|
committer | Gert Doering <gert@greenie.muc.de> | 2015-05-23 21:35:59 +0200 |
commit | 403dc434d245e5df5ae262935aa2e7364547e260 (patch) | |
tree | 0bea3d5d8c7ff554c22e8e2364369cfbd454ea56 /configure.ac | |
parent | ac1cb5bfbb9e09e79fd737bc57999d968d77c5ad (diff) | |
download | openvpn-403dc434d245e5df5ae262935aa2e7364547e260.tar.gz openvpn-403dc434d245e5df5ae262935aa2e7364547e260.tar.xz openvpn-403dc434d245e5df5ae262935aa2e7364547e260.zip |
assume res_init() is always there.
Previously, the code tried to find res_init(), and on some systems
got it wrong in configure, silently not-using res_init(), leading
to unexpected failures to re-init the resolver.
We know that all supported OSes (except Windows) have res_init(), so
change the call to "#ifndef WIN32", and adjust configure.ac to just
find the library to link (if any). With that, failures to find
res_init() are no longer "hidden" but clearly visible at link time.
AC_SEARCH_LIBS() bits inspired by CUPS' cups_network.m4 (GPLv2)
Fix (part of) trac #523
Signed-off-by: Gert Doering <gert@greenie.muc.de>
Lazy-ACK-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1430162841-5840-1-git-send-email-gert@greenie.muc.de>
URL: http://article.gmane.org/gmane.network.openvpn.devel/9614
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac index 5dccfbb..54fe4f5 100644 --- a/configure.ac +++ b/configure.ac @@ -613,12 +613,6 @@ AC_SUBST([SOCKETS_LIBS]) old_LIBS="${LIBS}" LIBS="${LIBS} ${SOCKETS_LIBS}" AC_CHECK_FUNCS([sendmsg recvmsg inet_ntop inet_pton]) -AC_CHECK_FUNCS( - [res_init], - , - , - [[#include <resolv.h>]] -) # Windows use stdcall for winsock so we cannot auto detect these m4_define( [SOCKET_FUNCS], @@ -646,6 +640,11 @@ else fi LIBS="${old_LIBS}" +# we assume res_init() always exist, but need to find out *where*... +AC_SEARCH_LIBS(__res_init, resolv bind, , + AC_SEARCH_LIBS(res_9_init, resolv bind, , + AC_SEARCH_LIBS(res_init, resolv bind, , ))) + AC_ARG_VAR([TAP_CFLAGS], [C compiler flags for tap]) old_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} ${TAP_CFLAGS}" |