From: Gergely Nagy Date: Fri, 18 Jun 2021 07:47:39 +0000 (+0200) Subject: configure/cmake: remove checks for unused getservbyport_r X-Git-Tag: curl-7_78_0~121 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=67af0f7eae10367d7207e18eff514f4fa417ec45;p=thirdparty%2Fcurl.git configure/cmake: remove checks for unused getservbyport_r Closes #7276 --- diff --git a/configure.ac b/configure.ac index 050d2b84be..ef82d3d3c7 100644 --- a/configure.ac +++ b/configure.ac @@ -3234,7 +3234,6 @@ CURL_CHECK_FUNC_GETPEERNAME CURL_CHECK_FUNC_GETSOCKNAME CURL_CHECK_FUNC_IF_NAMETOINDEX CURL_CHECK_FUNC_GETIFADDRS -CURL_CHECK_FUNC_GETSERVBYPORT_R CURL_CHECK_FUNC_GMTIME_R CURL_CHECK_FUNC_INET_NTOA_R CURL_CHECK_FUNC_INET_NTOP diff --git a/lib/config-vxworks.h b/lib/config-vxworks.h index dc46373be1..18927a850b 100644 --- a/lib/config-vxworks.h +++ b/lib/config-vxworks.h @@ -83,12 +83,6 @@ /* Define if you want to enable IPv6 support */ #define ENABLE_IPV6 1 -/* Specifies the number of arguments to getservbyport_r */ -#define GETSERVBYPORT_R_ARGS 6 - -/* Specifies the size of the buffer to pass to getservbyport_r */ -#define GETSERVBYPORT_R_BUFSIZE 4096 - /* Define to 1 if you have the alarm function. */ #define HAVE_ALARM 1 @@ -209,9 +203,6 @@ /* Define to 1 if you have the `getrlimit' function. */ #define HAVE_GETRLIMIT 1 -/* Define to 1 if you have the getservbyport_r function. */ -/* #undef HAVE_GETSERVBYPORT_R */ - /* Define to 1 if you have the `gettimeofday' function. */ /* #undef HAVE_GETTIMEOFDAY */ diff --git a/lib/curl_config.h.cmake b/lib/curl_config.h.cmake index 96a19afc51..de9ee18c25 100644 --- a/lib/curl_config.h.cmake +++ b/lib/curl_config.h.cmake @@ -112,12 +112,6 @@ /* Define if you want to enable IPv6 support */ #cmakedefine ENABLE_IPV6 1 -/* Specifies the number of arguments to getservbyport_r */ -#cmakedefine GETSERVBYPORT_R_ARGS ${GETSERVBYPORT_R_ARGS} - -/* Specifies the size of the buffer to pass to getservbyport_r */ -#cmakedefine GETSERVBYPORT_R_BUFSIZE ${GETSERVBYPORT_R_BUFSIZE} - /* Define to 1 if you have the alarm function. */ #cmakedefine HAVE_ALARM 1 @@ -259,9 +253,6 @@ /* Define to 1 if you have the `getrlimit' function. */ #cmakedefine HAVE_GETRLIMIT 1 -/* Define to 1 if you have the getservbyport_r function. */ -#cmakedefine HAVE_GETSERVBYPORT_R 1 - /* Define to 1 if you have the `gettimeofday' function. */ #cmakedefine HAVE_GETTIMEOFDAY 1 diff --git a/m4/curl-functions.m4 b/m4/curl-functions.m4 index d49713df67..a5266ce9bc 100644 --- a/m4/curl-functions.m4 +++ b/m4/curl-functions.m4 @@ -3330,146 +3330,6 @@ AC_DEFUN([CURL_CHECK_FUNC_GETIFADDRS], [ ]) -dnl CURL_CHECK_FUNC_GETSERVBYPORT_R -dnl ------------------------------------------------- -dnl Verify if getservbyport_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_getservbyport_r, then -dnl HAVE_GETSERVBYPORT_R will be defined. - -AC_DEFUN([CURL_CHECK_FUNC_GETSERVBYPORT_R], [ - AC_REQUIRE([CURL_INCLUDES_NETDB])dnl - # - tst_links_getservbyport_r="unknown" - tst_proto_getservbyport_r="unknown" - tst_compi_getservbyport_r="unknown" - tst_allow_getservbyport_r="unknown" - tst_nargs_getservbyport_r="unknown" - # - AC_MSG_CHECKING([if getservbyport_r can be linked]) - AC_LINK_IFELSE([ - AC_LANG_FUNC_LINK_TRY([getservbyport_r]) - ],[ - AC_MSG_RESULT([yes]) - tst_links_getservbyport_r="yes" - ],[ - AC_MSG_RESULT([no]) - tst_links_getservbyport_r="no" - ]) - # - if test "$tst_links_getservbyport_r" = "yes"; then - AC_MSG_CHECKING([if getservbyport_r is prototyped]) - AC_EGREP_CPP([getservbyport_r],[ - $curl_includes_netdb - ],[ - AC_MSG_RESULT([yes]) - tst_proto_getservbyport_r="yes" - ],[ - AC_MSG_RESULT([no]) - tst_proto_getservbyport_r="no" - ]) - fi - # - if test "$tst_proto_getservbyport_r" = "yes"; then - if test "$tst_nargs_getservbyport_r" = "unknown"; then - AC_MSG_CHECKING([if getservbyport_r takes 4 args.]) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ - $curl_includes_netdb - ]],[[ - if(0 != getservbyport_r(0, 0, 0, 0)) - return 1; - ]]) - ],[ - AC_MSG_RESULT([yes]) - tst_compi_getservbyport_r="yes" - tst_nargs_getservbyport_r="4" - ],[ - AC_MSG_RESULT([no]) - tst_compi_getservbyport_r="no" - ]) - fi - if test "$tst_nargs_getservbyport_r" = "unknown"; then - AC_MSG_CHECKING([if getservbyport_r takes 5 args.]) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ - $curl_includes_netdb - ]],[[ - if(0 != getservbyport_r(0, 0, 0, 0, 0)) - return 1; - ]]) - ],[ - AC_MSG_RESULT([yes]) - tst_compi_getservbyport_r="yes" - tst_nargs_getservbyport_r="5" - ],[ - AC_MSG_RESULT([no]) - tst_compi_getservbyport_r="no" - ]) - fi - if test "$tst_nargs_getservbyport_r" = "unknown"; then - AC_MSG_CHECKING([if getservbyport_r takes 6 args.]) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ - $curl_includes_netdb - ]],[[ - if(0 != getservbyport_r(0, 0, 0, 0, 0, 0)) - return 1; - ]]) - ],[ - AC_MSG_RESULT([yes]) - tst_compi_getservbyport_r="yes" - tst_nargs_getservbyport_r="6" - ],[ - AC_MSG_RESULT([no]) - tst_compi_getservbyport_r="no" - ]) - fi - AC_MSG_CHECKING([if getservbyport_r is compilable]) - if test "$tst_compi_getservbyport_r" = "yes"; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi - fi - # - if test "$tst_compi_getservbyport_r" = "yes"; then - AC_MSG_CHECKING([if getservbyport_r usage allowed]) - if test "x$curl_disallow_getservbyport_r" != "xyes"; then - AC_MSG_RESULT([yes]) - tst_allow_getservbyport_r="yes" - else - AC_MSG_RESULT([no]) - tst_allow_getservbyport_r="no" - fi - fi - # - AC_MSG_CHECKING([if getservbyport_r might be used]) - if test "$tst_links_getservbyport_r" = "yes" && - test "$tst_proto_getservbyport_r" = "yes" && - test "$tst_compi_getservbyport_r" = "yes" && - test "$tst_allow_getservbyport_r" = "yes"; then - AC_MSG_RESULT([yes]) - AC_DEFINE_UNQUOTED(HAVE_GETSERVBYPORT_R, 1, - [Define to 1 if you have the getservbyport_r function.]) - AC_DEFINE_UNQUOTED(GETSERVBYPORT_R_ARGS, $tst_nargs_getservbyport_r, - [Specifies the number of arguments to getservbyport_r]) - if test "$tst_nargs_getservbyport_r" -eq "4"; then - AC_DEFINE(GETSERVBYPORT_R_BUFSIZE, sizeof(struct servent_data), - [Specifies the size of the buffer to pass to getservbyport_r]) - else - AC_DEFINE(GETSERVBYPORT_R_BUFSIZE, 4096, - [Specifies the size of the buffer to pass to getservbyport_r]) - fi - curl_cv_func_getservbyport_r="yes" - else - AC_MSG_RESULT([no]) - curl_cv_func_getservbyport_r="no" - fi -]) - - dnl CURL_CHECK_FUNC_GETXATTR dnl ------------------------------------------------- dnl Verify if getxattr is available, prototyped, and diff --git a/m4/curl-reentrant.m4 b/m4/curl-reentrant.m4 index 94e76b6880..4655b05475 100644 --- a/m4/curl-reentrant.m4 +++ b/m4/curl-reentrant.m4 @@ -350,39 +350,6 @@ AC_DEFUN([CURL_CHECK_NEED_REENTRANT_GETPROTOBYNAME_R], [ ]) -dnl CURL_CHECK_NEED_REENTRANT_GETSERVBYPORT_R -dnl ------------------------------------------------- -dnl Checks if the preprocessor _REENTRANT definition -dnl makes function getservbyport_r compiler visible. - -AC_DEFUN([CURL_CHECK_NEED_REENTRANT_GETSERVBYPORT_R], [ - AC_LINK_IFELSE([ - AC_LANG_FUNC_LINK_TRY([getservbyport_r]) - ],[ - tmp_getservbyport_r="yes" - ],[ - tmp_getservbyport_r="no" - ]) - if test "$tmp_getservbyport_r" = "yes"; then - AC_EGREP_CPP([getservbyport_r],[ -#include -#include - ],[ - tmp_getservbyport_r="proto_declared" - ],[ - AC_EGREP_CPP([getservbyport_r],[ -#define _REENTRANT -#include -#include - ],[ - tmp_getservbyport_r="proto_needs_reentrant" - tmp_need_reentrant="yes" - ]) - ]) - fi -]) - - dnl CURL_CHECK_NEED_REENTRANT_FUNCTIONS_R dnl ------------------------------------------------- dnl Checks if the preprocessor _REENTRANT definition @@ -414,9 +381,6 @@ AC_DEFUN([CURL_CHECK_NEED_REENTRANT_FUNCTIONS_R], [ if test "$tmp_need_reentrant" = "no"; then CURL_CHECK_NEED_REENTRANT_GETPROTOBYNAME_R fi - if test "$tmp_need_reentrant" = "no"; then - CURL_CHECK_NEED_REENTRANT_GETSERVBYPORT_R - fi ])