[Python-checkins] cpython (merge 3.2 -> 3.3): Issue #16836: Enable IPv6 support even if IPv6 is disabled on the build host.

charles-francois.natali python-checkins at python.org
Tue Jan 8 20:08:23 CET 2013


http://hg.python.org/cpython/rev/ebfd847bc15a
changeset:   81324:ebfd847bc15a
branch:      3.3
parent:      81320:b00c4a095b00
parent:      81323:d5df9ed118c5
user:        Charles-François Natali <neologix at free.fr>
date:        Tue Jan 08 19:51:56 2013 +0100
summary:
  Issue #16836: Enable IPv6 support even if IPv6 is disabled on the build host.

files:
  Misc/NEWS    |   2 ++
  configure    |  31 ++++++++++---------------------
  configure.ac |  16 +++-------------
  3 files changed, 15 insertions(+), 34 deletions(-)


diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -429,6 +429,8 @@
 Build
 -----
 
+- Issue #16836: Enable IPv6 support even if IPv6 is disabled on the build host.
+
 - Cross compiling needs host and build settings. configure no longer
   creates a broken PYTHON_FOR_BUILD variable when --build is missing.
 
diff --git a/configure b/configure
--- a/configure
+++ b/configure
@@ -9795,28 +9795,20 @@
   esac
 else
 
-  if test "$cross_compiling" = yes; then :
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-  ipv6=no
-
-else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
  /* AF_INET6 available check */
 #include <sys/types.h>
 #include <sys/socket.h>
-main()
-{
- if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
-   exit(1);
- else
-   exit(0);
-}
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
+int
+main ()
+{
+int domain = AF_INET6;
+  ;
+  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; }
@@ -9829,10 +9821,7 @@
   ipv6=no
 
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 if test "$ipv6" = "yes"; then
 	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if RFC2553 API is available" >&5
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -2501,25 +2501,15 @@
 
 [
 dnl the check does not work on cross compilation case...
-  AC_RUN_IFELSE([AC_LANG_SOURCE([[ /* AF_INET6 available check */
+  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ /* AF_INET6 available check */
 #include <sys/types.h>
-#include <sys/socket.h>
-main()
-{
- if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
-   exit(1);
- else
-   exit(0);
-}
-]])],[
+#include <sys/socket.h>]],
+[[int domain = AF_INET6;]])],[
   AC_MSG_RESULT(yes)
   ipv6=yes
 ],[
   AC_MSG_RESULT(no)
   ipv6=no
-],[
-  AC_MSG_RESULT(no)
-  ipv6=no
 ])
 
 if test "$ipv6" = "yes"; then

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list