build: Refuse to build if ADDITIONAL_LDFLAGS or ADDITIONAL_CFLAGS do not work
[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_CLUSAPI
126                     NDR_WINSPOOL
127                     NDR_CAB
128                     NDR_FSRVP_STATE
129                     NDR_IOCTL
130                     NDR_COMPRESSION
131                     NDR_PRINTCAP
132                     NDR_QUOTA
133                     NDR_RAP
134                     NDR_DCERPC
135                     NDR_MESSAGING
136                     NDR_SMB_ACL
137                     NDR_PERFCOUNT
138                     NDR_SECRETS
139                     NDR_LEASES_DB
140                     ''',
141         depends_on='GEN_NDR_TABLES'
142         )
143
144
145 bld.SAMBA_SUBSYSTEM('RPC_NDR_IRPC',
146         source='gen_ndr/ndr_irpc_c.c',
147         public_deps='dcerpc NDR_IRPC'
148         )
149
150 bld.SAMBA_LIBRARY('dcerpc-samr',
151         source='',
152         pc_files='dcerpc_samr.pc',
153         vnum='0.0.1',
154         public_deps='dcerpc ndr-standard RPC_NDR_SAMR',
155         public_headers='../../librpc/gen_ndr/ndr_samr_c.h',
156         header_path='gen_ndr'
157         )
158
159
160 bld.SAMBA_LIBRARY('dcerpc',
161         source='''rpc/dcerpc.c rpc/dcerpc_auth.c rpc/dcerpc_schannel.c
162         rpc/dcerpc_util.c rpc/dcerpc_smb.c rpc/dcerpc_sock.c
163         rpc/dcerpc_roh_channel_in.c rpc/dcerpc_roh_channel_out.c rpc/dcerpc_roh.c
164         rpc/dcerpc_connect.c rpc/dcerpc_secondary.c''',
165         pc_files='dcerpc.pc',
166         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',
167         autoproto='rpc/dcerpc_proto.h',
168         public_deps='samba-credentials tevent talloc',
169         public_headers='''rpc/dcerpc.h''',
170         # It's very important to keep this form of construction
171         # it force the sambawaf extension to put everything that match the first element
172         # (*gen_ndr*) into the dir named by the second element (gen_ndr).
173         # If we just put header_path = 'gen_ndr' then all the public_headers will go
174         # in 'gen_ndr' and for dcerpc.h (at least) it will cause a problem as
175         # we have already a dcerpc.h installed by librpc/wscript_build
176         # and one will overright the other which is not what we expect.
177         header_path=[ ('*gen_ndr*', 'gen_ndr') ],
178         vnum='0.0.1'
179         )
180
181 gen_cflags = ''
182 if bld.CONFIG_SET('HAVE_WNO_UNUSED_FUNCTION'):
183     gen_cflags = '-Wno-unused-function'
184
185 pyrpc_util = bld.pyembed_libname('pyrpc_util')
186 pytalloc_util = bld.pyembed_libname('pytalloc-util')
187 pyparam_util = bld.pyembed_libname('pyparam_util')
188
189 bld.SAMBA_SUBSYSTEM(pyrpc_util,
190         source='rpc/pyrpc_util.c',
191         public_deps='%s %s dcerpc MESSAGING' % (pytalloc_util, pyparam_util),
192         pyext=True,
193         enabled=bld.PYTHON_BUILD_IS_ENABLED(),
194         )
195
196 bld.SAMBA_PYTHON('python_dcerpc',
197         source='rpc/pyrpc.c',
198         public_deps='LIBCLI_SMB samba-util samba-hostconfig dcerpc-samr RPC_NDR_LSA DYNCONFIG %s gensec' % pyrpc_util,
199         realname='samba/dcerpc/base.so',
200         cflags_end=gen_cflags
201         )
202
203 bld.SAMBA_PYTHON('python_dcerpc_misc',
204         source='../../librpc/gen_ndr/py_misc.c',
205         deps='%s %s ndr-krb5pac' % (pytalloc_util, pyrpc_util),
206         realname='samba/dcerpc/misc.so',
207         cflags_end=gen_cflags
208         )
209
210 bld.SAMBA_PYTHON('python_auth',
211         source='../../librpc/gen_ndr/py_auth.c',
212         deps='NDR_AUTH %s %s' % (pytalloc_util, pyrpc_util),
213         realname='samba/dcerpc/auth.so',
214         cflags_end=gen_cflags
215         )
216
217 bld.SAMBA_PYTHON('python_dcerpc_security',
218         source='../../librpc/gen_ndr/py_security.c',
219         deps='%s %s NDR_SECURITY' % (pytalloc_util, pyrpc_util),
220         realname='samba/dcerpc/security.so',
221         cflags_end=gen_cflags
222         )
223
224 bld.SAMBA_PYTHON('python_lsa',
225         source='../../librpc/gen_ndr/py_lsa.c',
226         deps='RPC_NDR_LSA %s %s' % (pytalloc_util, pyrpc_util),
227         realname='samba/dcerpc/lsa.so',
228         cflags_end=gen_cflags
229         )
230
231 bld.SAMBA_PYTHON('python_krb5pac',
232         source='../../librpc/gen_ndr/py_krb5pac.c',
233         deps='ndr-krb5pac %s %s' % (pytalloc_util, pyrpc_util),
234         realname='samba/dcerpc/krb5pac.so',
235         cflags_end=gen_cflags
236         )
237
238 bld.SAMBA_PYTHON('python_netlogon',
239         source='../../librpc/gen_ndr/py_netlogon.c',
240         deps='RPC_NDR_NETLOGON %s %s' % (pytalloc_util, pyrpc_util),
241         realname='samba/dcerpc/netlogon.so',
242         cflags_end=gen_cflags
243         )
244
245 bld.SAMBA_PYTHON('python_samr',
246         source='../../librpc/gen_ndr/py_samr.c',
247         deps='dcerpc-samr %s %s' % (pytalloc_util, pyrpc_util),
248         realname='samba/dcerpc/samr.so',
249         cflags_end=gen_cflags
250         )
251
252 bld.SAMBA_PYTHON('python_spoolss',
253         source='../../librpc/gen_ndr/py_spoolss.c',
254         deps='RPC_NDR_SPOOLSS %s %s' % (pytalloc_util, pyrpc_util),
255         realname='samba/dcerpc/spoolss.so'
256         )
257
258 bld.SAMBA_PYTHON('python_winspool',
259         source='../../librpc/gen_ndr/py_winspool.c',
260         deps='RPC_NDR_WINSPOOL %s %s' % (pytalloc_util, pyrpc_util),
261         realname='samba/dcerpc/winspool.so'
262         )
263
264 bld.SAMBA_PYTHON('python_witness',
265         source='../../librpc/gen_ndr/py_witness.c',
266         deps='RPC_NDR_WITNESS %s %s' % (pytalloc_util, pyrpc_util),
267         realname='samba/dcerpc/witness.so'
268         )
269
270 bld.SAMBA_PYTHON('python_dcerpc_nbt',
271         source='../../librpc/gen_ndr/py_nbt.c',
272         deps='ndr_nbt %s %s' % (pytalloc_util, pyrpc_util),
273         realname='samba/dcerpc/nbt.so',
274         cflags_end=gen_cflags
275         )
276
277 bld.SAMBA_PYTHON('python_dcerpc_drsblobs',
278         source='../../librpc/gen_ndr/py_drsblobs.c',
279         deps='%s %s NDR_SECURITY NDR_DRSBLOBS' % (pytalloc_util, pyrpc_util),
280         realname='samba/dcerpc/drsblobs.so',
281         cflags_end=gen_cflags
282         )
283
284 bld.SAMBA_PYTHON('python_dcerpc_ntlmssp',
285         source='../../librpc/gen_ndr/py_ntlmssp.c',
286         deps='%s %s NDR_NTLMSSP' % (pytalloc_util, pyrpc_util),
287         realname='samba/dcerpc/ntlmssp.so',
288         cflags_end=gen_cflags
289         )
290
291 bld.SAMBA_PYTHON('python_srvsvc',
292     source='../../librpc/gen_ndr/py_srvsvc.c',
293     deps='RPC_NDR_SRVSVC %s %s' % (pytalloc_util, pyrpc_util),
294     realname='samba/dcerpc/srvsvc.so',
295     cflags_end=gen_cflags
296     )
297
298 bld.SAMBA_PYTHON('python_echo',
299         source='../../librpc/gen_ndr/py_echo.c',
300         deps='RPC_NDR_ECHO %s %s' % (pytalloc_util, pyrpc_util),
301         realname='samba/dcerpc/echo.so',
302         cflags_end=gen_cflags
303         )
304
305 bld.SAMBA_PYTHON('python_dns',
306         source='../../librpc/gen_ndr/py_dns.c',
307         deps='NDR_DNS %s %s' % (pytalloc_util, pyrpc_util),
308         realname='samba/dcerpc/dns.so',
309         cflags_end=gen_cflags
310         )
311
312 bld.SAMBA_PYTHON('python_winreg',
313         source='../../librpc/gen_ndr/py_winreg.c',
314         deps='RPC_NDR_WINREG %s %s' % (pytalloc_util, pyrpc_util),
315         realname='samba/dcerpc/winreg.so',
316         cflags_end=gen_cflags
317         )
318
319 bld.SAMBA_PYTHON('python_preg',
320         source='../../librpc/gen_ndr/py_preg.c',
321         deps='NDR_PREG %s %s' % (pytalloc_util, pyrpc_util),
322         realname='samba/dcerpc/preg.so',
323         cflags_end=gen_cflags
324         )
325
326 bld.SAMBA_PYTHON('python_initshutdown',
327         source='../../librpc/gen_ndr/py_initshutdown.c',
328         deps='RPC_NDR_INITSHUTDOWN %s %s' % (pytalloc_util, pyrpc_util),
329         realname='samba/dcerpc/initshutdown.so',
330         cflags_end=gen_cflags
331         )
332
333
334 bld.SAMBA_PYTHON('python_epmapper',
335         source='../../librpc/gen_ndr/py_epmapper.c',
336         deps='dcerpc %s %s' % (pytalloc_util, pyrpc_util),
337         realname='samba/dcerpc/epmapper.so',
338         cflags_end=gen_cflags
339         )
340
341
342 bld.SAMBA_PYTHON('python_mgmt',
343         source='../../librpc/gen_ndr/py_mgmt.c',
344         deps='dcerpc %s %s' % (pytalloc_util, pyrpc_util),
345         realname='samba/dcerpc/mgmt.so',
346         cflags_end=gen_cflags
347         )
348
349
350 bld.SAMBA_PYTHON('python_atsvc',
351         source='../../librpc/gen_ndr/py_atsvc.c',
352         deps='RPC_NDR_ATSVC %s %s' % (pytalloc_util, pyrpc_util),
353         realname='samba/dcerpc/atsvc.so',
354         cflags_end=gen_cflags
355         )
356
357
358 bld.SAMBA_PYTHON('python_svcctl',
359         source='../../librpc/gen_ndr/py_svcctl.c',
360         deps='RPC_NDR_SVCCTL %s %s' % (pytalloc_util, pyrpc_util),
361         realname='samba/dcerpc/svcctl.so',
362         cflags_end=gen_cflags
363         )
364
365
366 bld.SAMBA_PYTHON('python_wkssvc',
367         source='../../librpc/gen_ndr/py_wkssvc.c',
368         deps='RPC_NDR_WKSSVC %s %s' % (pytalloc_util, pyrpc_util),
369         realname='samba/dcerpc/wkssvc.so',
370         cflags_end=gen_cflags
371         )
372
373
374 bld.SAMBA_PYTHON('python_dfs',
375         source='../../librpc/gen_ndr/py_dfs.c',
376         deps='RPC_NDR_DFS %s %s' % (pytalloc_util, pyrpc_util),
377         realname='samba/dcerpc/dfs.so',
378         cflags_end=gen_cflags
379         )
380
381 bld.SAMBA_PYTHON('python_dcerpc_dcerpc',
382         source='../../librpc/gen_ndr/py_dcerpc.c',
383         deps='NDR_DCERPC %s %s' % (pytalloc_util, pyrpc_util),
384         realname='samba/dcerpc/dcerpc.so',
385         cflags_end=gen_cflags
386         )
387
388 bld.SAMBA_PYTHON('python_unixinfo',
389         source='../../librpc/gen_ndr/py_unixinfo.c',
390         deps='RPC_NDR_UNIXINFO %s %s' % (pytalloc_util, pyrpc_util),
391         realname='samba/dcerpc/unixinfo.so',
392         cflags_end=gen_cflags
393         )
394
395
396 bld.SAMBA_PYTHON('python_irpc',
397         source='gen_ndr/py_irpc.c',
398         deps='RPC_NDR_IRPC %s %s' % (pytalloc_util, pyrpc_util),
399         realname='samba/dcerpc/irpc.so',
400         cflags_end=gen_cflags
401         )
402
403 bld.SAMBA_PYTHON('python_server_id',
404         source='../../librpc/gen_ndr/py_server_id.c',
405         deps='NDR_SERVER_ID %s %s' % (pytalloc_util, pyrpc_util),
406         realname='samba/dcerpc/server_id.so',
407         cflags_end=gen_cflags
408         )
409
410 python_netlogon = 'python_netlogon'
411 bld.SAMBA_PYTHON('python_winbind',
412         source='../../librpc/gen_ndr/py_winbind.c',
413         deps='RPC_NDR_WINBIND %s %s %s' % (pytalloc_util, pyrpc_util, python_netlogon),
414         realname='samba/dcerpc/winbind.so',
415         cflags_end=gen_cflags
416         )
417
418 bld.SAMBA_PYTHON('python_drsuapi',
419         source='../../librpc/gen_ndr/py_drsuapi.c',
420         deps='RPC_NDR_DRSUAPI %s %s' % (pytalloc_util, pyrpc_util),
421         realname='samba/dcerpc/drsuapi.so',
422         cflags_end=gen_cflags
423         )
424
425 bld.SAMBA_PYTHON('python_dcerpc_dnsp',
426         source='../../librpc/gen_ndr/py_dnsp.c',
427         deps='%s %s NDR_SECURITY NDR_DNSP' % (pytalloc_util, pyrpc_util),
428         realname='samba/dcerpc/dnsp.so',
429         cflags_end=gen_cflags
430         )
431
432
433 bld.SAMBA_PYTHON('python_dcerpc_xattr',
434         source='../../librpc/gen_ndr/py_xattr.c',
435         deps='%s %s NDR_XATTR' % (pytalloc_util, pyrpc_util),
436         realname='samba/dcerpc/xattr.so',
437         cflags_end=gen_cflags
438         )
439
440 bld.SAMBA_PYTHON('python_dcerpc_idmap',
441         source='../../librpc/gen_ndr/py_idmap.c',
442         deps='%s %s NDR_IDMAP' % (pytalloc_util, pyrpc_util),
443         realname='samba/dcerpc/idmap.so',
444         cflags_end=gen_cflags
445         )
446
447 bld.SAMBA_PYTHON('python_dnsserver',
448         source='../../librpc/gen_ndr/py_dnsserver.c',
449         deps='RPC_NDR_DNSSERVER %s %s' % (pytalloc_util, pyrpc_util),
450         realname='samba/dcerpc/dnsserver.so',
451         cflags_end=gen_cflags
452         )
453
454 bld.SAMBA_PYTHON('python_dcerpc_smb_acl',
455         source='../../librpc/gen_ndr/py_smb_acl.c',
456         deps='%s %s' % (pytalloc_util, pyrpc_util),
457         realname='samba/dcerpc/smb_acl.so',
458         cflags_end=gen_cflags
459         )
460
461 bld.SAMBA_PYTHON('dcerpc_python_messaging',
462         source='../../librpc/gen_ndr/py_messaging.c',
463         deps='%s %s' % (pytalloc_util, pyrpc_util),
464         realname='samba/dcerpc/messaging.so',
465         cflags_end=gen_cflags
466         )
467
468 bld.SAMBA_PYTHON('dcerpc_windows_event_ids',
469         source='../../librpc/gen_ndr/py_windows_event_ids.c',
470         deps='%s %s' % (pytalloc_util, pyrpc_util),
471         realname='samba/dcerpc/windows_event_ids.so',
472         cflags_end=gen_cflags
473         )
474
475 bld.SAMBA_PYTHON('python_mdssvc',
476         source='../../librpc/gen_ndr/py_mdssvc.c',
477         deps='RPC_NDR_MDSSVC %s %s' % (pytalloc_util, pyrpc_util),
478         realname='samba/dcerpc/mdssvc.so',
479         cflags_end=gen_cflags
480         )
481
482 if bld.PYTHON_BUILD_IS_ENABLED():
483     bld.SAMBA_SCRIPT('python_dcerpc_init',
484                     pattern='rpc/dcerpc.py',
485                      installdir='python/samba/dcerpc',
486                      installname='__init__.py')
487
488     bld.INSTALL_FILES('${PYTHONARCHDIR}/samba/dcerpc', 'rpc/dcerpc.py', destname='__init__.py')