9 if conf
.CHECK_BUNDLED_SYSTEM('uid_wrapper', minversion
=VERSION
, set_target
=False):
10 conf
.DEFINE('USING_SYSTEM_UID_WRAPPER', 1)
11 libuid_wrapper_so_path
= 'libuid_wrapper.so'
13 # check HAVE_GCC_ATOMIC_BUILTINS
19 __atomic_load(p_x, &x, __ATOMIC_RELAXED);
22 'HAVE_GCC_ATOMIC_BUILTINS',
24 msg
='Checking for atomic builtins')
26 # check HAVE_GCC_THREAD_LOCAL_STORAGE
34 'HAVE_GCC_THREAD_LOCAL_STORAGE',
36 msg
='Checking for thread local storage')
38 # check HAVE_CONSTRUCTOR_ATTRIBUTE
40 void test_constructor_attribute(void) __attribute__ ((constructor));
42 void test_constructor_attribute(void)
51 'HAVE_CONSTRUCTOR_ATTRIBUTE',
53 msg
='Checking for library constructor support')
55 # check HAVE_DESTRUCTOR_ATTRIBUTE
57 void test_destructor_attribute(void) __attribute__ ((destructor));
59 void test_destructor_attribute(void)
68 'HAVE_DESTRUCTOR_ATTRIBUTE',
70 msg
='Checking for library destructor support')
72 if Options
.options
.address_sanitizer
:
73 # check HAVE_ADDRESS_SANITIZER_ATTRIBUTE
75 void test_address_sanitizer_attribute(void) __attribute__((no_sanitize_address));
77 void test_address_sanitizer_attribute(void)
86 'HAVE_ADDRESS_SANITIZER_ATTRIBUTE',
88 cflags
='-Wall -Wextra -Werror',
89 msg
='Checking for address sanitizer attribute')
91 # check HAVE_FUNCTION_ATTRIBUTE_FORMAT
93 void log_fn(const char *format, ...) __attribute__ ((format (printf, 1, 2)));
99 'HAVE_FUNCTION_ATTRIBUTE_FORMAT',
101 msg
='Checking for printf format validation support')
103 conf
.CHECK_C_PROTOTYPE('setgroups',
104 'int setgroups(int ngroups, const gid_t *grouplist)',
105 define
='HAVE_SETGROUPS_INT', headers
='unistd.h sys/types.h')
106 conf
.CHECK_C_PROTOTYPE('syscall',
107 'int syscall(int number, ...)',
108 define
='HAVE_SYSCALL_INT', headers
='unistd.h sys/syscall.h')
110 conf
.CHECK_FUNCS('getresuid getresgid')
112 # Create full path to uid_wrapper
113 srcdir
= os
.path
.realpath(conf
.srcdir
)
114 libuid_wrapper_so_path
= srcdir
+ '/bin/default/lib/uid_wrapper/libuid-wrapper.so'
116 conf
.DEFINE('LIBUID_WRAPPER_SO_PATH', libuid_wrapper_so_path
)
117 conf
.DEFINE('UID_WRAPPER', 1)
120 if not bld
.CONFIG_SET("USING_SYSTEM_UID_WRAPPER"):
121 # We need to do it this way or the library wont work.
122 # Using private_library=True will add symbol version which
124 bld
.SAMBA_LIBRARY('uid_wrapper',
125 source
='uid_wrapper.c',
129 realname
='libuid-wrapper.so')