5
5
# | (__| |_| | _ <| |___
6
6
# \___|\___/|_| \_\_____|
8
# Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
8
# Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
10
10
# This software is licensed as described in the file COPYING, which
11
11
# you should have received as part of this distribution. The terms
2317
dnl CURL_CHECK_FUNC_GAI_STRERROR
2318
dnl -------------------------------------------------
2319
dnl Verify if gai_strerror is available, prototyped,
2320
dnl and can be compiled. If all of these are true,
2321
dnl and usage has not been previously disallowed with
2322
dnl shell variable curl_disallow_gai_strerror, then
2323
dnl HAVE_GAI_STRERROR will be defined.
2325
AC_DEFUN([CURL_CHECK_FUNC_GAI_STRERROR], [
2326
AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
2327
AC_REQUIRE([CURL_INCLUDES_NETDB])dnl
2329
tst_links_gai_strerror="unknown"
2330
tst_proto_gai_strerror="unknown"
2331
tst_compi_gai_strerror="unknown"
2332
tst_allow_gai_strerror="unknown"
2334
AC_MSG_CHECKING([if gai_strerror can be linked])
2337
$curl_includes_winsock2
2338
$curl_includes_netdb
2340
if(0 != gai_strerror(0))
2344
AC_MSG_RESULT([yes])
2345
tst_links_gai_strerror="yes"
2348
tst_links_gai_strerror="no"
2351
if test "$tst_links_gai_strerror" = "yes"; then
2352
AC_MSG_CHECKING([if gai_strerror is prototyped])
2353
AC_EGREP_CPP([gai_strerror],[
2354
$curl_includes_winsock2
2355
$curl_includes_netdb
2357
AC_MSG_RESULT([yes])
2358
tst_proto_gai_strerror="yes"
2361
tst_proto_gai_strerror="no"
2365
if test "$tst_proto_gai_strerror" = "yes"; then
2366
AC_MSG_CHECKING([if gai_strerror is compilable])
2369
$curl_includes_winsock2
2370
$curl_includes_netdb
2372
if(0 != gai_strerror(0))
2376
AC_MSG_RESULT([yes])
2377
tst_compi_gai_strerror="yes"
2380
tst_compi_gai_strerror="no"
2384
if test "$tst_compi_gai_strerror" = "yes"; then
2385
AC_MSG_CHECKING([if gai_strerror usage allowed])
2386
if test "x$curl_disallow_gai_strerror" != "xyes"; then
2387
AC_MSG_RESULT([yes])
2388
tst_allow_gai_strerror="yes"
2391
tst_allow_gai_strerror="no"
2395
AC_MSG_CHECKING([if gai_strerror might be used])
2396
if test "$tst_links_gai_strerror" = "yes" &&
2397
test "$tst_proto_gai_strerror" = "yes" &&
2398
test "$tst_compi_gai_strerror" = "yes" &&
2399
test "$tst_allow_gai_strerror" = "yes"; then
2400
AC_MSG_RESULT([yes])
2401
AC_DEFINE_UNQUOTED(HAVE_GAI_STRERROR, 1,
2402
[Define to 1 if you have the gai_strerror function.])
2403
ac_cv_func_gai_strerror="yes"
2406
ac_cv_func_gai_strerror="no"
2318
2411
dnl CURL_CHECK_FUNC_GETHOSTBYADDR_R
2319
2412
dnl -------------------------------------------------