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',
18 bld
.SAMBA_BINARY('b15464-testcase',
19 source
='b15464-testcase.c',
20 deps
='replace pthread dl',
24 # The nss_wrapper code relies strictly on the linux implementation and
25 # name, so compile but do not install a copy under this name.
26 bld
.SAMBA_PLUGIN('nss_wrapper_winbind',
27 cflags
='-D_PUBLIC_ON_LINUX_=_PUBLIC_',
28 source
='winbind_nss_linux.c',
30 realname
='libnss_wrapper_winbind.so.2',
34 # FIXME: original was *linux* | gnu* | k*bsd*-gnu | kopensolaris*-gnu)
35 # the search for .rfind('gnu') covers gnu* and *-gnu is that too broad?
37 if (Utils
.unversioned_sys_platform() == 'linux' or (host_os
.rfind('gnu') > -1)):
38 bld
.SAMBA_PLUGIN('nss_winbind',
40 cflags
='-D_PUBLIC_ON_LINUX_=_PUBLIC_',
41 source
='winbind_nss_linux.c',
43 realname
='libnss_winbind.so.2',
44 soname
='libnss_winbind.so.2',
47 bld
.SAMBA3_PLUGIN('nss_wins',
49 cflags
='-D_PUBLIC_ON_LINUX_=_PUBLIC_',
51 deps
='wbclient replace',
52 realname
='libnss_wins.so.2',
53 soname
='libnss_wins.so.2',
55 elif (host_os
.rfind('freebsd') > -1):
56 # FreeBSD winbind client is implemented as a wrapper around
58 bld
.SAMBA_PLUGIN('nss_winbind',
59 source
='winbind_nss_linux.c winbind_nss_freebsd.c',
61 realname
='nss_winbind.so.1',
64 bld
.SAMBA3_PLUGIN('nss_wins',
65 source
='wins.c wins_freebsd.c',
67 realname
='nss_wins.so.1',
70 elif (host_os
.rfind('netbsd') > -1):
71 # NetBSD winbind client is implemented as a wrapper
72 # around the Linux version. It needs getpwent_r() to
73 # indicate libc's use of the correct nsdispatch API.
75 if bld
.CONFIG_SET("HAVE_GETPWENT_R"):
76 bld
.SAMBA_PLUGIN('nss_winbind',
77 source
='winbind_nss_linux.c winbind_nss_netbsd.c',
79 realname
='libnss_winbind.so')
80 elif Utils
.unversioned_sys_platform() == 'sunos':
81 bld
.SAMBA_PLUGIN('nss_winbind',
82 source
='winbind_nss_solaris.c winbind_nss_linux.c',
84 realname
='nss_winbind.so.1',
86 elif (host_os
.rfind('hpux') > -1):
87 bld
.SAMBA_PLUGIN('nss_winbind',
88 source
='winbind_nss_linux.c',
90 realname
='libnss_winbind.so')
91 elif (host_os
.rfind('aix') > -1):
92 bld
.SAMBA_PLUGIN('nss_winbind',
93 source
='winbind_nss_aix.c',
97 if bld
.CONFIG_SET('WITH_PAM_MODULES') and bld
.CONFIG_SET('HAVE_PAM_START'):
98 bld
.SAMBA_PLUGIN('pamwinbind',
99 source
='pam_winbind.c',
100 deps
='talloc wbclient tiniparser pam samba_intl',
101 cflags
='-DLOCALEDIR=\"%s/locale\"' % bld
.env
.DATADIR
,
102 realname
='pam_winbind.so',
103 install_path
='${PAMMODULESDIR}'
106 if bld
.CONFIG_GET("USING_SYSTEM_KRB5"):
107 # If we build locator plugins for a
108 # system library we should use builtin
109 # linking of our own subsystems,
110 # while we may link to the system
112 winbind_krb5_require_builtin_deps
= True
114 # If we build locator plugins for our own heimdal
115 # version we don't want to do builtin linking.
116 # As we're already using private libraries
117 # it's not a problem...
118 winbind_krb5_require_builtin_deps
= False
120 if bld
.CONFIG_SET('HAVE_KRB5_LOCATE_PLUGIN_H'):
121 bld
.SAMBA_PLUGIN('winbind_krb5_locator',
122 source
='krb5_plugin/winbind_krb5_locator.c',
123 deps
='wbclient krb5 com_err',
124 require_builtin_deps
=winbind_krb5_require_builtin_deps
,
125 realname
='winbind_krb5_locator.so',
126 install_path
='${MODULESDIR}/krb5')
128 if bld
.CONFIG_SET('HAVE_KRB5_LOCATE_PLUGIN_H'):
129 # libkrb5.so scans it's plugin directories for files
130 # and calls dlopen()/dlsym() on them. The actual path
131 # depends on MIT vs. Heimdal.
133 # The async_dns_krb5_locator don't use winbind,
134 # instead it uses almost all of samba directly,
135 # which means everything will be injected
136 # into all processes using the libkrb5.so.
138 # See https://bugzilla.samba.org/show_bug.cgi?id=14780
139 # why this is a bad idea.
141 # We install this plugin (and also the other krb5 plugins)
142 # under Samba's MODULESDIR, it's not available to
143 # libkrb5.so by default.
145 # Packagers should leave it that way and allow admins
146 # to create symlinks for the plugins they actually want
148 bld
.SAMBA_PLUGIN('async_dns_krb5_locator',
149 source
='krb5_plugin/async_dns_krb5_locator.c',
161 require_builtin_deps
=False,
162 realname
='async_dns_krb5_locator.so',
163 install_path
='${MODULESDIR}/krb5')
165 if bld
.CONFIG_SET('HAVE_KRB5_LOCALAUTH_PLUGIN_H'):
166 bld
.SAMBA_PLUGIN('winbind_krb5_localauth',
167 source
='krb5_plugin/winbind_krb5_localauth.c',
168 deps
='wbclient krb5 com_err',
169 require_builtin_deps
=winbind_krb5_require_builtin_deps
,
170 realname
='winbind_krb5_localauth.so',
171 install_path
='${MODULESDIR}/krb5')
173 bld
.SAMBA_SUBSYSTEM('WB_REQTRANS',
174 source
='wb_reqtrans.c',
175 deps
='talloc tevent LIBASYNC_REQ'
178 bld
.SAMBA_BINARY('wbinfo',
180 deps
='samba-util LIBCLI_AUTH popt cmdline wbclient LIBAFS_SETTOKEN'