1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-05 20:58:40 +03:00

a better test for unix domain sockets

This commit is contained in:
Andrew Tridgell -
parent cfb6e67bb9
commit 7b3d030e1f
5 changed files with 24 additions and 6 deletions

View File

@ -154,3 +154,4 @@
#undef HAVE_SNPRINTF_DECL
#undef HAVE_VSNPRINTF_DECL
#undef HAVE_NATIVE_ICONV
#undef HAVE_UNIXSOCKET

View File

@ -250,7 +250,7 @@ AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(arpa/inet.h sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h)
AC_CHECK_HEADERS(unistd.h utime.h grp.h sys/id.h limits.h memory.h net/if.h)
AC_CHECK_HEADERS(compat.h rpc/rpc.h rpcsvc/nis.h rpcsvc/yp_prot.h rpcsvc/ypclnt.h)
AC_CHECK_HEADERS(sys/param.h ctype.h sys/un.h sys/wait.h sys/resource.h sys/ioctl.h sys/ipc.h sys/mode.h)
AC_CHECK_HEADERS(sys/param.h ctype.h sys/wait.h sys/resource.h sys/ioctl.h sys/ipc.h sys/mode.h)
AC_CHECK_HEADERS(sys/mman.h sys/filio.h sys/priv.h sys/shm.h string.h strings.h stdlib.h sys/socket.h)
AC_CHECK_HEADERS(sys/mount.h sys/vfs.h sys/fs/s5param.h sys/filsys.h termios.h termio.h)
AC_CHECK_HEADERS(sys/termio.h sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h sys/sockio.h)
@ -311,6 +311,25 @@ AC_CHECK_LIB(cups,httpConnect)
AC_CHECK_LIB(dl, dlopen, [LIBS="$LIBS -ldl";
AC_DEFINE(HAVE_LIBDL)])
############################################
# check for unix domain sockets
AC_CACHE_CHECK([for unix domain sockets],samba_cv_unixsocket, [
AC_TRY_COMPILE([
#include <sys/types.h>
#include <stdlib.h>
#include <stddef.h>
#include <sys/socket.h>
#include <sys/un.h>],
[
struct sockaddr_un sunaddr;
sunaddr.sun_family = AF_UNIX;
],
samba_cv_unixsocket=yes,samba_cv_unixsocket=no)])
if test x"$samba_cv_unixsocket" = x"yes"; then
AC_DEFINE(HAVE_UNIXSOCKET)
fi
AC_CACHE_CHECK([for socklen_t type],samba_cv_socklen_t, [
AC_TRY_COMPILE([
#include <sys/types.h>

View File

@ -217,6 +217,7 @@
#undef HAVE_SNPRINTF_DECL
#undef HAVE_VSNPRINTF_DECL
#undef HAVE_NATIVE_ICONV
#undef HAVE_UNIXSOCKET
/* The number of bytes in a int. */
#undef SIZEOF_INT
@ -947,9 +948,6 @@
/* Define if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
/* Define if you have the <sys/un.h> header file. */
#undef HAVE_SYS_UN_H
/* Define if you have the <sys/unistd.h> header file. */
#undef HAVE_SYS_UNISTD_H

View File

@ -107,7 +107,7 @@
#include <sys/socket.h>
#endif
#ifdef HAVE_SYS_UN_H
#ifdef HAVE_UNIXSOCKET
#include <sys/un.h>
#endif

View File

@ -43,7 +43,7 @@
#include <sys/socket.h>
#endif
#ifdef HAVE_SYS_UN_H
#ifdef HAVE_UNIXSOCKET
#include <sys/un.h>
#endif