48ba1151a69efef6a8b4b0d923d7e019fc277b01
[samba.git] / source4 / librpc / wscript_build
1 #!/usr/bin/env python
2
3 bld.RECURSE('../../librpc/idl')
4 bld.RECURSE('../../librpc/tools')
5 bld.RECURSE('idl')
6
7
8 bld.SAMBA_SUBSYSTEM('NDR_WINSTATION',
9         source='gen_ndr/ndr_winstation.c',
10         public_deps='ndr'
11         )
12
13
14 bld.SAMBA_SUBSYSTEM('NDR_IRPC',
15         source='gen_ndr/ndr_irpc.c',
16         public_deps='ndr NDR_SECURITY ndr_nbt'
17         )
18
19
20 bld.SAMBA_SUBSYSTEM('NDR_SASL_HELPERS',
21         source='gen_ndr/ndr_sasl_helpers.c',
22         public_deps='ndr'
23         )
24
25
26
27 bld.SAMBA_SUBSYSTEM('NDR_WINSIF',
28         source='gen_ndr/ndr_winsif.c',
29         public_deps='ndr'
30         )
31
32
33 bld.SAMBA_SUBSYSTEM('NDR_OPENDB',
34         source='gen_ndr/ndr_opendb.c',
35         public_deps='ndr'
36         )
37
38
39 bld.SAMBA_SUBSYSTEM('NDR_NTP_SIGND',
40         source='gen_ndr/ndr_ntp_signd.c',
41         public_deps='ndr'
42         )
43
44
45 bld.SAMBA_SUBSYSTEM('NDR_WINSREPL',
46         source='gen_ndr/ndr_winsrepl.c',
47         public_deps='ndr ndr_nbt'
48         )
49
50
51 # create a grouping library to consolidate our samba4 specific NDR code
52 bld.SAMBA_LIBRARY('ndr-samba4',
53         source=[],
54         deps='NDR_WINBIND NDR_IRPC NDR_NFS4ACL NDR_OPENDB ndr-table',
55         private_library=True,
56         grouping_library=True
57         )
58
59 # a grouping library for RPC_NDR subsystems that may be used by more than one target
60 bld.SAMBA_LIBRARY('dcerpc-samba4',
61         source=[],
62         deps='RPC_NDR_WINBIND',
63         private_library=True,
64         grouping_library=True
65         )
66
67
68 bld.SAMBA_PIDL_TABLES('GEN_NDR_TABLES', 'gen_ndr/tables.c')
69
70 bld.SAMBA_SUBSYSTEM('ndr-table',
71         source='../../librpc/ndr/ndr_table.c gen_ndr/tables.c',
72         public_deps='''
73                     ndr-standard
74                     NDR_AUDIOSRV
75                     NDR_DSBACKUP
76                     NDR_EFS
77                     NDR_DRSUAPI
78                     NDR_POLICYAGENT
79                     NDR_UNIXINFO
80                     NDR_SPOOLSS
81                     NDR_EPMAPPER
82                     NDR_DBGIDL
83                     NDR_DSSETUP
84                     NDR_MSGSVC
85                     NDR_WINSIF
86                     NDR_MGMT
87                     NDR_OXIDRESOLVER
88                     NDR_REMACT
89                     NDR_WZCSVC
90                     NDR_BROWSER
91                     NDR_W32TIME
92                     NDR_SCERPC
93                     NDR_TRKWKS
94                     NDR_KEYSVC
95                     ndr-krb5pac
96                     NDR_SCHANNEL
97                     NDR_ROT
98                     NDR_DRSBLOBS
99                     ndr_nbt
100                     NDR_WINSREPL
101                     NDR_SECURITY
102                     NDR_DNSSERVER
103                     NDR_WINSTATION
104                     NDR_IRPC
105                     NDR_OPENDB
106                     NDR_SASL_HELPERS
107                     NDR_NOTIFY
108                     NDR_WINBIND
109                     NDR_FRSRPC
110                     NDR_FRSAPI
111                     NDR_FRSTRANS
112                     NDR_NTP_SIGND
113                     NDR_DCOM
114                     NDR_WMI
115                     NDR_NAMED_PIPE_AUTH
116                     NDR_NTLMSSP
117                     NDR_DFSBLOBS
118                     NDR_DNSP
119                     NDR_NTPRINTING
120                     NDR_DNS
121                     NDR_BACKUPKEY
122                     NDR_PREG
123                     NDR_BKUPBLOBS
124                     NDR_FSCC
125                     NDR_FRSBLOBS
126                     NDR_CLUSAPI
127                     NDR_WINSPOOL
128                     NDR_CAB
129                     ''',
130         depends_on='GEN_NDR_TABLES'
131         )
132
133
134 bld.SAMBA_SUBSYSTEM('RPC_NDR_IRPC',
135         source='gen_ndr/ndr_irpc_c.c',
136         public_deps='dcerpc NDR_IRPC'
137         )
138
139 bld.SAMBA_LIBRARY('dcerpc-samr',
140         source='',
141         pc_files='dcerpc_samr.pc',
142         vnum='0.0.1',
143         public_deps='dcerpc ndr-standard RPC_NDR_SAMR',
144         public_headers='../../librpc/gen_ndr/ndr_samr_c.h',
145         header_path='gen_ndr'
146         )
147
148 bld.SAMBA_SUBSYSTEM('RPC_NDR_WINSIF',
149         source='gen_ndr/ndr_winsif_c.c',
150         public_deps='dcerpc NDR_WINSIF'
151         )
152
153
154 bld.SAMBA_LIBRARY('dcerpc',
155         source='''rpc/dcerpc.c rpc/dcerpc_auth.c rpc/dcerpc_schannel.c
156         rpc/dcerpc_util.c rpc/dcerpc_smb.c rpc/dcerpc_sock.c
157         rpc/dcerpc_roh_channel_in.c rpc/dcerpc_roh_channel_out.c rpc/dcerpc_roh.c
158         rpc/dcerpc_connect.c rpc/dcerpc_secondary.c''',
159         pc_files='dcerpc.pc',
160         deps='samba_socket LIBCLI_RESOLVE LIBCLI_SMB LIBCLI_SMB2 ndr NDR_DCERPC RPC_NDR_EPMAPPER NDR_SCHANNEL RPC_NDR_NETLOGON RPC_NDR_MGMT gensec LIBCLI_AUTH smbclient-raw LP_RESOLVE tevent-util dcerpc-binding param_options http',
161         autoproto='rpc/dcerpc_proto.h',
162         public_deps='samba-credentials tevent talloc',
163         public_headers='''rpc/dcerpc.h''',
164         # It's very important to keep this form of construction
165         # it force the sambawaf extension to put everything that match the first element
166         # (*gen_ndr*) into the dir named by the second element (gen_ndr).
167         # If we just put header_path = 'gen_ndr' then all the public_headers will go
168         # in 'gen_ndr' and for dcerpc.h (at least) it will cause a problem as
169         # we have already a dcerpc.h installed by librpc/wscript_build
170         # and one will overright the other which is not what we expect.
171         header_path=[ ('*gen_ndr*', 'gen_ndr') ],
172         vnum='0.0.1'
173         )
174
175 gen_cflags = ''
176 if bld.CONFIG_SET('HAVE_WNO_UNUSED_FUNCTION'):
177     gen_cflags = '-Wno-unused-function'
178
179 for env in bld.gen_python_environments():
180         pyrpc_util = bld.pyembed_libname('pyrpc_util')
181         pytalloc_util = bld.pyembed_libname('pytalloc-util')
182         pyparam_util = bld.pyembed_libname('pyparam_util')
183
184         bld.SAMBA_SUBSYSTEM(pyrpc_util,
185                 source='rpc/pyrpc_util.c',
186                 public_deps='%s %s dcerpc MESSAGING' % (pytalloc_util, pyparam_util),
187                 pyext=True,
188                 enabled=bld.PYTHON_BUILD_IS_ENABLED(),
189                 )
190
191         bld.SAMBA_PYTHON('python_dcerpc',
192                 source='rpc/pyrpc.c',
193                 public_deps='LIBCLI_SMB samba-util samba-hostconfig dcerpc-samr RPC_NDR_LSA DYNCONFIG %s gensec' % pyrpc_util,
194                 realname='samba/dcerpc/base.so',
195                 cflags_end=gen_cflags
196                 )
197
198         bld.SAMBA_PYTHON('python_dcerpc_misc',
199                 source='../../librpc/gen_ndr/py_misc.c',
200                 deps='%s %s ndr-krb5pac' % (pytalloc_util, pyrpc_util),
201                 realname='samba/dcerpc/misc.so',
202                 cflags_end=gen_cflags
203                 )
204
205         bld.SAMBA_PYTHON('python_auth',
206                 source='../../librpc/gen_ndr/py_auth.c',
207                 deps='NDR_AUTH %s %s' % (pytalloc_util, pyrpc_util),
208                 realname='samba/dcerpc/auth.so',
209                 cflags_end=gen_cflags
210                 )
211
212         bld.SAMBA_PYTHON('python_dcerpc_security',
213                 source='../../librpc/gen_ndr/py_security.c',
214                 deps='%s %s NDR_SECURITY' % (pytalloc_util, pyrpc_util),
215                 realname='samba/dcerpc/security.so',
216                 cflags_end=gen_cflags
217                 )
218
219         bld.SAMBA_PYTHON('python_lsa',
220                 source='../../librpc/gen_ndr/py_lsa.c',
221                 deps='RPC_NDR_LSA %s %s' % (pytalloc_util, pyrpc_util),
222                 realname='samba/dcerpc/lsa.so',
223                 cflags_end=gen_cflags
224                 )
225
226         bld.SAMBA_PYTHON('python_krb5pac',
227                 source='../../librpc/gen_ndr/py_krb5pac.c',
228                 deps='ndr-krb5pac %s %s' % (pytalloc_util, pyrpc_util),
229                 realname='samba/dcerpc/krb5pac.so',
230                 cflags_end=gen_cflags
231                 )
232
233         bld.SAMBA_PYTHON('python_netlogon',
234                 source='../../librpc/gen_ndr/py_netlogon.c',
235                 deps='RPC_NDR_NETLOGON %s %s' % (pytalloc_util, pyrpc_util),
236                 realname='samba/dcerpc/netlogon.so',
237                 cflags_end=gen_cflags
238                 )
239
240         bld.SAMBA_PYTHON('python_samr',
241                 source='../../librpc/gen_ndr/py_samr.c',
242                 deps='dcerpc-samr %s %s' % (pytalloc_util, pyrpc_util),
243                 realname='samba/dcerpc/samr.so',
244                 cflags_end=gen_cflags
245                 )
246
247         bld.SAMBA_PYTHON('python_spoolss',
248                 source='../../librpc/gen_ndr/py_spoolss.c',
249                 deps='RPC_NDR_SPOOLSS %s %s' % (pytalloc_util, pyrpc_util),
250                 realname='samba/dcerpc/spoolss.so'
251                 )
252
253         bld.SAMBA_PYTHON('python_winspool',
254                 source='../../librpc/gen_ndr/py_winspool.c',
255                 deps='RPC_NDR_WINSPOOL %s %s' % (pytalloc_util, pyrpc_util),
256                 realname='samba/dcerpc/winspool.so'
257                 )
258
259         bld.SAMBA_PYTHON('python_witness',
260                 source='../../librpc/gen_ndr/py_witness.c',
261                 deps='RPC_NDR_WITNESS %s %s' % (pytalloc_util, pyrpc_util),
262                 realname='samba/dcerpc/witness.so'
263                 )
264
265         bld.SAMBA_PYTHON('python_dcerpc_nbt',
266                 source='../../librpc/gen_ndr/py_nbt.c',
267                 deps='ndr_nbt RPC_NDR_NBT %s %s' % (pytalloc_util, pyrpc_util),
268                 realname='samba/dcerpc/nbt.so',
269                 cflags_end=gen_cflags
270                 )
271
272         bld.SAMBA_PYTHON('python_dcerpc_drsblobs',
273                 source='../../librpc/gen_ndr/py_drsblobs.c',
274                 deps='%s %s NDR_SECURITY RPC_NDR_DRSBLOBS' % (pytalloc_util, pyrpc_util),
275                 realname='samba/dcerpc/drsblobs.so',
276                 cflags_end=gen_cflags
277                 )
278
279         bld.SAMBA_PYTHON('python_dcerpc_ntlmssp',
280                 source='../../librpc/gen_ndr/py_ntlmssp.c',
281                 deps='%s %s RPC_NDR_NTLMSSP' % (pytalloc_util, pyrpc_util),
282                 realname='samba/dcerpc/ntlmssp.so',
283                 cflags_end=gen_cflags
284                 )
285
286         bld.SAMBA_PYTHON('python_srvsvc',
287             source='../../librpc/gen_ndr/py_srvsvc.c',
288             deps='RPC_NDR_SRVSVC %s %s' % (pytalloc_util, pyrpc_util),
289             realname='samba/dcerpc/srvsvc.so',
290             cflags_end=gen_cflags
291             )
292
293         bld.SAMBA_PYTHON('python_echo',
294                 source='../../librpc/gen_ndr/py_echo.c',
295                 deps='RPC_NDR_ECHO %s %s' % (pytalloc_util, pyrpc_util),
296                 realname='samba/dcerpc/echo.so',
297                 cflags_end=gen_cflags
298                 )
299
300         bld.SAMBA_PYTHON('python_dns',
301                 source='../../librpc/gen_ndr/py_dns.c',
302                 deps='NDR_DNS %s %s' % (pytalloc_util, pyrpc_util),
303                 realname='samba/dcerpc/dns.so',
304                 cflags_end=gen_cflags
305                 )
306
307         bld.SAMBA_PYTHON('python_winreg',
308                 source='../../librpc/gen_ndr/py_winreg.c',
309                 deps='RPC_NDR_WINREG %s %s' % (pytalloc_util, pyrpc_util),
310                 realname='samba/dcerpc/winreg.so',
311                 cflags_end=gen_cflags
312                 )
313
314         bld.SAMBA_PYTHON('python_preg',
315                 source='../../librpc/gen_ndr/py_preg.c',
316                 deps='NDR_PREG %s %s' % (pytalloc_util, pyrpc_util),
317                 realname='samba/dcerpc/preg.so',
318                 cflags_end=gen_cflags
319                 )
320
321         bld.SAMBA_PYTHON('python_initshutdown',
322                 source='../../librpc/gen_ndr/py_initshutdown.c',
323                 deps='RPC_NDR_INITSHUTDOWN %s %s' % (pytalloc_util, pyrpc_util),
324                 realname='samba/dcerpc/initshutdown.so',
325                 cflags_end=gen_cflags
326                 )
327
328
329         bld.SAMBA_PYTHON('python_epmapper',
330                 source='../../librpc/gen_ndr/py_epmapper.c',
331                 deps='dcerpc %s %s' % (pytalloc_util, pyrpc_util),
332                 realname='samba/dcerpc/epmapper.so',
333                 cflags_end=gen_cflags
334                 )
335
336
337         bld.SAMBA_PYTHON('python_mgmt',
338                 source='../../librpc/gen_ndr/py_mgmt.c',
339                 deps='dcerpc %s %s' % (pytalloc_util, pyrpc_util),
340                 realname='samba/dcerpc/mgmt.so',
341                 cflags_end=gen_cflags
342                 )
343
344
345         bld.SAMBA_PYTHON('python_atsvc',
346                 source='../../librpc/gen_ndr/py_atsvc.c',
347                 deps='RPC_NDR_ATSVC %s %s' % (pytalloc_util, pyrpc_util),
348                 realname='samba/dcerpc/atsvc.so',
349                 cflags_end=gen_cflags
350                 )
351
352
353         bld.SAMBA_PYTHON('python_svcctl',
354                 source='../../librpc/gen_ndr/py_svcctl.c',
355                 deps='RPC_NDR_SVCCTL %s %s' % (pytalloc_util, pyrpc_util),
356                 realname='samba/dcerpc/svcctl.so',
357                 cflags_end=gen_cflags
358                 )
359
360
361         bld.SAMBA_PYTHON('python_wkssvc',
362                 source='../../librpc/gen_ndr/py_wkssvc.c',
363                 deps='RPC_NDR_WKSSVC %s %s' % (pytalloc_util, pyrpc_util),
364                 realname='samba/dcerpc/wkssvc.so',
365                 cflags_end=gen_cflags
366                 )
367
368
369         bld.SAMBA_PYTHON('python_dfs',
370                 source='../../librpc/gen_ndr/py_dfs.c',
371                 deps='RPC_NDR_DFS %s %s' % (pytalloc_util, pyrpc_util),
372                 realname='samba/dcerpc/dfs.so',
373                 cflags_end=gen_cflags
374                 )
375
376         bld.SAMBA_PYTHON('python_dcerpc_dcerpc',
377                 source='../../librpc/gen_ndr/py_dcerpc.c',
378                 deps='NDR_DCERPC %s %s' % (pytalloc_util, pyrpc_util),
379                 realname='samba/dcerpc/dcerpc.so',
380                 cflags_end=gen_cflags
381                 )
382
383         bld.SAMBA_PYTHON('python_unixinfo',
384                 source='../../librpc/gen_ndr/py_unixinfo.c',
385                 deps='RPC_NDR_UNIXINFO %s %s' % (pytalloc_util, pyrpc_util),
386                 realname='samba/dcerpc/unixinfo.so',
387                 cflags_end=gen_cflags
388                 )
389
390
391         bld.SAMBA_PYTHON('python_irpc',
392                 source='gen_ndr/py_irpc.c',
393                 deps='RPC_NDR_IRPC %s %s' % (pytalloc_util, pyrpc_util),
394                 realname='samba/dcerpc/irpc.so',
395                 cflags_end=gen_cflags
396                 )
397
398         bld.SAMBA_PYTHON('python_server_id',
399                 source='../../librpc/gen_ndr/py_server_id.c',
400                 deps='RPC_NDR_SERVER_ID %s %s' % (pytalloc_util, pyrpc_util),
401                 realname='samba/dcerpc/server_id.so',
402                 cflags_end=gen_cflags
403                 )
404
405         python_netlogon = 'python_netlogon'
406         bld.SAMBA_PYTHON('python_winbind',
407                 source='../../librpc/gen_ndr/py_winbind.c',
408                 deps='RPC_NDR_WINBIND %s %s %s' % (pytalloc_util, pyrpc_util, python_netlogon),
409                 realname='samba/dcerpc/winbind.so',
410                 cflags_end=gen_cflags
411                 )
412
413         bld.SAMBA_PYTHON('python_drsuapi',
414                 source='../../librpc/gen_ndr/py_drsuapi.c',
415                 deps='RPC_NDR_DRSUAPI %s %s' % (pytalloc_util, pyrpc_util),
416                 realname='samba/dcerpc/drsuapi.so',
417                 cflags_end=gen_cflags
418                 )
419
420         bld.SAMBA_PYTHON('python_dcerpc_dnsp',
421                 source='../../librpc/gen_ndr/py_dnsp.c',
422                 deps='%s %s NDR_SECURITY NDR_DNSP' % (pytalloc_util, pyrpc_util),
423                 realname='samba/dcerpc/dnsp.so',
424                 cflags_end=gen_cflags
425                 )
426
427
428         bld.SAMBA_PYTHON('python_dcerpc_xattr',
429                 source='../../librpc/gen_ndr/py_xattr.c',
430                 deps='%s %s RPC_NDR_XATTR' % (pytalloc_util, pyrpc_util),
431                 realname='samba/dcerpc/xattr.so',
432                 cflags_end=gen_cflags
433                 )
434
435         bld.SAMBA_PYTHON('python_dcerpc_idmap',
436                 source='../../librpc/gen_ndr/py_idmap.c',
437                 deps='%s %s RPC_NDR_XATTR' % (pytalloc_util, pyrpc_util),
438                 realname='samba/dcerpc/idmap.so',
439                 cflags_end=gen_cflags
440                 )
441
442         bld.SAMBA_PYTHON('python_dnsserver',
443                 source='../../librpc/gen_ndr/py_dnsserver.c',
444                 deps='RPC_NDR_DNSSERVER %s %s' % (pytalloc_util, pyrpc_util),
445                 realname='samba/dcerpc/dnsserver.so',
446                 cflags_end=gen_cflags
447                 )
448
449         bld.SAMBA_PYTHON('python_dcerpc_smb_acl',
450                 source='../../librpc/gen_ndr/py_smb_acl.c',
451                 deps='%s %s' % (pytalloc_util, pyrpc_util),
452                 realname='samba/dcerpc/smb_acl.so',
453                 cflags_end=gen_cflags
454                 )
455
456         bld.SAMBA_PYTHON('dcerpc_python_messaging',
457                 source='../../librpc/gen_ndr/py_messaging.c',
458                 deps='%s %s' % (pytalloc_util, pyrpc_util),
459                 realname='samba/dcerpc/messaging.so',
460                 cflags_end=gen_cflags
461                 )
462
463         bld.SAMBA_PYTHON('dcerpc_windows_event_ids',
464                 source='../../librpc/gen_ndr/py_windows_event_ids.c',
465                 deps='%s %s' % (pytalloc_util, pyrpc_util),
466                 realname='samba/dcerpc/windows_event_ids.so',
467                 cflags_end=gen_cflags
468                 )
469 if bld.PYTHON_BUILD_IS_ENABLED():
470         for env in bld.gen_python_environments():
471                 bld.SAMBA_SCRIPT('python_dcerpc_init',
472                         pattern='rpc/dcerpc.py',
473                         installdir='python/samba/dcerpc',
474                         installname='__init__.py')
475
476                 bld.INSTALL_FILES('${PYTHONARCHDIR}/samba/dcerpc', 'rpc/dcerpc.py', destname='__init__.py')