Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1aa004b

Browse files
author
Charles-François Natali
committed
Issue #16836: Enable IPv6 support even if IPv6 is disabled on the build host.
2 parents 9a54653 + f6fd794 commit 1aa004b

3 files changed

Lines changed: 12 additions & 31 deletions

File tree

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,8 @@ Tests
429429
Build
430430
-----
431431

432+
- Issue #16836: Enable IPv6 support even if IPv6 is disabled on the build host.
433+
432434
- Cross compiling needs host and build settings. configure no longer
433435
creates a broken PYTHON_FOR_BUILD variable when --build is missing.
434436

configure

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9795,28 +9795,20 @@ $as_echo "yes" >&6; }
97959795
esac
97969796
else
97979797

9798-
if test "$cross_compiling" = yes; then :
9799-
9800-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9801-
$as_echo "no" >&6; }
9802-
ipv6=no
9803-
9804-
else
98059798
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
98069799
/* end confdefs.h. */
98079800
/* AF_INET6 available check */
98089801
#include <sys/types.h>
98099802
#include <sys/socket.h>
9810-
main()
9803+
int
9804+
main ()
98119805
{
9812-
if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
9813-
exit(1);
9814-
else
9815-
exit(0);
9806+
int domain = AF_INET6;
9807+
;
9808+
return 0;
98169809
}
9817-
98189810
_ACEOF
9819-
if ac_fn_c_try_run "$LINENO"; then :
9811+
if ac_fn_c_try_compile "$LINENO"; then :
98209812

98219813
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
98229814
$as_echo "yes" >&6; }
@@ -9829,10 +9821,7 @@ $as_echo "no" >&6; }
98299821
ipv6=no
98309822

98319823
fi
9832-
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
9833-
conftest.$ac_objext conftest.beam conftest.$ac_ext
9834-
fi
9835-
9824+
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
98369825

98379826
if test "$ipv6" = "yes"; then
98389827
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if RFC2553 API is available" >&5

configure.ac

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2501,25 +2501,15 @@ AC_ARG_ENABLE(ipv6,
25012501

25022502
[
25032503
dnl the check does not work on cross compilation case...
2504-
AC_RUN_IFELSE([AC_LANG_SOURCE([[ /* AF_INET6 available check */
2504+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ /* AF_INET6 available check */
25052505
#include <sys/types.h>
2506-
#include <sys/socket.h>
2507-
main()
2508-
{
2509-
if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
2510-
exit(1);
2511-
else
2512-
exit(0);
2513-
}
2514-
]])],[
2506+
#include <sys/socket.h>]],
2507+
[[int domain = AF_INET6;]])],[
25152508
AC_MSG_RESULT(yes)
25162509
ipv6=yes
25172510
],[
25182511
AC_MSG_RESULT(no)
25192512
ipv6=no
2520-
],[
2521-
AC_MSG_RESULT(no)
2522-
ipv6=no
25232513
])
25242514
25252515
if test "$ipv6" = "yes"; then

0 commit comments

Comments
 (0)