The branch, v3-3-test has been updated via 6b782b58971cbbe56ead5d7e8db6eb8c3526e8ee (commit) via d81e58597e0ecdcf1ce6d8d71071fbf5d50670c2 (commit) via c97ff995e41d1cd31a7169e95ca415078da4a16c (commit) via ca163ff81a3f5d8303d45baa048850dfbc72a6a8 (commit) via 951b8c757ada337229a4efe81e6532d15fa0b63a (commit) via dddc4f0cef8ea71783fa7f7b68ec9ad3f29f7add (commit) from 93111ea0a1191e8547ad6cf112e2699d3bb3799b (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-3-test - Log ----------------------------------------------------------------- commit 6b782b58971cbbe56ead5d7e8db6eb8c3526e8ee Author: Stefan Metzmacher <[EMAIL PROTECTED]> Date: Fri May 16 12:50:16 2008 +0200 configure: make use of LIBREPLACE_NETWORK_LIBS instead of redoing the tests metze commit d81e58597e0ecdcf1ce6d8d71071fbf5d50670c2 Author: Stefan Metzmacher <[EMAIL PROTECTED]> Date: Fri May 16 12:48:57 2008 +0200 configure: remove some header checks which are already done by AC_LIBREPLACE_NETWORK_CHECKS metze commit c97ff995e41d1cd31a7169e95ca415078da4a16c Author: Stefan Metzmacher <[EMAIL PROTECTED]> 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 (cherry picked from commit 7f26a5425e706a97cc07c5139b3fea4fde9e4020) commit ca163ff81a3f5d8303d45baa048850dfbc72a6a8 Author: Stefan Metzmacher <[EMAIL PROTECTED]> Date: Fri May 16 12:33:11 2008 +0200 configure: remove unused configure checks for HAVE_SOCK_SIN_LEN and HAVE_UNIXSOCKET and rely on libreplace metze commit 951b8c757ada337229a4efe81e6532d15fa0b63a Author: Stefan Metzmacher <[EMAIL PROTECTED]> 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 (cherry picked from commit e674128ee2f11596f358ed46104c9d25eb2f754f) commit dddc4f0cef8ea71783fa7f7b68ec9ad3f29f7add Author: Stefan Metzmacher <[EMAIL PROTECTED]> Date: Fri May 16 12:16:05 2008 +0200 configure: remove unused configure check for HAVE_WORKING_AF_LOCAL metze ----------------------------------------------------------------------- Summary of changes: source/configure.in | 85 ++------------------------- source/lib/replace/libreplace.m4 | 1 - source/lib/replace/libreplace_network.m4 | 41 +++++++++++++ source/tests/unixsock.c | 93 ------------------------------ 4 files changed, 47 insertions(+), 173 deletions(-) delete mode 100644 source/tests/unixsock.c Changeset truncated at 500 lines: diff --git a/source/configure.in b/source/configure.in index bc36ced..b969b68 100644 --- a/source/configure.in +++ b/source/configure.in @@ -664,17 +664,16 @@ done AC_SUBST(LIBREPLACE_OBJS) # add -ldl to the global LIBS -LIBS="${LIBS} ${LIBDL}" +LIBS="${LIBS} ${LIBDL} ${LIBREPLACE_NETWORK_LIBS}" -AC_CHECK_HEADERS(aio.h arpa/inet.h sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h rpc/nettype.h) +AC_CHECK_HEADERS(aio.h sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h rpc/nettype.h) AC_CHECK_HEADERS(unistd.h utime.h grp.h sys/id.h memory.h alloca.h) AC_CHECK_HEADERS(limits.h float.h pthread.h) AC_CHECK_HEADERS(rpc/rpc.h rpcsvc/nis.h rpcsvc/ypclnt.h) AC_CHECK_HEADERS(sys/param.h ctype.h sys/wait.h sys/resource.h sys/ioctl.h sys/ipc.h sys/prctl.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/un.h ifaddrs.h) +AC_CHECK_HEADERS(sys/mman.h sys/filio.h sys/priv.h sys/shm.h string.h strings.h stdlib.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) +AC_CHECK_HEADERS(sys/termio.h sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h) AC_CHECK_HEADERS(sys/sysmacros.h) AC_CHECK_HEADERS(sys/syslog.h syslog.h) AC_CHECK_HEADERS(langinfo.h locale.h) @@ -806,24 +805,6 @@ if test x"$samba_cv_optimize_out_funcation_calls" = x"yes"; then AC_DEFINE(HAVE_COMPILER_WILL_OPTIMIZE_OUT_FNS,1,[Whether the compiler will optimize out function calls]) 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)]) -if test x"$samba_cv_unixsocket" = x"yes"; then - AC_DEFINE(HAVE_UNIXSOCKET,1,[If we need to build with unixsocket support]) -fi - ############################################# # check for fd passing struct via msg_control AC_CACHE_CHECK([for fd passing via msg_control],samba_cv_msghdr_msg_control, [ @@ -1017,40 +998,6 @@ AC_CHECK_LIB(readline, history_list, [], [$TERMLIBS]) -# The following test taken from the cvs sources -# If we can't find connect, try looking in -lsocket, -lnsl, and -linet. -# The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has -# libsocket.so which has a bad implementation of gethostbyname (it -# only looks in /etc/hosts), so we only look for -lsocket if we need -# it. -AC_CHECK_FUNCS(connect) -if test x"$ac_cv_func_connect" = x"no"; then - case "$LIBS" in - *-lnsl*) ;; - *) AC_CHECK_LIB(nsl_s, connect) ;; - esac - case "$LIBS" in - *-lnsl*) ;; - *) AC_CHECK_LIB(nsl, connect) ;; - esac - case "$LIBS" in - *-lsocket*) ;; - *) AC_CHECK_LIB(socket, connect) ;; - esac - case "$LIBS" in - *-linet*) ;; - *) AC_CHECK_LIB(inet, connect) ;; - esac - dnl We can't just call AC_CHECK_FUNCS(connect) here, because the value - dnl has been cached. - if test x"$ac_cv_lib_socket_connect" = x"yes" || - test x"$ac_cv_lib_inet_connect" = x"yes"; then - # ac_cv_func_connect=yes - # don't! it would cause AC_CHECK_FUNC to succeed next time configure is run - AC_DEFINE(HAVE_CONNECT,1,[Whether the system has connect()]) - fi -fi - ############################################### # test for where we get yp_get_default_domain() from AC_SEARCH_LIBS(yp_get_default_domain, [nsl]) @@ -2008,16 +1955,6 @@ if test x"$samba_cv_HAVE_UNSIGNED_CHAR" = x"yes"; then AC_DEFINE(HAVE_UNSIGNED_CHAR,1,[Whether the 'unsigned char' type is available]) fi -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 - AC_CACHE_CHECK([whether seekdir returns void],samba_cv_SEEKDIR_RETURNS_VOID,[ AC_TRY_COMPILE([#include <sys/types.h> #include <dirent.h> @@ -2655,16 +2592,6 @@ if test x"$samba_cv_HAVE_FTRUNCATE_EXTEND" = x"yes"; then AC_DEFINE(HAVE_FTRUNCATE_EXTEND,1,[Truncate extend]) fi -AC_CACHE_CHECK([for AF_LOCAL socket support], samba_cv_HAVE_WORKING_AF_LOCAL, [ -AC_TRY_RUN([#include "${srcdir-.}/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]) -fi - AC_CACHE_CHECK([for broken getgroups],samba_cv_HAVE_BROKEN_GETGROUPS,[ AC_TRY_RUN([#include "${srcdir-.}/tests/getgroups.c"], samba_cv_HAVE_BROKEN_GETGROUPS=yes,samba_cv_HAVE_BROKEN_GETGROUPS=no,samba_cv_HAVE_BROKEN_GETGROUPS=cross)]) @@ -5749,8 +5676,8 @@ case "$host_os" in NSSSONAMEVERSIONSUFFIX=".1" WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_solaris.o \ nsswitch/winbind_nss_linux.o" - WINBIND_NSS_EXTRA_LIBS="-lsocket" - PAM_WINBIND_EXTRA_LIBS="-lsocket" + WINBIND_NSS_EXTRA_LIBS="${LIBREPLACE_NETWORK_LIBS}" + PAM_WINBIND_EXTRA_LIBS="${LIBREPLACE_NETWORK_LIBS}" ;; *hpux11*) WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_solaris.o" 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/tests/unixsock.c b/source/tests/unixsock.c deleted file mode 100644 index f2765d6..0000000 --- a/source/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 <[EMAIL PROTECTED]>, 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); -} -- Samba Shared Repository