8 if conf
.CHECK_NSS_WRAPPER():
9 conf
.DEFINE('USING_SYSTEM_NSS_WRAPPER', 1)
10 libnss_wrapper_so_path
= 'libnss_wrapper.so'
12 conf
.CHECK_HEADERS('nss.h')
13 conf
.CHECK_HEADERS('gnu/lib-names.h')
15 if conf
.CONFIG_SET("HAVE___THREAD"):
16 conf
.DEFINE("HAVE_GCC_THREAD_LOCAL_STORAGE", 1)
18 # check HAVE_ATTRIBUTE_PRINTF_FORMAT
20 void log_fn(const char *format, ...) __attribute__ ((format (printf, 1, 2)));
26 'HAVE_ATTRIBUTE_PRINTF_FORMAT',
29 msg
='Checking for printf format validation support')
31 conf
.CHECK_FUNCS('gethostbyaddr_r gethostbyname_r')
32 conf
.CHECK_FUNCS('gethostbyname2 gethostbyname2_r')
34 conf
.CHECK_FUNCS('__posix_getpwnam_r __posix_getpwuid_r')
35 conf
.CHECK_FUNCS('__posix_getgrgid_r __posix_getgrnam_r')
37 conf
.CHECK_LIB('nsl socket')
38 conf
.CHECK_FUNCS_IN('gethostname',
44 conf
.CHECK_C_PROTOTYPE('getpwent_r',
45 'struct passwd *getpwent_r(struct passwd *src, char *buf, int buflen)',
46 define
='HAVE_SOLARIS_GETPWENT_R', headers
='unistd.h pwd.h')
47 conf
.CHECK_C_PROTOTYPE('getpwnam_r',
48 'int getpwnam_r(const char *name, struct passwd *pwd, char *buf, int buflen, struct passwd **ppwd)',
49 define
='HAVE_SOLARIS_GETPWNAM_R', headers
='unistd.h pwd.h')
50 conf
.CHECK_C_PROTOTYPE('getpwuid_r',
51 'int getpwuid_r(uid_t uid, struct passwd *pwd, char *buf, int buflen, struct passwd **ppwd)',
52 define
='HAVE_SOLARIS_GETPWUID_R', headers
='unistd.h pwd.h')
53 conf
.CHECK_C_PROTOTYPE('getgrent_r',
54 'struct group *getgrent_r(struct group *src, char *buf, int buflen)',
55 define
='HAVE_SOLARIS_GETGRENT_R', headers
='unistd.h grp.h')
56 conf
.CHECK_C_PROTOTYPE('getgrnam_r',
57 'int getgrnam_r(const char *name, struct group *grp, char *buf, int buflen, struct group **pgrp)',
58 define
='HAVE_SOLARIS_GETGRNAM_R', headers
='unistd.h grp.h')
59 conf
.CHECK_C_PROTOTYPE('getgrgid_r',
60 'int getgrgid_r(gid_t gid, struct group *grp, char *buf, int buflen, struct group **pgrp)',
61 define
='HAVE_SOLARIS_GETGRGID_R', headers
='unistd.h grp.h')
62 conf
.CHECK_C_PROTOTYPE('sethostent',
63 'int sethostent(int stayopen)',
64 define
='HAVE_SOLARIS_SETHOSTENT', headers
='unistd.h netdb.h')
65 conf
.CHECK_C_PROTOTYPE('endhostent',
66 'int endhostent(void)',
67 define
='HAVE_SOLARIS_ENDHOSTENT', headers
='unistd.h netdb.h')
68 conf
.CHECK_C_PROTOTYPE('gethostname',
69 'int gethostname(char *name, int len)',
70 define
='HAVE_SOLARIS_GETHOSTNAME', headers
='unistd.h netdb.h')
71 conf
.CHECK_C_PROTOTYPE('setgrent',
73 define
='HAVE_BSD_SETGRENT', headers
='unistd.h grp.h')
74 conf
.CHECK_C_PROTOTYPE('getnameinfo',
75 'int getnameinfo (const struct sockaddr *sa, socklen_t salen, char *host, socklen_t __hostlen, char *serv, socklen_t servlen, int flags)',
76 define
='HAVE_LINUX_GETNAMEINFO', headers
='unistd.h netdb.h')
77 conf
.CHECK_C_PROTOTYPE('getnameinfo',
78 'int getnameinfo (const struct sockaddr *sa, socklen_t salen, char *host, socklen_t __hostlen, char *serv, socklen_t servlen, unsigned int flags)',
79 define
='HAVE_LINUX_GETNAMEINFO_UNSIGNED', headers
='unistd.h netdb.h')
81 # Create full path to nss_wrapper
82 blddir
= os
.path
.realpath(conf
.bldnode
.abspath())
83 libnss_wrapper_so_path
= blddir
+ '/default/third_party/nss_wrapper/libnss-wrapper.so'
85 conf
.DEFINE('LIBNSS_WRAPPER_SO_PATH', libnss_wrapper_so_path
)
86 conf
.DEFINE('NSS_WRAPPER', 1)
89 if bld
.CONFIG_SET("HAVE_NSS_H") and not bld
.CONFIG_SET("USING_SYSTEM_NSS_WRAPPER"):
90 # We need to do it this way or the library wont work.
91 # We need force_unversioned=True as symbol versioning
93 bld
.SAMBA_LIBRARY('nss_wrapper',
94 source
='nss_wrapper.c nss_utils.c',
97 force_unversioned
=True,
98 realname
='libnss-wrapper.so')