From 7879d999ab59678e98b7385e88eda5cce2c2a9fd Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 25 Jul 2001 03:28:45 +0000 Subject: a better test for unix domain sockets (This used to be commit 7b3d030e1f869a842822d9a356a027cca6f3a725) --- source3/acconfig.h | 1 + source3/configure.in | 21 ++++++++++++++++++++- source3/include/config.h.in | 4 +--- source3/include/includes.h | 2 +- source3/nsswitch/winbind_nss_config.h | 2 +- 5 files changed, 24 insertions(+), 6 deletions(-) diff --git a/source3/acconfig.h b/source3/acconfig.h index cdb4b8235a..04e7222bda 100644 --- a/source3/acconfig.h +++ b/source3/acconfig.h @@ -154,3 +154,4 @@ #undef HAVE_SNPRINTF_DECL #undef HAVE_VSNPRINTF_DECL #undef HAVE_NATIVE_ICONV +#undef HAVE_UNIXSOCKET diff --git a/source3/configure.in b/source3/configure.in index ce66eef973..8e4f8784ee 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -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 +#include +#include +#include +#include ], +[ + 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 diff --git a/source3/include/config.h.in b/source3/include/config.h.in index a76aee4005..7bf9923368 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -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 header file. */ #undef HAVE_SYS_TIME_H -/* Define if you have the header file. */ -#undef HAVE_SYS_UN_H - /* Define if you have the header file. */ #undef HAVE_SYS_UNISTD_H diff --git a/source3/include/includes.h b/source3/include/includes.h index 87547f5253..2caeb255bd 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -107,7 +107,7 @@ #include #endif -#ifdef HAVE_SYS_UN_H +#ifdef HAVE_UNIXSOCKET #include #endif diff --git a/source3/nsswitch/winbind_nss_config.h b/source3/nsswitch/winbind_nss_config.h index a946db89f6..4902f6ec5c 100644 --- a/source3/nsswitch/winbind_nss_config.h +++ b/source3/nsswitch/winbind_nss_config.h @@ -43,7 +43,7 @@ #include #endif -#ifdef HAVE_SYS_UN_H +#ifdef HAVE_UNIXSOCKET #include #endif -- cgit