mirror of
https://github.com/curl/curl.git
synced 2026-08-12 03:50:52 +03:00
configure/cmake: remove checks for unused gethostbyaddr and gethostbyaddr_r
Closes #7276
This commit is contained in:
parent
f471efa78c
commit
6f5ff0ee04
16 changed files with 5 additions and 408 deletions
|
|
@ -2136,245 +2136,6 @@ AC_DEFUN([CURL_CHECK_FUNC_GETADDRINFO], [
|
|||
])
|
||||
|
||||
|
||||
dnl CURL_CHECK_FUNC_GETHOSTBYADDR
|
||||
dnl -------------------------------------------------
|
||||
dnl Verify if gethostbyaddr is available, prototyped,
|
||||
dnl and can be compiled. If all of these are true,
|
||||
dnl and usage has not been previously disallowed with
|
||||
dnl shell variable curl_disallow_gethostbyaddr, then
|
||||
dnl HAVE_GETHOSTBYADDR will be defined.
|
||||
|
||||
AC_DEFUN([CURL_CHECK_FUNC_GETHOSTBYADDR], [
|
||||
AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
|
||||
AC_REQUIRE([CURL_INCLUDES_NETDB])dnl
|
||||
#
|
||||
tst_links_gethostbyaddr="unknown"
|
||||
tst_proto_gethostbyaddr="unknown"
|
||||
tst_compi_gethostbyaddr="unknown"
|
||||
tst_allow_gethostbyaddr="unknown"
|
||||
#
|
||||
AC_MSG_CHECKING([if gethostbyaddr can be linked])
|
||||
AC_LINK_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
$curl_includes_winsock2
|
||||
$curl_includes_bsdsocket
|
||||
$curl_includes_netdb
|
||||
]],[[
|
||||
if(0 != gethostbyaddr(0, 0, 0))
|
||||
return 1;
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
tst_links_gethostbyaddr="yes"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
tst_links_gethostbyaddr="no"
|
||||
])
|
||||
#
|
||||
if test "$tst_links_gethostbyaddr" = "yes"; then
|
||||
AC_MSG_CHECKING([if gethostbyaddr is prototyped])
|
||||
AC_EGREP_CPP([gethostbyaddr],[
|
||||
$curl_includes_winsock2
|
||||
$curl_includes_bsdsocket
|
||||
$curl_includes_netdb
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
tst_proto_gethostbyaddr="yes"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
tst_proto_gethostbyaddr="no"
|
||||
])
|
||||
fi
|
||||
#
|
||||
if test "$tst_proto_gethostbyaddr" = "yes"; then
|
||||
AC_MSG_CHECKING([if gethostbyaddr is compilable])
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
$curl_includes_winsock2
|
||||
$curl_includes_bsdsocket
|
||||
$curl_includes_netdb
|
||||
]],[[
|
||||
if(0 != gethostbyaddr(0, 0, 0))
|
||||
return 1;
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
tst_compi_gethostbyaddr="yes"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
tst_compi_gethostbyaddr="no"
|
||||
])
|
||||
fi
|
||||
#
|
||||
if test "$tst_compi_gethostbyaddr" = "yes"; then
|
||||
AC_MSG_CHECKING([if gethostbyaddr usage allowed])
|
||||
if test "x$curl_disallow_gethostbyaddr" != "xyes"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
tst_allow_gethostbyaddr="yes"
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
tst_allow_gethostbyaddr="no"
|
||||
fi
|
||||
fi
|
||||
#
|
||||
AC_MSG_CHECKING([if gethostbyaddr might be used])
|
||||
if test "$tst_links_gethostbyaddr" = "yes" &&
|
||||
test "$tst_proto_gethostbyaddr" = "yes" &&
|
||||
test "$tst_compi_gethostbyaddr" = "yes" &&
|
||||
test "$tst_allow_gethostbyaddr" = "yes"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE_UNQUOTED(HAVE_GETHOSTBYADDR, 1,
|
||||
[Define to 1 if you have the gethostbyaddr function.])
|
||||
curl_cv_func_gethostbyaddr="yes"
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
curl_cv_func_gethostbyaddr="no"
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
dnl CURL_CHECK_FUNC_GETHOSTBYADDR_R
|
||||
dnl -------------------------------------------------
|
||||
dnl Verify if gethostbyaddr_r is available, prototyped,
|
||||
dnl and can be compiled. If all of these are true, and
|
||||
dnl usage has not been previously disallowed with
|
||||
dnl shell variable curl_disallow_gethostbyaddr_r, then
|
||||
dnl HAVE_GETHOSTBYADDR_R will be defined.
|
||||
|
||||
AC_DEFUN([CURL_CHECK_FUNC_GETHOSTBYADDR_R], [
|
||||
AC_REQUIRE([CURL_INCLUDES_NETDB])dnl
|
||||
#
|
||||
tst_links_gethostbyaddr_r="unknown"
|
||||
tst_proto_gethostbyaddr_r="unknown"
|
||||
tst_compi_gethostbyaddr_r="unknown"
|
||||
tst_allow_gethostbyaddr_r="unknown"
|
||||
tst_nargs_gethostbyaddr_r="unknown"
|
||||
#
|
||||
AC_MSG_CHECKING([if gethostbyaddr_r can be linked])
|
||||
AC_LINK_IFELSE([
|
||||
AC_LANG_FUNC_LINK_TRY([gethostbyaddr_r])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
tst_links_gethostbyaddr_r="yes"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
tst_links_gethostbyaddr_r="no"
|
||||
])
|
||||
#
|
||||
if test "$tst_links_gethostbyaddr_r" = "yes"; then
|
||||
AC_MSG_CHECKING([if gethostbyaddr_r is prototyped])
|
||||
AC_EGREP_CPP([gethostbyaddr_r],[
|
||||
$curl_includes_netdb
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
tst_proto_gethostbyaddr_r="yes"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
tst_proto_gethostbyaddr_r="no"
|
||||
])
|
||||
fi
|
||||
#
|
||||
if test "$tst_proto_gethostbyaddr_r" = "yes"; then
|
||||
if test "$tst_nargs_gethostbyaddr_r" = "unknown"; then
|
||||
AC_MSG_CHECKING([if gethostbyaddr_r takes 5 args.])
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
$curl_includes_netdb
|
||||
]],[[
|
||||
if(0 != gethostbyaddr_r(0, 0, 0, 0, 0))
|
||||
return 1;
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
tst_compi_gethostbyaddr_r="yes"
|
||||
tst_nargs_gethostbyaddr_r="5"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
tst_compi_gethostbyaddr_r="no"
|
||||
])
|
||||
fi
|
||||
if test "$tst_nargs_gethostbyaddr_r" = "unknown"; then
|
||||
AC_MSG_CHECKING([if gethostbyaddr_r takes 7 args.])
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
$curl_includes_netdb
|
||||
]],[[
|
||||
if(0 != gethostbyaddr_r(0, 0, 0, 0, 0, 0, 0))
|
||||
return 1;
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
tst_compi_gethostbyaddr_r="yes"
|
||||
tst_nargs_gethostbyaddr_r="7"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
tst_compi_gethostbyaddr_r="no"
|
||||
])
|
||||
fi
|
||||
if test "$tst_nargs_gethostbyaddr_r" = "unknown"; then
|
||||
AC_MSG_CHECKING([if gethostbyaddr_r takes 8 args.])
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
$curl_includes_netdb
|
||||
]],[[
|
||||
if(0 != gethostbyaddr_r(0, 0, 0, 0, 0, 0, 0, 0))
|
||||
return 1;
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
tst_compi_gethostbyaddr_r="yes"
|
||||
tst_nargs_gethostbyaddr_r="8"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
tst_compi_gethostbyaddr_r="no"
|
||||
])
|
||||
fi
|
||||
AC_MSG_CHECKING([if gethostbyaddr_r is compilable])
|
||||
if test "$tst_compi_gethostbyaddr_r" = "yes"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
fi
|
||||
#
|
||||
if test "$tst_compi_gethostbyaddr_r" = "yes"; then
|
||||
AC_MSG_CHECKING([if gethostbyaddr_r usage allowed])
|
||||
if test "x$curl_disallow_gethostbyaddr_r" != "xyes"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
tst_allow_gethostbyaddr_r="yes"
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
tst_allow_gethostbyaddr_r="no"
|
||||
fi
|
||||
fi
|
||||
#
|
||||
AC_MSG_CHECKING([if gethostbyaddr_r might be used])
|
||||
if test "$tst_links_gethostbyaddr_r" = "yes" &&
|
||||
test "$tst_proto_gethostbyaddr_r" = "yes" &&
|
||||
test "$tst_compi_gethostbyaddr_r" = "yes" &&
|
||||
test "$tst_allow_gethostbyaddr_r" = "yes"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE_UNQUOTED(HAVE_GETHOSTBYADDR_R, 1,
|
||||
[Define to 1 if you have the gethostbyaddr_r function.])
|
||||
dnl AC_DEFINE_UNQUOTED(GETHOSTBYADDR_R_ARGS, $tst_nargs_gethostbyaddr_r,
|
||||
dnl [Specifies the number of arguments to gethostbyaddr_r])
|
||||
#
|
||||
if test "$tst_nargs_gethostbyaddr_r" -eq "5"; then
|
||||
AC_DEFINE(HAVE_GETHOSTBYADDR_R_5, 1, [gethostbyaddr_r() takes 5 args])
|
||||
elif test "$tst_nargs_gethostbyaddr_r" -eq "7"; then
|
||||
AC_DEFINE(HAVE_GETHOSTBYADDR_R_7, 1, [gethostbyaddr_r() takes 7 args])
|
||||
elif test "$tst_nargs_gethostbyaddr_r" -eq "8"; then
|
||||
AC_DEFINE(HAVE_GETHOSTBYADDR_R_8, 1, [gethostbyaddr_r() takes 8 args])
|
||||
fi
|
||||
#
|
||||
curl_cv_func_gethostbyaddr_r="yes"
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
curl_cv_func_gethostbyaddr_r="no"
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
dnl CURL_CHECK_FUNC_GETHOSTBYNAME
|
||||
dnl -------------------------------------------------
|
||||
dnl Verify if gethostbyname is available, prototyped,
|
||||
|
|
|
|||
|
|
@ -214,39 +214,6 @@ AC_DEFUN([CURL_CHECK_NEED_REENTRANT_STRTOK_R], [
|
|||
])
|
||||
|
||||
|
||||
dnl CURL_CHECK_NEED_REENTRANT_GETHOSTBYADDR_R
|
||||
dnl -------------------------------------------------
|
||||
dnl Checks if the preprocessor _REENTRANT definition
|
||||
dnl makes function gethostbyaddr_r compiler visible.
|
||||
|
||||
AC_DEFUN([CURL_CHECK_NEED_REENTRANT_GETHOSTBYADDR_R], [
|
||||
AC_LINK_IFELSE([
|
||||
AC_LANG_FUNC_LINK_TRY([gethostbyaddr_r])
|
||||
],[
|
||||
tmp_gethostbyaddr_r="yes"
|
||||
],[
|
||||
tmp_gethostbyaddr_r="no"
|
||||
])
|
||||
if test "$tmp_gethostbyaddr_r" = "yes"; then
|
||||
AC_EGREP_CPP([gethostbyaddr_r],[
|
||||
#include <sys/types.h>
|
||||
#include <netdb.h>
|
||||
],[
|
||||
tmp_gethostbyaddr_r="proto_declared"
|
||||
],[
|
||||
AC_EGREP_CPP([gethostbyaddr_r],[
|
||||
#define _REENTRANT
|
||||
#include <sys/types.h>
|
||||
#include <netdb.h>
|
||||
],[
|
||||
tmp_gethostbyaddr_r="proto_needs_reentrant"
|
||||
tmp_need_reentrant="yes"
|
||||
])
|
||||
])
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
dnl CURL_CHECK_NEED_REENTRANT_GETHOSTBYNAME_R
|
||||
dnl -------------------------------------------------
|
||||
dnl Checks if the preprocessor _REENTRANT definition
|
||||
|
|
@ -332,9 +299,6 @@ AC_DEFUN([CURL_CHECK_NEED_REENTRANT_FUNCTIONS_R], [
|
|||
if test "$tmp_need_reentrant" = "no"; then
|
||||
CURL_CHECK_NEED_REENTRANT_STRTOK_R
|
||||
fi
|
||||
if test "$tmp_need_reentrant" = "no"; then
|
||||
CURL_CHECK_NEED_REENTRANT_GETHOSTBYADDR_R
|
||||
fi
|
||||
if test "$tmp_need_reentrant" = "no"; then
|
||||
CURL_CHECK_NEED_REENTRANT_GETHOSTBYNAME_R
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue