@@ -158,14 +158,38 @@ AC_CHECK_LIB(resolv, inet_aton, , , [-lnsl -lsocket])
158
158
# only thing for it is to include resolv.h, don't redeclare res_ninit(),
159
159
# and use the proper type signature when calling it.
160
160
m4_rename ( [ AC_LANG_CALL] , [ saved_AC_LANG_CALL] )
161
- m4_define ( [ AC_LANG_CALL] , [ AC_LANG_PROGRAM ( [ #include <resolv.h>] ,
161
+ m4_define ( [ AC_LANG_CALL] , [ AC_LANG_PROGRAM ( [ #ifdef HAVE_SYS_TYPES_H
162
+ # include <sys/types.h>
163
+ #endif
164
+ #ifdef HAVE_NETINET_IN_H
165
+ # include <netinet/in.h> /* inet_ functions / structs */
166
+ #endif
167
+ #ifdef HAVE_ARPA_NAMESER_H
168
+ # include <arpa/nameser.h> /* DNS HEADER struct */
169
+ #endif
170
+ #ifdef HAVE_NETDB_H
171
+ # include <netdb.h>
172
+ #endif
173
+ #include <resolv.h>] ,
162
174
[ return res_ninit(NULL);] ) ] )
163
175
AC_SEARCH_LIBS ( res_ninit , resolv ,
164
176
AC_DEFINE ( HAVE_RES_NINIT , 1 ,
165
177
[ Define to 1 if you have the `res_ninit()' function.] ) )
166
178
167
179
# Same as above, but for res_ndestroy.
168
- m4_define ( [ AC_LANG_CALL] , [ AC_LANG_PROGRAM ( [ #include <resolv.h>] ,
180
+ m4_define ( [ AC_LANG_CALL] , [ AC_LANG_PROGRAM ( [ #ifdef HAVE_SYS_TYPES_H
181
+ # include <sys/types.h>
182
+ #endif
183
+ #ifdef HAVE_NETINET_IN_H
184
+ # include <netinet/in.h> /* inet_ functions / structs */
185
+ #endif
186
+ #ifdef HAVE_ARPA_NAMESER_H
187
+ # include <arpa/nameser.h> /* DNS HEADER struct */
188
+ #endif
189
+ #ifdef HAVE_NETDB_H
190
+ # include <netdb.h>
191
+ #endif
192
+ #include <resolv.h>] ,
169
193
[ res_ndestroy(NULL);] ) ] )
170
194
AC_SEARCH_LIBS ( res_ndestroy , resolv ,
171
195
AC_DEFINE ( HAVE_RES_NDESTROY , 1 ,
0 commit comments