8 if conf
.CHECK_BUNDLED_SYSTEM('socket_wrapper', minversion
=VERSION
, set_target
=False):
9 conf
.DEFINE('USING_SYSTEM_SOCKET_WRAPPER', 1)
10 libsocket_wrapper_so_path
= 'libsocket_wrapper.so'
12 # check HAVE_GCC_THREAD_LOCAL_STORAGE
20 'HAVE_GCC_THREAD_LOCAL_STORAGE',
22 msg
='Checking for thread local storage')
24 # check HAVE_DESTRUCTOR_ATTRIBUTE
26 void test_destructor_attribute(void) __attribute__ ((destructor));
28 void test_destructor_attribute(void)
37 'HAVE_DESTRUCTOR_ATTRIBUTE',
39 msg
='Checking for library destructor support')
41 # check HAVE_FUNCTION_ATTRIBUTE_FORMAT
43 void log_fn(const char *format, ...) __attribute__ ((format (printf, 1, 2)));
49 'HAVE_FUNCTION_ATTRIBUTE_FORMAT',
51 msg
='Checking for printf format validation support')
53 conf
.CHECK_HEADERS('sys/signalfd.h')
54 conf
.CHECK_HEADERS('sys/eventfd.h')
55 conf
.CHECK_HEADERS('sys/timerfd.h')
56 conf
.CHECK_HEADERS('gnu/lib-names.h')
57 conf
.CHECK_HEADERS('rpc/rpc.h')
59 conf
.CHECK_STRUCTURE_MEMBER('struct msghdr',
61 headers
='sys/types.h sys/socket.h',
62 define
='HAVE_STRUCT_MSGHDR_MSG_CONTROL')
64 conf
.CHECK_STRUCTURE_MEMBER('struct in_pktinfo',
66 headers
='sys/types.h sys/socket.h netinet/in.h',
67 define
='HAVE_STRUCT_IN_PKTINFO')
69 conf
.CHECK_STRUCTURE_MEMBER('struct in6_pktinfo',
71 headers
='sys/types.h sys/socket.h netinet/in.h',
72 define
='HAVE_STRUCT_IN6_PKTINFO')
74 conf
.CHECK_FUNCS('getaddrinfo')
75 conf
.CHECK_FUNCS('signalfd eventfd timerfd_create')
76 conf
.CHECK_FUNCS('bindresvport')
78 conf
.CHECK_FUNCS_IN('bind',
81 headers
='sys/types.h sys/socket.h')
83 conf
.CHECK_C_PROTOTYPE('accept',
84 'int accept(int s, struct sockaddr *addr, Psocklen_t addrlen)',
85 define
='HAVE_ACCEPT_PSOCKLEN_T', headers
='sys/types.h sys/socket.h')
87 conf
.CHECK_C_PROTOTYPE('ioctl',
88 'int ioctl(int s, int r, ...)',
89 define
='HAVE_IOCTL_INT', headers
='unistd.h sys/ioctl.h')
91 if conf
.CONFIG_SET("HAVE_EVENTFD"):
92 conf
.CHECK_C_PROTOTYPE('eventfd',
93 'int eventfd(unsigned int count, int flags)',
94 define
='HAVE_EVENTFD_UNSIGNED_INT', headers
='sys/eventfd.h')
96 # Create full path to socket_wrapper
97 srcdir
= os
.path
.realpath(conf
.srcdir
)
98 libsocket_wrapper_so_path
= srcdir
+ '/bin/default/lib/socket_wrapper/libsocket-wrapper.so'
100 conf
.DEFINE('LIBSOCKET_WRAPPER_SO_PATH', libsocket_wrapper_so_path
)
101 conf
.DEFINE('SOCKET_WRAPPER', 1)
104 if not bld
.CONFIG_SET("USING_SYSTEM_SOCKET_WRAPPER"):
105 # We need to do it this way or the library wont work.
106 # Using private_library=True will add symbol version which
108 bld
.SAMBA_LIBRARY('socket_wrapper',
109 source
='socket_wrapper.c',
113 realname
='libsocket-wrapper.so')