diff --git a/config.h.in b/config.h.in index 9742077a60..8840c89de4 100644 --- a/config.h.in +++ b/config.h.in @@ -83,7 +83,8 @@ you don't. */ #undef HAVE_DECL_UV_UDP_MMSG_FREE -/* Disable recvmmsg support on systems with MUSL glibc */ +/* Define to 1 if you have the declaration of `UV_UDP_RECVMMSG', and to 0 if + you don't. */ #undef HAVE_DECL_UV_UDP_RECVMMSG /* Define to 1 if you have the header file. */ diff --git a/configure b/configure index ed96e06b0c..9ef69c869b 100755 --- a/configure +++ b/configure @@ -16305,17 +16305,6 @@ $as_echo "yes" >&6; } fi # libuv recvmmsg support -ac_fn_c_check_decl "$LINENO" "UV_UDP_RECVMMSG" "ac_cv_have_decl_UV_UDP_RECVMMSG" "#include -" -if test "x$ac_cv_have_decl_UV_UDP_RECVMMSG" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_UV_UDP_RECVMMSG $ac_have_decl -_ACEOF ac_fn_c_check_decl "$LINENO" "UV_UDP_MMSG_FREE" "ac_cv_have_decl_UV_UDP_MMSG_FREE" "#include " if test "x$ac_cv_have_decl_UV_UDP_MMSG_FREE" = xyes; then : @@ -16339,14 +16328,42 @@ cat >>confdefs.h <<_ACEOF #define HAVE_DECL_UV_UDP_MMSG_CHUNK $ac_have_decl _ACEOF -case $host in #( - *-musl) : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct msghdr uses padding for alignment" >&5 +$as_echo_n "checking whether struct msghdr uses padding for alignment... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +const struct msghdr h = { .__pad1 = 0, .__pad2 = 0 }; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } $as_echo "#define HAVE_DECL_UV_UDP_RECVMMSG 0" >>confdefs.h - ;; #( - *) : - ;; -esac + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ac_fn_c_check_decl "$LINENO" "UV_UDP_RECVMMSG" "ac_cv_have_decl_UV_UDP_RECVMMSG" "#include +" +if test "x$ac_cv_have_decl_UV_UDP_RECVMMSG" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_UV_UDP_RECVMMSG $ac_have_decl +_ACEOF + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # # flockfile is usually provided by pthreads diff --git a/configure.ac b/configure.ac index 88f378da61..08acea1f21 100644 --- a/configure.ac +++ b/configure.ac @@ -731,9 +731,15 @@ PKG_CHECK_MODULES([LIBUV], [libuv >= 1.0.0], [], [AC_MSG_ERROR([libuv not found])]) # libuv recvmmsg support -AC_CHECK_DECLS([UV_UDP_RECVMMSG, UV_UDP_MMSG_FREE, UV_UDP_MMSG_CHUNK], [], [], [[#include ]]) -AS_CASE([$host], - [*-musl],[AC_DEFINE([HAVE_DECL_UV_UDP_RECVMMSG], [0], [Disable recvmmsg support on systems with MUSL glibc])]) +AC_CHECK_DECLS([UV_UDP_MMSG_FREE, UV_UDP_MMSG_CHUNK], [], [], [[#include ]]) +AC_MSG_CHECKING([whether struct msghdr uses padding for alignment]) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include ], + [const struct msghdr h = { .__pad1 = 0, .__pad2 = 0 };])], + [AC_MSG_RESULT([yes]) + AC_DEFINE([HAVE_DECL_UV_UDP_RECVMMSG], + [0], [Disable recvmmsg support on systems with MUSL glibc])], + [AC_MSG_RESULT([no]) + AC_CHECK_DECLS([UV_UDP_RECVMMSG], [], [], [[#include ]])]) # # flockfile is usually provided by pthreads