AC_HEADER_SYS_WAIT
+AC_CHECK_HEADERS([sys/socket.h])
+
AC_CHECK_HEADERS([ \
+arpa/inet.h \
langinfo.h \
features.h \
+net/if.h \
+netinet/in.h \
+netinet/tcp.h \
sys/prctl.h \
sys/resource.h \
sys/timerfd.h \
+sys/un.h \
])
### Checks for types
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
-#include <sys/socket.h>
-#include <netinet/tcp.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
+
+#ifdef HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+
+#ifdef HAVE_NETINET_TCP_H
+# include <netinet/tcp.h>
+#endif
+
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+
+#ifdef HAVE_ARPA_INET_H
+# include <arpa/inet.h>
+#endif
+
+#ifdef HAVE_SYS_UN_H
#include <sys/un.h>
+#endif
#ifdef HAVE_SYSTEMD
# include <systemd/sd-daemon.h>
#include <string.h>
#include <sys/types.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
+
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+
+#ifdef HAVE_ARPA_INET_H
+# include <arpa/inet.h>
+#endif
#include <ares.h>
#include <unistd.h>
#include <fcntl.h>
-#include <arpa/inet.h>
-#include <net/if.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
+#ifdef HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+
+#ifdef HAVE_NETINET_TCP_H
+# include <netinet/tcp.h>
+#endif
+
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+
+#ifdef HAVE_ARPA_INET_H
+# include <arpa/inet.h>
+#endif
+
+#ifdef HAVE_SYS_UN_H
#include <sys/un.h>
-#include <sys/socket.h>
+#endif
+
+#ifdef HAVE_NET_IF_H
+# include <net/if.h>
+#endif
#ifdef HAVE_WS2TCPIP_H
# include <ws2tcpip.h>
#include "Ecore_Con.h"
#include "ecore_con_private.h"
+#if defined(_WIN32) && !defined(IF_NAMESIZE)
+#define IF_NAMESIZE 16
+#endif
+
/* http://tools.ietf.org/html/rfc1928
o X'00' NO AUTHENTICATION REQUIRED
o X'01' GSSAPI
#include <string.h>
#include <sys/types.h>
-#include <netinet/in.h>
+
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
#ifdef HAVE_WINSOCK2_H
# include <winsock2.h>