diff options
author | Stefan Metzmacher <metze@samba.org> | 2008-05-16 12:29:21 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2008-05-17 13:18:32 +0200 |
commit | 84e9d52d4486444b5022078b157f59efa61c25d3 (patch) | |
tree | 6ed48431346555a0608a032629a6ef353c539aa3 /source3/lib/replace/libreplace_network.m4 | |
parent | ab90fc9a5636b166652cd5b653c58ffe576e00e2 (diff) | |
download | samba-84e9d52d4486444b5022078b157f59efa61c25d3.tar.gz samba-84e9d52d4486444b5022078b157f59efa61c25d3.tar.bz2 samba-84e9d52d4486444b5022078b157f59efa61c25d3.zip |
lib/replace: add checks for HAVE_SOCK_SIN_LEN and HAVE_UNIXSOCKET
Moved from the samba specific locations
metze
(cherry picked from commit e674128ee2f11596f358ed46104c9d25eb2f754f)
(This used to be commit 951b8c757ada337229a4efe81e6532d15fa0b63a)
Diffstat (limited to 'source3/lib/replace/libreplace_network.m4')
-rw-r--r-- | source3/lib/replace/libreplace_network.m4 | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/source3/lib/replace/libreplace_network.m4 b/source3/lib/replace/libreplace_network.m4 index 5ab71f160a..d29c13196d 100644 --- a/source3/lib/replace/libreplace_network.m4 +++ b/source3/lib/replace/libreplace_network.m4 @@ -62,6 +62,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. |