mirror of
https://github.com/curl/curl.git
synced 2026-08-24 22:13:33 +03:00
Added a check that 'localhost' resolves before the gethostbyname_r() checks,
as they depend on the resolving of that name. It seems this mistake is happening from time to time and people have a hard time finding out why configure can't detect their gethostbyname_r()-setup.
This commit is contained in:
parent
217e033120
commit
116462a512
1 changed files with 28 additions and 1 deletions
29
configure.in
29
configure.in
|
|
@ -64,8 +64,32 @@ AC_ARG_ENABLE(debug,
|
|||
AC_MSG_RESULT(no)
|
||||
)
|
||||
|
||||
dnl ************************************************************
|
||||
dnl check for "localhost", if it doesn't exist, we can't do the
|
||||
dnl gethostbyname_r tests!
|
||||
dnl
|
||||
|
||||
dnl
|
||||
AC_DEFUN(CURL_CHECK_WORKING_RESOLVER,[
|
||||
AC_MSG_CHECKING([if "localhost" resolves])
|
||||
AC_TRY_RUN([
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <netdb.h>
|
||||
|
||||
int
|
||||
main () {
|
||||
struct hostent *h;
|
||||
h = gethostbyname("localhost");
|
||||
exit (h == NULL ? 1 : 0); }],[
|
||||
AC_MSG_RESULT(yes)],[
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_ERROR([can't figure out gethostbyname_r() since localhost doesn't resolve])
|
||||
|
||||
]
|
||||
)
|
||||
])
|
||||
|
||||
dnl ************************************************************
|
||||
dnl check for working getaddrinfo()
|
||||
dnl
|
||||
AC_DEFUN(CURL_CHECK_WORKING_GETADDRINFO,[
|
||||
|
|
@ -681,6 +705,9 @@ then
|
|||
Set to explicitly specify we don't want to use thread-safe functions)
|
||||
else
|
||||
|
||||
dnl check that 'localhost' resolves first
|
||||
CURL_CHECK_WORKING_RESOLVER
|
||||
|
||||
dnl dig around for gethostbyname_r()
|
||||
CURL_CHECK_GETHOSTBYNAME_R()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue