1
1
dnl Disable Windows DNSAPI
2
2
AC_SUBST ( MONGOC_HAVE_DNSAPI , 0 )
3
3
4
- need_libresolv ="no"
4
+ found_resolv ="no"
5
5
6
6
old_LIBS="$LIBS"
7
- dnl On AIX, resolv functions are in libc.
8
- if test "x$os_aix" = "xno"; then
7
+
8
+ dnl Link libresolv for detection (note: on AIX, resolv functions are in libc)
9
+ if test "$os_aix" != "yes"; then
9
10
LIBS="$LIBS -lresolv"
10
11
fi
11
12
@@ -28,6 +29,8 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
28
29
AC_SUBST ( MONGOC_HAVE_RES_SEARCH , 0 )
29
30
AC_SUBST ( MONGOC_HAVE_RES_NSEARCH , 1 )
30
31
32
+ found_resolv="yes"
33
+
31
34
dnl We have res_nsearch. Call res_ndestroy (BSD/Mac) or res_nclose (Linux)?
32
35
AC_MSG_CHECKING ( [ for res_ndestroy] )
33
36
AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ [
@@ -82,9 +85,8 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
82
85
] ] ) ] , [
83
86
AC_MSG_RESULT ( [ yes] )
84
87
AC_SUBST ( MONGOC_HAVE_RES_SEARCH , 1 )
85
- if test "x$os_aix" = "xno"; then
86
- need_libresolv="yes"
87
- fi
88
+
89
+ found_resolv="yes"
88
90
] , [
89
91
AC_MSG_RESULT ( [ no] )
90
92
AC_SUBST ( MONGOC_HAVE_RES_SEARCH , 0 )
@@ -93,6 +95,7 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
93
95
94
96
LIBS="$old_LIBS"
95
97
96
- AS_IF ( [ test "$need_libresolv" = "yes"] ,[
98
+ dnl Link libresolv if needed (note: on AIX, resolv functions are in libc)
99
+ AS_IF ( [ test "$found_resolv" = "yes" -a "$os_aix" != "yes"] ,[
97
100
PHP_ADD_LIBRARY([ resolv] ,,[ MONGODB_SHARED_LIBADD] )
98
101
] )
0 commit comments