Skip to content

Commit 7199c4e

Browse files
committed
Merged pull request #895
2 parents 4020199 + 394eb79 commit 7199c4e

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

scripts/autotools/libmongoc/CheckResolv.m4

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,52 +7,52 @@ old_LIBS="$LIBS"
77
LIBS="$LIBS -lresolv"
88

99
dnl Thread-safe DNS query function for _mongoc_client_get_srv.
10-
dnl Could be a macro, not a function, so check with AC_TRY_LINK.
10+
dnl Could be a macro, not a function, so check with AC_LINK_IFELSE.
1111
AC_MSG_CHECKING([for res_nsearch])
12-
AC_TRY_LINK([
12+
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1313
#include <sys/types.h>
1414
#include <netinet/in.h>
1515
#include <arpa/nameser.h>
1616
#include <resolv.h>
17-
],[
17+
]], [[
1818
int len;
1919
unsigned char reply[1024];
2020
res_state statep;
2121
len = res_nsearch(
2222
statep, "example.com", ns_c_in, ns_t_srv, reply, sizeof(reply));
23-
],[
23+
]])], [
2424
AC_MSG_RESULT([yes])
2525
AC_SUBST(MONGOC_HAVE_RES_SEARCH, 0)
2626
AC_SUBST(MONGOC_HAVE_RES_NSEARCH, 1)
2727
found_resolv="yes"
2828
2929
dnl We have res_nsearch. Call res_ndestroy (BSD/Mac) or res_nclose (Linux)?
3030
AC_MSG_CHECKING([for res_ndestroy])
31-
AC_TRY_LINK([
31+
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
3232
#include <sys/types.h>
3333
#include <netinet/in.h>
3434
#include <arpa/nameser.h>
3535
#include <resolv.h>
36-
],[
36+
]], [[
3737
res_state statep;
3838
res_ndestroy(statep);
39-
], [
39+
]])], [
4040
AC_MSG_RESULT([yes])
4141
AC_SUBST(MONGOC_HAVE_RES_NDESTROY, 1)
4242
AC_SUBST(MONGOC_HAVE_RES_NCLOSE, 0)
4343
], [
4444
AC_MSG_RESULT([no])
4545
AC_SUBST(MONGOC_HAVE_RES_NDESTROY, 0)
4646
AC_MSG_CHECKING([for res_nclose])
47-
AC_TRY_LINK([
47+
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
4848
#include <sys/types.h>
4949
#include <netinet/in.h>
5050
#include <arpa/nameser.h>
5151
#include <resolv.h>
52-
],[
52+
]], [[
5353
res_state statep;
5454
res_nclose(statep);
55-
], [
55+
]])], [
5656
AC_MSG_RESULT([yes])
5757
AC_SUBST(MONGOC_HAVE_RES_NCLOSE, 1)
5858
], [
@@ -68,16 +68,16 @@ AC_TRY_LINK([
6868
6969
dnl Thread-unsafe function.
7070
AC_MSG_CHECKING([for res_search])
71-
AC_TRY_LINK([
71+
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
7272
#include <sys/types.h>
7373
#include <netinet/in.h>
7474
#include <arpa/nameser.h>
7575
#include <resolv.h>
76-
],[
76+
]], [[
7777
int len;
7878
unsigned char reply[1024];
7979
len = res_search("example.com", ns_c_in, ns_t_srv, reply, sizeof(reply));
80-
], [
80+
]])], [
8181
AC_MSG_RESULT([yes])
8282
AC_SUBST(MONGOC_HAVE_RES_SEARCH, 1)
8383
found_resolv="yes"

0 commit comments

Comments
 (0)