2 from waflib
import Utils
6 bld
.SAMBA_BINARY('nsstest',
12 if bld
.CONFIG_SET('HAVE_PTHREAD'):
13 bld
.SAMBA_BINARY('stress-nss-libwbclient',
14 source
='stress-nss-libwbclient.c',
15 deps
='wbclient pthread',
19 # The nss_wrapper code relies strictly on the linux implementation and
20 # name, so compile but do not install a copy under this name.
21 bld
.SAMBA_PLUGIN('nss_wrapper_winbind',
22 cflags
='-D_PUBLIC_ON_LINUX_=_PUBLIC_',
23 source
='winbind_nss_linux.c',
25 realname
='libnss_wrapper_winbind.so.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_PLUGIN('nss_winbind',
35 cflags
='-D_PUBLIC_ON_LINUX_=_PUBLIC_',
36 source
='winbind_nss_linux.c',
38 realname
='libnss_winbind.so.2',
39 soname
='libnss_winbind.so.2',
42 bld
.SAMBA3_PLUGIN('nss_wins',
44 cflags
='-D_PUBLIC_ON_LINUX_=_PUBLIC_',
46 deps
='wbclient replace',
47 realname
='libnss_wins.so.2',
48 soname
='libnss_wins.so.2',
50 elif (host_os
.rfind('freebsd') > -1):
51 # FreeBSD winbind client is implemented as a wrapper around
53 bld
.SAMBA_PLUGIN('nss_winbind',
54 source
='winbind_nss_linux.c winbind_nss_freebsd.c',
56 realname
='nss_winbind.so.1',
59 bld
.SAMBA3_PLUGIN('nss_wins',
60 source
='wins.c wins_freebsd.c',
62 realname
='nss_wins.so.1',
65 elif (host_os
.rfind('netbsd') > -1):
66 # NetBSD winbind client is implemented as a wrapper
67 # around the Linux version. It needs getpwent_r() to
68 # indicate libc's use of the correct nsdispatch API.
70 if bld
.CONFIG_SET("HAVE_GETPWENT_R"):
71 bld
.SAMBA_PLUGIN('nss_winbind',
72 source
='winbind_nss_linux.c winbind_nss_netbsd.c',
74 realname
='libnss_winbind.so')
75 elif Utils
.unversioned_sys_platform() == 'sunos':
76 bld
.SAMBA_PLUGIN('nss_winbind',
77 source
='winbind_nss_solaris.c winbind_nss_linux.c',
79 realname
='nss_winbind.so.1',
81 elif (host_os
.rfind('hpux') > -1):
82 bld
.SAMBA_PLUGIN('nss_winbind',
83 source
='winbind_nss_linux.c',
85 realname
='libnss_winbind.so')
86 elif (host_os
.rfind('aix') > -1):
87 bld
.SAMBA_PLUGIN('nss_winbind',
88 source
='winbind_nss_aix.c',
92 if bld
.CONFIG_SET('WITH_PAM_MODULES') and bld
.CONFIG_SET('HAVE_PAM_START'):
93 bld
.SAMBA_PLUGIN('pamwinbind',
94 source
='pam_winbind.c',
95 deps
='talloc wbclient tiniparser pam samba_intl',
96 cflags
='-DLOCALEDIR=\"%s/locale\"' % bld
.env
.DATADIR
,
97 realname
='pam_winbind.so',
98 install_path
='${PAMMODULESDIR}'
101 if bld
.CONFIG_GET("USING_SYSTEM_KRB5"):
102 # If we build locator plugins for a
103 # system library we should use builtin
104 # linking of our own subsystems,
105 # while we may link to the system
107 winbind_krb5_require_builtin_deps
= True
109 # If we build locator plugins for our own heimdal
110 # version we don't want to do builtin linking.
111 # As we're already using private libraries
112 # it's not a problem...
113 winbind_krb5_require_builtin_deps
= False
115 if bld
.CONFIG_SET('HAVE_KRB5_LOCATE_PLUGIN_H'):
116 bld
.SAMBA_PLUGIN('winbind_krb5_locator',
117 source
='krb5_plugin/winbind_krb5_locator.c',
118 deps
='wbclient krb5 com_err',
119 require_builtin_deps
=winbind_krb5_require_builtin_deps
,
120 realname
='winbind_krb5_locator.so',
121 install_path
='${MODULESDIR}/krb5')
123 if bld
.CONFIG_SET('HAVE_KRB5_LOCATE_PLUGIN_H'):
124 # libkrb5.so scans it's plugin directories for files
125 # and calls dlopen()/dlsym() on them. The actual path
126 # depends on MIT vs. Heimdal.
128 # The async_dns_krb5_locator don't use winbind,
129 # instead it uses almost all of samba directly,
130 # which means everything will be injected
131 # into all processes using the libkrb5.so.
133 # See https://bugzilla.samba.org/show_bug.cgi?id=14780
134 # why this is a bad idea.
136 # We install this plugin (and also the other krb5 plugins)
137 # under Samba's MODULESDIR, it's not available to
138 # libkrb5.so by default.
140 # Packagers should leave it that way and allow admins
141 # to create symlinks for the plugins they actually want
143 bld
.SAMBA_PLUGIN('async_dns_krb5_locator',
144 source
='krb5_plugin/async_dns_krb5_locator.c',
156 require_builtin_deps
=False,
157 realname
='async_dns_krb5_locator.so',
158 install_path
='${MODULESDIR}/krb5')
160 if bld
.CONFIG_SET('HAVE_KRB5_LOCALAUTH_PLUGIN_H'):
161 bld
.SAMBA_PLUGIN('winbind_krb5_localauth',
162 source
='krb5_plugin/winbind_krb5_localauth.c',
163 deps
='wbclient krb5 com_err',
164 require_builtin_deps
=winbind_krb5_require_builtin_deps
,
165 realname
='winbind_krb5_localauth.so',
166 install_path
='${MODULESDIR}/krb5')
168 bld
.SAMBA_SUBSYSTEM('WB_REQTRANS',
169 source
='wb_reqtrans.c',
170 deps
='talloc tevent LIBASYNC_REQ'
173 bld
.SAMBA_BINARY('wbinfo',
175 deps
='samba-util LIBCLI_AUTH popt cmdline wbclient LIBAFS_SETTOKEN'