[SCM] Samba Shared Repository - branch v4-0-test updated -
release-4-0-0alpha3-1546-g7f26a54
Stefan Metzmacher
metze at samba.org
Fri May 16 20:57:23 GMT 2008
The branch, v4-0-test has been updated
via 7f26a5425e706a97cc07c5139b3fea4fde9e4020 (commit)
via 5de605bb2ef88a1f3e61c64e557c7f069d0f6dad (commit)
via e674128ee2f11596f358ed46104c9d25eb2f754f (commit)
via 1c7905cfb4c77edeb24ac612a544e777cf49e184 (commit)
from fc3bc3c4a85b0e0ba853f3208a4e934a733cfdc4 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v4-0-test
- Log -----------------------------------------------------------------
commit 7f26a5425e706a97cc07c5139b3fea4fde9e4020
Author: Stefan Metzmacher <metze at samba.org>
Date: Fri May 16 12:46:10 2008 +0200
lib/replace: move sys/sockio.h and sys/un.h checks into AC_LIBREPLACE_NETWORK_CHECKS
metze
commit 5de605bb2ef88a1f3e61c64e557c7f069d0f6dad
Author: Stefan Metzmacher <metze at samba.org>
Date: Fri May 16 12:30:49 2008 +0200
lib/socket: remove unused configure checks for HAVE_SOCK_SIN_LEN and HAVE_UNIXSOCKET and rely on libreplace
metze
commit e674128ee2f11596f358ed46104c9d25eb2f754f
Author: Stefan Metzmacher <metze at samba.org>
Date: Fri May 16 12:29:21 2008 +0200
lib/replace: add checks for HAVE_SOCK_SIN_LEN and HAVE_UNIXSOCKET
Moved from the samba specific locations
metze
commit 1c7905cfb4c77edeb24ac612a544e777cf49e184
Author: Stefan Metzmacher <metze at samba.org>
Date: Fri May 16 12:13:11 2008 +0200
lib/socket: remove unused configure check for HAVE_WORKING_AF_LOCAL
metze
-----------------------------------------------------------------------
Summary of changes:
source/build/tests/unixsock.c | 93 ------------------------------
source/lib/replace/libreplace.m4 | 1 -
source/lib/replace/libreplace_network.m4 | 41 +++++++++++++
source/lib/socket/config.m4 | 38 +-----------
4 files changed, 44 insertions(+), 129 deletions(-)
delete mode 100644 source/build/tests/unixsock.c
Changeset truncated at 500 lines:
diff --git a/source/build/tests/unixsock.c b/source/build/tests/unixsock.c
deleted file mode 100644
index f2765d6..0000000
--- a/source/build/tests/unixsock.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/* -*- c-file-style: "linux" -*-
- *
- * Try creating a Unix-domain socket, opening it, and reading from it.
- * The POSIX name for these is AF_LOCAL/PF_LOCAL.
- *
- * This is used by the Samba autoconf scripts to detect systems which
- * don't have Unix-domain sockets, such as (probably) VMS, or systems
- * on which they are broken under some conditions, such as RedHat 7.0
- * (unpatched). We can't build WinBind there at the moment.
- *
- * Coding standard says to always use exit() for this, not return, so
- * we do.
- *
- * Martin Pool <mbp at samba.org>, June 2000. */
-
-/* TODO: Look for AF_LOCAL (most standard), AF_UNIX, and AF_FILE. */
-
-#include <stdio.h>
-
-#ifdef HAVE_SYS_SOCKET_H
-# include <sys/socket.h>
-#endif
-
-#ifdef HAVE_SYS_UN_H
-# include <sys/un.h>
-#endif
-
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
-#if HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-
-#if HAVE_ERRNO_DECL
-# include <errno.h>
-#else
-extern int errno;
-#endif
-
-static int bind_socket(char const *filename)
-{
- int sock_fd;
- struct sockaddr_un name;
- size_t size;
-
- /* Create the socket. */
- if ((sock_fd = socket(PF_LOCAL, SOCK_STREAM, 0)) < 0) {
- perror ("socket(PF_LOCAL, SOCK_STREAM)");
- exit(1);
- }
-
- /* Bind a name to the socket. */
- name.sun_family = AF_LOCAL;
- strncpy(name.sun_path, filename, sizeof (name.sun_path));
-
- /* The size of the address is
- the offset of the start of the filename,
- plus its length,
- plus one for the terminating null byte.
- Alternatively you can just do:
- size = SUN_LEN (&name);
- */
- size = SUN_LEN(&name);
- /* XXX: This probably won't work on unfriendly libcs */
-
- if (bind(sock_fd, (struct sockaddr *) &name, size) < 0) {
- perror ("bind");
- exit(1);
- }
-
- return sock_fd;
-}
-
-
-int main(void)
-{
- int sock_fd;
- int kid;
- char const *filename = "conftest.unixsock.sock";
-
- /* abolish hanging */
- alarm(15); /* secs */
-
- if ((sock_fd = bind_socket(filename)) < 0)
- exit(1);
-
- /* the socket will be deleted when autoconf cleans up these
- files. */
-
- exit(0);
-}
diff --git a/source/lib/replace/libreplace.m4 b/source/lib/replace/libreplace.m4
index 2b33d97..6a85ff5 100644
--- a/source/lib/replace/libreplace.m4
+++ b/source/lib/replace/libreplace.m4
@@ -96,7 +96,6 @@ fi
AC_CHECK_HEADERS(sys/syslog.h syslog.h)
AC_CHECK_HEADERS(sys/time.h time.h)
AC_CHECK_HEADERS(stdarg.h vararg.h)
-AC_CHECK_HEADERS(sys/sockio.h sys/un.h)
AC_CHECK_HEADERS(sys/mount.h mntent.h)
AC_CHECK_HEADERS(stropts.h)
diff --git a/source/lib/replace/libreplace_network.m4 b/source/lib/replace/libreplace_network.m4
index 5ab71f1..f2d177b 100644
--- a/source/lib/replace/libreplace_network.m4
+++ b/source/lib/replace/libreplace_network.m4
@@ -8,6 +8,7 @@ LIBREPLACE_NETWORK_LIBS=""
AC_CHECK_HEADERS(sys/socket.h netinet/in.h netdb.h arpa/inet.h)
AC_CHECK_HEADERS(netinet/ip.h netinet/tcp.h netinet/in_systm.h netinet/in_ip.h)
+AC_CHECK_HEADERS(sys/sockio.h sys/un.h)
dnl we need to check that net/if.h really can be used, to cope with hpux
dnl where including it always fails
@@ -62,6 +63,46 @@ AC_CHECK_MEMBER(struct sockaddr_storage.__ss_family,
fi
fi
+AC_CACHE_CHECK([for sin_len in sock],libreplace_cv_HAVE_SOCK_SIN_LEN,[
+ AC_TRY_COMPILE(
+ [
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+ ],[
+struct sockaddr_in sock; sock.sin_len = sizeof(sock);
+ ],[
+ libreplace_cv_HAVE_SOCK_SIN_LEN=yes
+ ],[
+ libreplace_cv_HAVE_SOCK_SIN_LEN=no
+ ])
+])
+if test x"$libreplace_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
+ AC_DEFINE(HAVE_SOCK_SIN_LEN,1,[Whether the sockaddr_in struct has a sin_len property])
+fi
+
+############################################
+# check for unix domain sockets
+AC_CACHE_CHECK([for unix domain sockets],libreplace_cv_HAVE_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;
+ ],[
+ libreplace_cv_HAVE_UNIXSOCKET=yes
+ ],[
+ libreplace_cv_HAVE_UNIXSOCKET=no
+ ])
+])
+if test x"$libreplace_cv_HAVE_UNIXSOCKET" = x"yes"; then
+ AC_DEFINE(HAVE_UNIXSOCKET,1,[If we need to build with unixscoket support])
+fi
+
dnl The following test is roughl taken from the cvs sources.
dnl
dnl If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
diff --git a/source/lib/socket/config.m4 b/source/lib/socket/config.m4
index b40002b..871c57f 100644
--- a/source/lib/socket/config.m4
+++ b/source/lib/socket/config.m4
@@ -1,44 +1,12 @@
AC_CHECK_FUNCS(writev)
AC_CHECK_FUNCS(readv)
-AC_CACHE_CHECK([for sin_len in sock],samba_cv_HAVE_SOCK_SIN_LEN,[
-AC_TRY_COMPILE([#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>],
-[struct sockaddr_in sock; sock.sin_len = sizeof(sock);],
-samba_cv_HAVE_SOCK_SIN_LEN=yes,samba_cv_HAVE_SOCK_SIN_LEN=no)])
-if test x"$samba_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
- AC_DEFINE(HAVE_SOCK_SIN_LEN,1,[Whether the sockaddr_in struct has a sin_len property])
-fi
-
############################################
# 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)])
+# done by AC_LIBREPLACE_NETWORK_CHECKS
SMB_ENABLE(socket_unix, NO)
-if test x"$samba_cv_unixsocket" = x"yes"; then
- SMB_ENABLE(socket_unix, YES)
- AC_DEFINE(HAVE_UNIXSOCKET,1,[If we need to build with unixscoket support])
-fi
-
-AC_CACHE_CHECK([for AF_LOCAL socket support], samba_cv_HAVE_WORKING_AF_LOCAL, [
-AC_TRY_RUN([#include "${srcdir-.}/build/tests/unixsock.c"],
- samba_cv_HAVE_WORKING_AF_LOCAL=yes,
- samba_cv_HAVE_WORKING_AF_LOCAL=no,
- samba_cv_HAVE_WORKING_AF_LOCAL=cross)])
-if test x"$samba_cv_HAVE_WORKING_AF_LOCAL" != xno
-then
- AC_DEFINE(HAVE_WORKING_AF_LOCAL, 1, [Define if you have working AF_LOCAL sockets])
+if test x"$libreplace_cv_HAVE_UNIXSOCKET" = x"yes"; then
+ SMB_ENABLE(socket_unix, YES)
fi
dnl test for ipv6 using the gethostbyname2() function. That should be sufficient
--
Samba Shared Repository
More information about the samba-cvs
mailing list