1 From 737452159d521aef2041a2767f3ebf9f68f4b6a9 Mon Sep 17 00:00:00 2001
2 From: Christian Kampka <christian@kampka.net>
3 Date: Tue, 1 Sep 2020 13:54:35 +0200
4 Subject: [PATCH] Pin abstract namespace sockets to host_os
6 Running programs with AC_RUN_IFELSE fails when cross-compiling.
7 Since abstract namespace sockets are linux feature, we can easily
8 assume it is available for linux and not for darwin.
10 configure.in | 47 ++++++-----------------------------------------
11 1 file changed, 6 insertions(+), 41 deletions(-)
13 diff --git a/configure.in b/configure.in
14 index eb129db..0ed82ba 100644
17 @@ -387,47 +387,12 @@ fi
21 -AC_MSG_CHECKING(abstract socket namespace)
23 -AC_RUN_IFELSE([AC_LANG_PROGRAM(
25 -#include <sys/types.h>
29 -#include <sys/socket.h>
35 - struct sockaddr_un addr;
37 - listen_fd = socket (PF_UNIX, SOCK_STREAM, 0);
41 - fprintf (stderr, "socket() failed: %s\n", strerror (errno));
45 - memset (&addr, '\0', sizeof (addr));
46 - addr.sun_family = AF_UNIX;
47 - strcpy (addr.sun_path, "X/tmp/dbus-fake-socket-path-used-in-configure-test");
48 - addr.sun_path[0] = '\0'; /* this is what makes it abstract */
50 - if (bind (listen_fd, (struct sockaddr*) &addr, SUN_LEN (&addr)) < 0)
52 - fprintf (stderr, "Abstract socket namespace bind() failed: %s\n",
59 - [have_abstract_sockets=yes],
60 - [have_abstract_sockets=no])
62 +AC_MSG_CHECKING([whether target os has abstract socket namespace])
63 +if test x$target_os = xlinux-gnu ; then
64 + have_abstract_sockets=yes
66 + have_abstract_sockets=no
68 AC_MSG_RESULT($have_abstract_sockets)
70 if test x$enable_abstract_sockets = xyes; then