smbd: Simplify find_oplock_types a bit
[Samba/wip.git] / nsswitch / wscript_build
blob55ba776e5d72801566a4db1e7657d9b752cb8c87
1 #!/usr/bin/env python
2 import Utils
3 import sys
4 host_os = sys.platform
6 bld.SAMBA_LIBRARY('winbind-client',
7 source='wb_common.c',
8 deps='replace',
9 cflags='-DSOCKET_WRAPPER_DISABLE=1 -DWINBINDD_SOCKET_DIR=\"%s\"' % bld.env.WINBINDD_SOCKET_DIR,
10 private_library=True
14 bld.SAMBA_BINARY('nsstest',
15 source='nsstest.c',
16 deps='replace dl',
17 install=False
20 # The nss_wrapper code relies strictly on the linux implementation and
21 # name, so compile but do not install a copy under this name.
22 bld.SAMBA_LIBRARY('nss_wrapper_winbind',
23 source='winbind_nss_linux.c',
24 deps='winbind-client',
25 realname='libnss_wrapper_winbind.so.2',
26 install=False,
27 vnum='2')
29 # FIXME: original was *linux* | gnu* | k*bsd*-gnu | kopensolaris*-gnu)
30 # the search for .rfind('gnu') covers gnu* and *-gnu is that too broad?
32 if (Utils.unversioned_sys_platform() == 'linux' or (host_os.rfind('gnu') > -1)):
33 bld.SAMBA_LIBRARY('nss_winbind',
34 source='winbind_nss_linux.c',
35 deps='winbind-client',
36 realname='libnss_winbind.so.2',
37 soname='libnss_winbind.so',
38 vnum='2')
39 elif (host_os.rfind('freebsd') > -1):
40 # FreeBSD winbind client is implemented as a wrapper around
41 # the Linux version.
42 bld.SAMBA_LIBRARY('nss_winbind',
43 source='winbind_nss_linux.c winbind_nss_freebsd.c',
44 deps='winbind-client',
45 realname='nss_winbind.so.1',
46 vnum='1')
48 elif (host_os.rfind('netbsd') > -1):
49 # NetBSD winbind client is implemented as a wrapper
50 # around the Linux version. It needs getpwent_r() to
51 # indicate libc's use of the correct nsdispatch API.
53 if bld.CONFIG_SET("HAVE_GETPWENT_R"):
54 bld.SAMBA_LIBRARY('nss_winbind',
55 source='winbind_nss_linux.c winbind_nss_netbsd.c',
56 deps='winbind-client',
57 realname='libnss_winbind.so')
58 elif (host_os.rfind('irix') > -1):
59 bld.SAMBA_LIBRARY('ns_winbind',
60 source='winbind_nss_irix.c',
61 deps='winbind-client',
62 realname='libns_winbind.so')
64 elif Utils.unversioned_sys_platform() == 'sunos':
65 bld.SAMBA_LIBRARY('nss_winbind',
66 source='winbind_nss_solaris.c winbind_nss_linux.c',
67 deps='winbind-client',
68 realname='nss_winbind.so.1',
69 vnum='1')
70 elif (host_os.rfind('hpux') > -1):
71 bld.SAMBA_LIBRARY('nss_winbind',
72 source='winbind_nss_linux.c',
73 deps='winbind-client',
74 realname='libnss_winbind.so')
75 elif (host_os.rfind('aix') > -1):
76 bld.SAMBA_LIBRARY('nss_winbind',
77 source='winbind_nss_aix.c',
78 deps='winbind-client',
79 realname='libnss_winbind.so')
81 if bld.CONFIG_SET('WITH_PAM_MODULES') and bld.CONFIG_SET('HAVE_PAM_START'):
82 bld.SAMBA_LIBRARY('pamwinbind',
83 source='pam_winbind.c',
84 deps='talloc wbclient winbind-client iniparser pam samba_intl',
85 cflags='-DLOCALEDIR=\"%s/locale\"' % bld.env.DATADIR,
86 realname='pam_winbind.so',
87 install_path='${PAMMODULESDIR}'
90 if bld.CONFIG_SET('HAVE_KRB5_LOCATE_PLUGIN_H'):
91 bld.SAMBA_LIBRARY('winbind_krb5_locator',
92 source='winbind_krb5_locator.c',
93 deps='wbclient krb5 com_err',
94 realname='winbind_krb5_locator.so')
96 bld.SAMBA_SUBSYSTEM('WB_REQTRANS',
97 source='wb_reqtrans.c',
98 deps='talloc tevent LIBASYNC_REQ'
101 bld.SAMBA_BINARY('wbinfo',
102 source='wbinfo.c',
103 deps='samba-util LIBCLI_AUTH popt POPT_SAMBA wbclient LIBAFS_SETTOKEN'