Author: cazfi
Date: Wed Jan 20 12:02:46 2016
New Revision: 31513

URL: http://svn.gna.org/viewcvs/freeciv?rev=31513&view=rev
Log:
Make configure checks for functions required for IPv6 support to also pass
if it finds them as macros and/or require including <ws2tcpip.h>

See patch #6820

Modified:
    branches/S2_6/configure.ac

Modified: branches/S2_6/configure.ac
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/configure.ac?rev=31513&r1=31512&r2=31513&view=diff
==============================================================================
--- branches/S2_6/configure.ac  (original)
+++ branches/S2_6/configure.ac  Wed Jan 20 12:02:46 2016
@@ -218,8 +218,28 @@
 esac], [ipv6=test])
 if test x$ipv6 != xno ; then
   if test "x$have_getaddrinfo" = "xyes" ; then
-    AC_CHECK_FUNCS([inet_pton inet_ntop getnameinfo],
-[enable_ipv6=yes], [enable_ipv6=no])
+    enable_ipv6=yes
+    AC_CHECK_FUNCS([inet_pton], [],
+       [AC_MSG_CHECKING([inet_pton() as a macro])
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([
+#ifdef FREECIV_HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif], [inet_pton(0, NULL, NULL);])], [
+      AC_MSG_RESULT([yes])], [enable_ipv6=no])])
+    AC_CHECK_FUNCS([inet_ntop], [],
+       [AC_MSG_CHECKING([inet_ntop() as a macro])
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([
+#ifdef FREECIV_HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif], [inet_ntop(0, NULL, NULL, 0);])], [
+      AC_MSG_RESULT([yes])], [enable_ipv6=no])])
+    AC_CHECK_FUNCS([getnameinfo], [],
+       [AC_MSG_CHECKING([getnameinfo() as a macro])
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([
+#ifdef FREECIV_HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif], [getnameinfo(NULL, 0, NULL, 0, NULL, 0, 0);])], [
+      AC_MSG_RESULT([yes])], [enable_ipv6=no])])
   else
      enable_ipv6=no
   fi


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to