From 9fcb39c7a5e60b8f07b38320fa32376547eb21bd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
Date: Mon, 8 Dec 2014 09:13:19 +0100
Subject: [PATCH 1/3] make broken glib a configure option - we cannot run
 compiled code
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Upstream-Status: Inappropriate [cross]

Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>

---
 src/ConfigureChecks.cmake | 23 ++---------------------
 1 file changed, 2 insertions(+), 21 deletions(-)

diff --git a/src/ConfigureChecks.cmake b/src/ConfigureChecks.cmake
index 9edbff7..d44aca6 100644
--- a/src/ConfigureChecks.cmake
+++ b/src/ConfigureChecks.cmake
@@ -85,27 +85,8 @@ check_struct_has_member("struct sockaddr" sa_len "sys/types.h;sys/socket.h" HAVE
 check_struct_has_member(dirent d_type dirent.h HAVE_DIRENT_D_TYPE LANGUAGE CXX)
 check_prototype_exists(res_init "sys/types.h;netinet/in.h;arpa/nameser.h;resolv.h" HAVE_RES_INIT_PROTO)
 
-check_cxx_source_runs("
-  #include <sys/types.h>
-  #include <sys/socket.h>
-  #include <netdb.h>
-  #include <string.h>
-  int main()
-  {
-    struct addrinfo hint, *res;
-    int err;
-    memset(&hint, 0, sizeof(hint));
-    hint.ai_family = AF_INET;
-    hint.ai_protocol = 0;
-    hint.ai_socktype = SOCK_STREAM;
-    hint.ai_flags = AI_PASSIVE;
-    err = getaddrinfo(0, \"18300\", &hint, &res);
-    if (err != 0 || res == 0 || res->ai_family != AF_INET)
-      return 1;
-    return 0;
-  }"
-  HAVE_GOOD_GETADDRINFO
-)
+# we cannot test if code is running so make it an option
+option(HAVE_GOOD_GETADDRINFO "glib getaddr is working properly - set off for workaround" On)
 
 if( NOT HAVE_GOOD_GETADDRINFO )
   set( HAVE_BROKEN_GETADDRINFO 1 )
-- 
1.8.3.1

