summaryrefslogtreecommitdiff
path: root/source4/lib/socket/SConscript
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-09-23 16:32:52 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:38:48 -0500
commit4be0ae794e4af2354d678fddd7bf1e822ffa9148 (patch)
tree128989d970334e4a896329992e827c4f09b8c035 /source4/lib/socket/SConscript
parentda46c9252ee887602b3e629065ca87b9ed11466f (diff)
downloadsamba-4be0ae794e4af2354d678fddd7bf1e822ffa9148.tar.gz
samba-4be0ae794e4af2354d678fddd7bf1e822ffa9148.tar.bz2
samba-4be0ae794e4af2354d678fddd7bf1e822ffa9148.zip
r10456: More SCons fixes:
- Add framework for fallback generating code - Move pread / pwrite replacement functions to libreplace - Support pidl builds correctly - Support asn1 builds correctly - Move OS-specific checks to lib/replace/SConscript (This used to be commit fbbfad0a1f7dedbf48e835a864f8285f283d72f3)
Diffstat (limited to 'source4/lib/socket/SConscript')
-rw-r--r--source4/lib/socket/SConscript59
1 files changed, 59 insertions, 0 deletions
diff --git a/source4/lib/socket/SConscript b/source4/lib/socket/SConscript
index db449592c2..c4e791467a 100644
--- a/source4/lib/socket/SConscript
+++ b/source4/lib/socket/SConscript
@@ -1,5 +1,64 @@
+#!/usr/bin/env python
Import('hostenv')
+
+if hostenv['configure']:
+ conf = hostenv.Configure()
+ conf.CheckCHeader('sys/socket.h')
+ conf.CheckCHeader('sys/sockio.h')
+ conf.CheckCHeader('sys/un.h')
+ #HAVE_SOCK_SIN_LEN
+ conf.TryCompile("""
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+
+int main(void)
+{
+ struct sockaddr_in sock; sock.sin_len = sizeof(sock);
+ return 0;
+}""", '.c')
+
+ #HAVE_UNIXSOCKET
+ conf.TryCompile("""
+#include <sys/types.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <sys/socket.h>
+#include <sys/un.h>],
+
+int main(void)
+{
+ struct sockaddr_un sunaddr;
+ sunaddr.sun_family = AF_UNIX;
+ return 0;
+}""", '.c')
+
+ # HAVE_IPV6
+ conf.CheckFunc('gethostbyname2')
+
+ # 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.
+
+ connect_libs = []
+
+ if not conf.CheckFunc('connect'):
+ for l in ['nsl_s','nsl','socket','inet']:
+ if conf.CheckLib(l, 'connect'):
+ connect_libs.append(l)
+ break
+
+ # HAVE_WORKING_AF_LOCAL
+ # FIXME: Try compiling build/tests/unixsock.c
+
+
+ conf.Finish()
+
hostenv.StaticLibrary('socket_ipv4.c')
hostenv.StaticLibrary('socket_ipv6.c')
hostenv.StaticLibrary('socket_unix.c')
hostenv.StaticLibrary('socket', ['socket.c','access.c','connect.c'])
+