linux-config-h-died-20061109
[openafs.git] / src / cf / ressearch.m4
1 AC_DEFUN([AC_FUNC_RES_SEARCH], [
2   ac_cv_func_res_search=no
3   AC_TRY_LINK([
4 #include <sys/types.h>
5 #include <netinet/in.h>
6 #include <arpa/nameser.h>
7 #ifdef HAVE_ARPA_NAMESER_COMPAT_H
8 #include <arpa/nameser_compat.h>
9 #endif
10 #include <resolv.h>],
11   [
12 const char host[11]="openafs.org";
13 u_char ans[1024];
14 int r;
15 res_init();
16 /* Capture result in r but return 0, since a working nameserver is
17  * not a requirement for compilation.
18  */
19 r =  res_search( host, C_IN, T_MX, (u_char *)&ans, sizeof(ans));
20 return 0;
21   ],
22   ac_cv_func_res_search=yes)
23 ])