From dd7595a3475407a7fa96a97393bae8c5220e8762 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Wed, 4 Jan 2012 18:41:13 +1000 Subject: Add the base Enlightenment Foundation Libraries - eina, eet, evas, ecore, embryo, and edje. Note that embryo wont be used, but I'm not sure yet if you can build edje without it. --- libraries/ecore/m4/ac_abstract_socket.m4 | 41 ++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 libraries/ecore/m4/ac_abstract_socket.m4 (limited to 'libraries/ecore/m4/ac_abstract_socket.m4') diff --git a/libraries/ecore/m4/ac_abstract_socket.m4 b/libraries/ecore/m4/ac_abstract_socket.m4 new file mode 100644 index 0000000..c4f0b74 --- /dev/null +++ b/libraries/ecore/m4/ac_abstract_socket.m4 @@ -0,0 +1,41 @@ +dnl AC_ABSTRACT_SOCKET_TEST(ACTION_IF_FOUND, ACTION_IF_NOT_FOUND) +dnl test if a system supports the abstract socket namespace +dnl by rephorm +AC_DEFUN([AC_ABSTRACT_SOCKET_TEST], [ +AC_MSG_CHECKING(abstract sockets) +AC_LANG_PUSH(C) +AC_RUN_IFELSE([AC_LANG_PROGRAM( +[[ +// headers +#include +#include +#include +#include +#include +#include +]], +[[ +// main fn +#define ABS_SUN_LEN(s, path) (strlen(path) + 1 + (size_t)(((struct sockaddr_un *)NULL)->sun_path)) + int fd; + struct sockaddr_un sock; + char *tmp; + char *name = "/ecore/dbus/abstract/test"; + + sock.sun_family = AF_UNIX; + snprintf(sock.sun_path, sizeof(sock.sun_path), ".%s", name); + sock.sun_path[0] = '\0'; + fd = socket(PF_UNIX, SOCK_STREAM, 0); + if (bind(fd, (struct sockaddr *)&sock, ABS_SUN_LEN(&sock, name)) < 0) + { + printf("Failed to bind to abstract socket.\n"); + exit(1); + } + + printf ("connected\n"); + exit(0); +]])], +[$1], +[$2]) +]) + -- cgit v1.1