]> git.ipfire.org Git - thirdparty/rsync.git/commitdiff
configure: avoid runtime IPv6 availability probe
authorZen Dodd <mail@steadytao.com>
Sat, 6 Jun 2026 03:14:12 +0000 (13:14 +1000)
committerAndrew Tridgell <andrew@tridgell.net>
Sat, 6 Jun 2026 04:21:07 +0000 (14:21 +1000)
configure.ac

index cfccb37cba499cfeb8764766d7d60033e99871f3..cda60405bd12f8f371376b90a1e8fe8972c8dbcb 100644 (file)
@@ -432,21 +432,17 @@ AS_HELP_STRING([--disable-ipv6],[disable to omit ipv6 support]),
        ;;
   esac ],
 
-  AC_RUN_IFELSE([AC_LANG_SOURCE([[ /* AF_INET6 availability check */
-#include <stdlib.h>
+  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 #include <sys/types.h>
 #include <sys/socket.h>
-int main()
-{
-   if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
-     exit(1);
-   else
-     exit(0);
-}
+#include <netinet/in.h>
+]], [[
+struct sockaddr_in6 sa6;
+(void)sa6;
+(void)AF_INET6;
 ]])],
   [AC_MSG_RESULT(yes)
-  AC_DEFINE(INET6, 1, true if you have IPv6)],
-  [AC_MSG_RESULT(no)],
+  AC_DEFINE(INET6, 1, [true if you have IPv6])],
   [AC_MSG_RESULT(no)]
 ))