1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
samba-mirror/third_party/nss_wrapper/wscript
Stefan Metzmacher 6f8c1b6736 third_party/*_wrapper/wscript: remove redundant configure checks
HAVE___THREAD and HAVE_DESTRUCTOR_ATTRIBUTE are already checked
as part of Samba.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2018-07-24 17:38:26 +02:00

95 lines
4.8 KiB
Python

#!/usr/bin/env python
import os
VERSION="1.1.3"
def configure(conf):
if conf.CHECK_NSS_WRAPPER():
conf.DEFINE('USING_SYSTEM_NSS_WRAPPER', 1)
libnss_wrapper_so_path = 'libnss_wrapper.so'
else:
conf.CHECK_HEADERS('nss.h')
if conf.CONFIG_SET("HAVE___THREAD"):
conf.DEFINE("HAVE_GCC_THREAD_LOCAL_STORAGE", 1)
# check HAVE_ATTRIBUTE_PRINTF_FORMAT
conf.CHECK_CODE('''
void log_fn(const char *format, ...) __attribute__ ((format (printf, 1, 2)));
int main(void) {
return 0;
}
''',
'HAVE_ATTRIBUTE_PRINTF_FORMAT',
addmain=False,
strict=True,
msg='Checking for printf format validation support')
conf.CHECK_FUNCS('gethostbyaddr_r gethostbyname_r')
# Solaris
conf.CHECK_FUNCS('__posix_getpwnam_r __posix_getpwuid_r')
conf.CHECK_FUNCS('__posix_getgrgid_r __posix_getgrnam_r')
conf.CHECK_FUNCS_IN('nsl',
'gethostname',
checklibc=True,
headers='unistd.h')
# Prototype checks
conf.CHECK_C_PROTOTYPE('getpwent_r',
'struct passwd *getpwent_r(struct passwd *src, char *buf, int buflen)',
define='HAVE_SOLARIS_GETPWENT_R', headers='unistd.h pwd.h')
conf.CHECK_C_PROTOTYPE('getpwnam_r',
'int getpwnam_r(const char *name, struct passwd *pwd, char *buf, int buflen, struct passwd **ppwd)',
define='HAVE_SOLARIS_GETPWNAM_R', headers='unistd.h pwd.h')
conf.CHECK_C_PROTOTYPE('getpwuid_r',
'int getpwuid_r(uid_t uid, struct passwd *pwd, char *buf, int buflen, struct passwd **ppwd)',
define='HAVE_SOLARIS_GETPWUID_R', headers='unistd.h pwd.h')
conf.CHECK_C_PROTOTYPE('getgrent_r',
'struct group *getgrent_r(struct group *src, char *buf, int buflen)',
define='HAVE_SOLARIS_GETGRENT_R', headers='unistd.h grp.h')
conf.CHECK_C_PROTOTYPE('getgrnam_r',
'int getgrnam_r(const char *name, struct group *grp, char *buf, int buflen, struct group **pgrp)',
define='HAVE_SOLARIS_GETGRNAM_R', headers='unistd.h grp.h')
conf.CHECK_C_PROTOTYPE('getgrgid_r',
'int getgrgid_r(gid_t gid, struct group *grp, char *buf, int buflen, struct group **pgrp)',
define='HAVE_SOLARIS_GETGRGID_R', headers='unistd.h grp.h')
conf.CHECK_C_PROTOTYPE('sethostent',
'int sethostent(int stayopen)',
define='HAVE_SOLARIS_SETHOSTENT', headers='unistd.h netdb.h')
conf.CHECK_C_PROTOTYPE('endhostent',
'int endhostent(void)',
define='HAVE_SOLARIS_ENDHOSTENT', headers='unistd.h netdb.h')
conf.CHECK_C_PROTOTYPE('gethostname',
'int gethostname(char *name, int len)',
define='HAVE_SOLARIS_GETHOSTNAME', headers='unistd.h netdb.h')
conf.CHECK_C_PROTOTYPE('setgrent',
'int setgrent(void)',
define='HAVE_BSD_SETGRENT', headers='unistd.h grp.h')
conf.CHECK_C_PROTOTYPE('getnameinfo',
'int getnameinfo (const struct sockaddr *sa, socklen_t salen, char *host, socklen_t __hostlen, char *serv, socklen_t servlen, int flags)',
define='HAVE_LINUX_GETNAMEINFO', headers='unistd.h netdb.h')
conf.CHECK_C_PROTOTYPE('getnameinfo',
'int getnameinfo (const struct sockaddr *sa, socklen_t salen, char *host, socklen_t __hostlen, char *serv, socklen_t servlen, unsigned int flags)',
define='HAVE_LINUX_GETNAMEINFO_UNSIGNED', headers='unistd.h netdb.h')
# Create full path to nss_wrapper
blddir = os.path.realpath(conf.blddir)
libnss_wrapper_so_path = blddir + '/default/third_party/nss_wrapper/libnss-wrapper.so'
conf.DEFINE('LIBNSS_WRAPPER_SO_PATH', libnss_wrapper_so_path)
conf.DEFINE('NSS_WRAPPER', 1)
def build(bld):
if bld.CONFIG_SET("HAVE_NSS_H") and not bld.CONFIG_SET("USING_SYSTEM_NSS_WRAPPER"):
# We need to do it this way or the library wont work.
# Using private_library=True will add symbol version which
# breaks preloading!
bld.SAMBA_LIBRARY('nss_wrapper',
source='nss_wrapper.c',
deps='dl',
install=False,
realname='libnss-wrapper.so')