From: Viktor Szakats Date: Sun, 6 Oct 2024 00:26:48 +0000 (+0200) Subject: configure: drop duplicate feature checks for `poll()`, `if_nametoindex()` X-Git-Tag: curl-8_11_0~221 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2d1959dd0c504a1e4418f687b714357142b0b21b;p=thirdparty%2Fcurl.git configure: drop duplicate feature checks for `poll()`, `if_nametoindex()` Before this patch they were detected via manual methods, then with `AC_CHECK_FUNCS()`. Delete the manual checks and keep the latter. Also delete `CURL_INCLUDES_POLL()` which is no longer used after the above. Closes #15170 --- diff --git a/configure.ac b/configure.ac index 9bf2f51b3f..66d9517eb8 100644 --- a/configure.ac +++ b/configure.ac @@ -4063,7 +4063,6 @@ CURL_CHECK_FUNC_GETHOSTBYNAME_R CURL_CHECK_FUNC_GETHOSTNAME CURL_CHECK_FUNC_GETPEERNAME CURL_CHECK_FUNC_GETSOCKNAME -CURL_CHECK_FUNC_IF_NAMETOINDEX CURL_CHECK_FUNC_GETIFADDRS CURL_CHECK_FUNC_GMTIME_R CURL_CHECK_FUNC_INET_NTOP @@ -4072,7 +4071,6 @@ CURL_CHECK_FUNC_IOCTL CURL_CHECK_FUNC_IOCTLSOCKET CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL CURL_CHECK_FUNC_MEMRCHR -CURL_CHECK_FUNC_POLL CURL_CHECK_FUNC_SIGACTION CURL_CHECK_FUNC_SIGINTERRUPT CURL_CHECK_FUNC_SIGNAL diff --git a/m4/curl-functions.m4 b/m4/curl-functions.m4 index fd4aac336b..19ebc87628 100644 --- a/m4/curl-functions.m4 +++ b/m4/curl-functions.m4 @@ -150,30 +150,6 @@ curl_includes_netdb="\ ]) -dnl CURL_INCLUDES_POLL -dnl ------------------------------------------------- -dnl Set up variable with list of headers that must be -dnl included when poll.h is to be included. - -AC_DEFUN([CURL_INCLUDES_POLL], [ -curl_includes_poll="\ -/* includes start */ -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_POLL_H -# include -#endif -#ifdef HAVE_SYS_POLL_H -# include -#endif -/* includes end */" - AC_CHECK_HEADERS( - sys/types.h poll.h sys/poll.h, - [], [], [$curl_includes_poll]) -]) - - dnl CURL_INCLUDES_SETJMP dnl ------------------------------------------------- dnl Set up variable with list of headers that must be @@ -2158,101 +2134,6 @@ AC_DEFUN([CURL_CHECK_FUNC_GETSOCKNAME], [ fi ]) -dnl CURL_CHECK_FUNC_IF_NAMETOINDEX -dnl ------------------------------------------------- -dnl Verify if if_nametoindex is available, prototyped, and -dnl can be compiled. If all of these are true, and -dnl usage has not been previously disallowed with -dnl shell variable curl_disallow_if_nametoindex, then -dnl HAVE_IF_NAMETOINDEX will be defined. - -AC_DEFUN([CURL_CHECK_FUNC_IF_NAMETOINDEX], [ - AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl - AC_REQUIRE([CURL_INCLUDES_NETIF])dnl - AC_REQUIRE([CURL_PREPROCESS_CALLCONV])dnl - # - tst_links_if_nametoindex="unknown" - tst_proto_if_nametoindex="unknown" - tst_compi_if_nametoindex="unknown" - tst_allow_if_nametoindex="unknown" - # - AC_MSG_CHECKING([if if_nametoindex can be linked]) - AC_LINK_IFELSE([ - AC_LANG_PROGRAM([[ - $curl_includes_winsock2 - $curl_includes_bsdsocket - #include - ]],[[ - if(0 != if_nametoindex("")) - return 1; - ]]) - ],[ - AC_MSG_RESULT([yes]) - tst_links_if_nametoindex="yes" - ],[ - AC_MSG_RESULT([no]) - tst_links_if_nametoindex="no" - ]) - # - if test "$tst_links_if_nametoindex" = "yes"; then - AC_MSG_CHECKING([if if_nametoindex is prototyped]) - AC_EGREP_CPP([if_nametoindex],[ - $curl_includes_winsock2 - $curl_includes_netif - ],[ - AC_MSG_RESULT([yes]) - tst_proto_if_nametoindex="yes" - ],[ - AC_MSG_RESULT([no]) - tst_proto_if_nametoindex="no" - ]) - fi - # - if test "$tst_proto_if_nametoindex" = "yes"; then - AC_MSG_CHECKING([if if_nametoindex is compilable]) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ - $curl_includes_winsock2 - $curl_includes_netif - ]],[[ - if(0 != if_nametoindex("")) - return 1; - ]]) - ],[ - AC_MSG_RESULT([yes]) - tst_compi_if_nametoindex="yes" - ],[ - AC_MSG_RESULT([no]) - tst_compi_if_nametoindex="no" - ]) - fi - # - if test "$tst_compi_if_nametoindex" = "yes"; then - AC_MSG_CHECKING([if if_nametoindex usage allowed]) - if test "x$curl_disallow_if_nametoindex" != "xyes"; then - AC_MSG_RESULT([yes]) - tst_allow_if_nametoindex="yes" - else - AC_MSG_RESULT([no]) - tst_allow_if_nametoindex="no" - fi - fi - # - AC_MSG_CHECKING([if if_nametoindex might be used]) - if test "$tst_links_if_nametoindex" = "yes" && - test "$tst_proto_if_nametoindex" = "yes" && - test "$tst_compi_if_nametoindex" = "yes" && - test "$tst_allow_if_nametoindex" = "yes"; then - AC_MSG_RESULT([yes]) - AC_DEFINE_UNQUOTED(HAVE_IF_NAMETOINDEX, 1, - [Define to 1 if you have the if_nametoindex function.]) - curl_cv_func_if_nametoindex="yes" - else - AC_MSG_RESULT([no]) - curl_cv_func_if_nametoindex="no" - fi -]) - dnl CURL_CHECK_FUNC_GETIFADDRS dnl ------------------------------------------------- @@ -3395,74 +3276,6 @@ AC_DEFUN([CURL_CHECK_FUNC_MEMRCHR], [ ]) -dnl CURL_CHECK_FUNC_POLL -dnl ------------------------------------------------- -dnl Verify if poll is available, prototyped, can -dnl be compiled and seems to work. - -AC_DEFUN([CURL_CHECK_FUNC_POLL], [ - AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl - AC_REQUIRE([CURL_INCLUDES_POLL])dnl - # - tst_links_poll="unknown" - tst_proto_poll="unknown" - tst_compi_poll="unknown" - # - AC_MSG_CHECKING([if poll can be linked]) - AC_LINK_IFELSE([ - AC_LANG_PROGRAM([[ - $curl_includes_poll - ]],[[ - if(0 != poll(0, 0, 0)) - return 1; - ]]) - ],[ - AC_MSG_RESULT([yes]) - tst_links_poll="yes" - ],[ - AC_MSG_RESULT([no]) - tst_links_poll="no" - ]) - # - if test "$tst_links_poll" = "yes"; then - AC_MSG_CHECKING([if poll is prototyped]) - AC_EGREP_CPP([poll],[ - $curl_includes_poll - ],[ - AC_MSG_RESULT([yes]) - tst_proto_poll="yes" - ],[ - AC_MSG_RESULT([no]) - tst_proto_poll="no" - ]) - fi - # - if test "$tst_proto_poll" = "yes"; then - AC_MSG_CHECKING([if poll is compilable]) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ - $curl_includes_poll - ]],[[ - if(0 != poll(0, 0, 0)) - return 1; - ]]) - ],[ - AC_MSG_RESULT([yes]) - tst_compi_poll="yes" - AC_DEFINE_UNQUOTED(HAVE_POLL, 1, [If you have poll]) - ],[ - AC_MSG_RESULT([no]) - tst_compi_poll="no" - ]) - fi - # -]) - - - fi -]) - - dnl CURL_CHECK_FUNC_SIGACTION dnl ------------------------------------------------- dnl Verify if sigaction is available, prototyped, and