dnl We do this in multiple stages, because unlike Linux all the other operating systems really suck and don't include their own dependencies.
AC_HEADER_STDC
-AC_CHECK_HEADERS([stdbool.h syslog.h sys/file.h sys/ioctl.h sys/mman.h sys/param.h sys/resource.h sys/socket.h sys/time.h time.h sys/uio.h sys/wait.h netdb.h arpa/inet.h dirent.h])
+AC_CHECK_HEADERS([stdbool.h syslog.h sys/file.h sys/ioctl.h sys/mman.h sys/param.h sys/resource.h sys/socket.h sys/time.h time.h sys/uio.h sys/wait.h netdb.h arpa/inet.h dirent.h resolv.h])
AC_CHECK_HEADERS([net/if.h net/if_types.h linux/if_tun.h net/if_tun.h net/tun/if_tun.h net/if_tap.h net/tap/if_tap.h net/ethernet.h net/if_arp.h netinet/in_systm.h netinet/in.h netinet/in6.h netpacket/packet.h],
[], [], [#include "src/have.h"]
)
[], [], [#include "src/have.h"]
)
+AC_CHECK_DECLS([res_init], [], [], [
+ #include <netinet/in.h>
+ #include <resolv.h>
+])
+
AC_CACHE_SAVE
dnl These are defined in files in m4/
#include "route.h"
#include "subnet.h"
#include "xalloc.h"
-#include "resolv.h"
+
+#ifdef HAVE_RESOLV_H
+#include <resolv.h>
+#endif
bool do_purge = false;
volatile bool running = false;
avl_node_t *node;
logger(LOG_INFO, "Flushing event queue");
expire_events();
+#ifdef HAVE_DECL_RES_INIT
res_init();
+#endif
for(node = connection_tree->head; node; node = node->next) {
connection_t *c = node->data;
if(c->status.active)