cc5dcdc9d168d87cfc37ba2829933ddc6ace5672
[samba.git] / source4 / heimdal_build / wscript_build
1 #!/usr/bin/env python
2
3 import os
4 from samba_utils import SET_TARGET_TYPE
5 from samba_autoconf import CURRENT_CFLAGS, CURRENT_LDFLAGS
6
7 def to_list(str):
8     '''Split a list, preserving quoted strings and existing lists'''
9     if str is None:
10         return []
11     if isinstance(str, list):
12         return str
13     return str.split(None)
14
15 def heimdal_path(p):
16     return os.path.join("../heimdal", p)
17
18 def heimdal_paths(ps):
19     return [heimdal_path(p) for p in to_list(ps)]
20
21 # waf build tool for building .et files with compile_et
22 def HEIMDAL_ASN1(name, source,
23                options='',
24                directory='',
25                option_file=None,
26                includes=''):
27     '''Build a ASN1 file using the asn1 compiler.
28        This will produce 2 output files'''
29     source = heimdal_path(source)
30     bname = os.path.basename(source)[0:-5];
31     dname = os.path.dirname(source)
32     asn1name = "%s_asn1" % bname
33
34     if option_file:
35         option_file = heimdal_path(option_file)
36
37     if not SET_TARGET_TYPE(bld, name, 'ASN1'):
38         return
39
40     # for ASN1 compilation, I always put it in build_source, as it doesn't make
41     # sense elsewhere
42     bld.set_group('build_source')
43
44     out_files = heimdal_paths([
45         "%s/asn1_%s_asn1.x" % (directory, bname),
46         "%s/%s_asn1.hx" % (directory, bname),
47         "%s/%s_asn1-priv.hx" % (directory, bname),
48         ])
49
50     # the ${TGT[0].parent.abspath(env)} expression gives us the parent directory of
51     # the first target in the build directory
52     # SRC[0].abspath(env) gives the absolute path to the source directory for the first
53     # source file. Note that in the case of a option_file, we have more than
54     # one source file
55     cd_rule = 'cd ${TGT[0].parent.abspath(env)}'
56     asn1_rule = cd_rule + ' && ${BLDBIN}/asn1_compile ${OPTION_FILE} ${ASN1OPTIONS} --one-code-file ${SRC[0].abspath(env)} ${ASN1NAME}'
57
58     source = to_list(source)
59     source.append('asn1_compile')
60
61     if option_file is not None:
62         source.append(option_file)
63
64     t = bld(rule=asn1_rule,
65             ext_out = '.x',
66             before = 'cc',
67             on_results = True,
68             shell = True,
69             source = source,
70             target = out_files,
71             name=name + '_ASN1')
72
73     t.env.ASN1NAME     = asn1name
74     t.env.ASN1OPTIONS  = options
75     t.env.BLDBIN       = os.path.normpath(os.path.join(bld.srcnode.abspath(bld.env), '..'))
76     if option_file is not None:
77         t.env.OPTION_FILE = "--option-file=%s" % os.path.normpath(os.path.join(bld.curdir, option_file))
78
79     cfile = out_files[0][0:-2] + '.c'
80     hfile = out_files[1][0:-3] + '.h'
81     hpriv = out_files[2][0:-3] + '.h'
82
83     # now generate a .c file from the .x file
84     t = bld(rule='''( echo '#include "config.h"' && cat ${SRC} ) > ${TGT}''',
85             source = out_files[0],
86             target = cfile,
87             shell = True,
88             on_results=True,
89             ext_out = '.c',
90             ext_in = '.x',
91             depends_on = name + '_ASN1',
92             name = name + '_C')
93
94     # and generate a .h file from the .hx file
95     t = bld(rule='cp ${SRC} ${TGT}',
96             source = out_files[1],
97             ext_out = '.c',
98             ext_in = '.x',
99             on_results=True,
100             target = hfile,
101             depends_on = name + '_ASN1',
102             name = name + '_H')
103
104     # and generate a .h file from the .hx file
105     t = bld(rule='cp ${SRC} ${TGT}',
106             source = out_files[2],
107             ext_out = '.c',
108             ext_in = '.x',
109             on_results=True,
110             target = hpriv,
111             depends_on = name + '_ASN1',
112             name = name + '_PRIV_H')
113
114     bld.set_group('main')
115
116     includes = to_list(includes)
117     includes.append(os.path.dirname(out_files[0]))
118
119     t = bld(features       = 'cc',
120             source         = cfile,
121             target         = name,
122             samba_cflags   = CURRENT_CFLAGS(bld, name, ''),
123             depends_on     = '',
124             samba_deps     = to_list('roken replace'),
125             samba_includes = includes + ["/usr/include/heimdal"],
126             local_include  = True)
127
128
129 def HEIMDAL_ERRTABLE(name, source):
130     '''Build a heimdal errtable from a .et file'''
131
132     source = heimdal_path(source)
133
134     bname = source[0:-3]; # strip off the .et suffix
135
136     if not SET_TARGET_TYPE(bld, name, 'ET'):
137         return
138
139     bld.set_group('build_source')
140
141     out_files = []
142     out_files.append('%s.c' % bname)
143     out_files.append('%s.h' % bname)
144
145     sources = [source, 'et_compile_wrapper.sh']
146
147     if not bld.CONFIG_SET('USING_SYSTEM_COMPILE_ET'):
148         sources.append('compile_et')
149
150     t = bld(rule='${SRC[1].abspath(env)} ${TGT[0].parent.abspath(env)} ${COMPILE_ET} ${SRC[0].abspath(env)} ${TGT[0].bldpath(env)}',
151             ext_out = '.c',
152             before  = 'cc',
153             on_results = True,
154             shell   = True,
155             source  = sources,
156             target  = out_files,
157             name    = name)
158
159 def HEIMDAL_AUTOPROTO(header, source, options=None, group='prototypes'):
160     '''rule for heimdal prototype generation'''
161     header = heimdal_path(header)
162     bld.set_group(group)
163     if options is None:
164         options='-q -P comment -o'
165     SET_TARGET_TYPE(bld, header, 'PROTOTYPE')
166     source = heimdal_paths(source)
167     t = bld(rule='${PERL} ${HEIMDAL}/cf/make-proto.pl ${OPTIONS} ${TGT[0].abspath(env)} ${SRC}',
168             source=source,
169             target=header,
170             on_results=True,
171             ext_out='.c',
172             before='cc')
173     t.env.HEIMDAL = os.path.join(bld.srcnode.abspath(), 'source4/heimdal')
174     t.env.OPTIONS = options
175
176
177 def HEIMDAL_AUTOPROTO_PRIVATE(header, source):
178     '''rule for private heimdal prototype generation'''
179     HEIMDAL_AUTOPROTO(header, source, options='-q -P comment -p')
180
181
182 def HEIMDAL_LIBRARY(libname, source, deps, vnum,
183                   includes='',
184                   cflags='',
185                   is_bundled=True):
186     '''define a Heimdal library'''
187
188     obj_target = libname + '.objlist'
189
190     # first create a target for building the object files for this library
191     # by separating in this way, we avoid recompiling the C files
192     # separately for the install library and the build library
193     HEIMDAL_SUBSYSTEM(obj_target,
194                         source         = source,
195                         deps           = deps,
196                         includes       = includes,
197                         cflags         = cflags,
198                         group          = 'main')
199
200     if not SET_TARGET_TYPE(bld, libname, "LIBRARY"):
201         return
202
203     # the library itself will depend on that object target
204     deps = to_list(deps)
205     deps.append(obj_target)
206
207     if not is_bundled:
208         # Sanitize the library name
209         bundled_name = libname.lower().replace('_', '-')
210         while bundled_name.startswith("lib"):
211             bundled_name = bundled_name[3:]
212     else:
213         bundled_name = libname + '-samba4'
214
215     features = 'cc cshlib symlink_lib install_lib'
216
217     bld.set_group('main')
218     t = bld(
219         features        = features,
220         source          = [],
221         target          = bundled_name,
222         samba_cflags    = CURRENT_LDFLAGS(bld, libname, cflags),
223         samba_deps      = deps,
224         samba_includes  = includes,
225         vnum            = vnum,
226         install_path    = None,
227         name            = libname,
228         is_bundled      = is_bundled,
229         )
230
231
232 def HEIMDAL_GENERATOR(name, rule, source='', target='',
233         group='generators'):
234     '''A generic source generator target'''
235
236     if not SET_TARGET_TYPE(bld, name, 'GENERATOR'):
237         return
238
239     bld.set_group(group)
240     return bld(
241         rule=rule,
242         source=source,
243         target=target,
244         shell=isinstance(rule, str),
245         on_results=True,
246         before='cc',
247         ext_out='.c',
248         name=name)
249
250
251 def HEIMDAL_SUBSYSTEM(modname, source,
252                     deps='',
253                     includes='',
254                     cflags='',
255                     group='main',
256                     use_hostcc=False,
257                     use_global_deps=True):
258     '''define a Heimdal subsystem'''
259
260     if not SET_TARGET_TYPE(bld, modname, 'SUBSYSTEM'):
261         return
262
263     source = heimdal_paths(source)
264
265     bld.set_group(group)
266
267     return bld(
268         features       = 'cc',
269         source         = source,
270         target         = modname,
271         samba_cflags   = CURRENT_CFLAGS(bld, modname, cflags),
272         depends_on     = '',
273         samba_deps     = to_list(deps),
274         samba_includes = includes,
275         local_include  = True,
276         local_include_first  = True,
277         samba_use_hostcc = use_hostcc,
278         samba_use_global_deps = use_global_deps
279         )
280
281
282 def HEIMDAL_BINARY(binname, source,
283                  deps='',
284                  includes='',
285                  cflags='',
286                  use_hostcc=False,
287                  use_global_deps=True,
288                  compiler=None,
289                  group='binaries',
290                  install=True,
291                  install_path=None):
292     '''define a Samba binary'''
293
294     if not SET_TARGET_TYPE(bld, binname, 'BINARY'):
295         return
296
297     features = 'cc cprogram symlink_bin install_bin'
298
299     obj_target = binname + '.objlist'
300
301     # first create a target for building the object files for this binary
302     # by separating in this way, we avoid recompiling the C files
303     # separately for the install binary and the build binary
304     HEIMDAL_SUBSYSTEM(obj_target,
305                         source         = source,
306                         deps           = deps,
307                         includes       = includes,
308                         cflags         = cflags,
309                         group          = group,
310                         use_hostcc     = use_hostcc,
311                         use_global_deps= use_global_deps)
312
313     bld.set_group(group)
314
315     # the binary itself will depend on that object target
316     deps = to_list(deps)
317     deps.append(obj_target)
318
319     t = bld(
320         features       = features,
321         source         = [],
322         target         = binname,
323         samba_cflags   = CURRENT_LDFLAGS(bld, binname, cflags),
324         samba_deps     = deps,
325         samba_includes = includes,
326         local_include  = True,
327         top            = True,
328         install_path   = None,
329         samba_install  = install
330         )
331
332
333 HEIMDAL_ASN1('HEIMDAL_SPNEGO_ASN1',
334     source='lib/gssapi/spnego/spnego.asn1',
335     options='--sequence=MechTypeList',
336     includes='../heimdal/lib/asn1',
337     directory='lib/gssapi'
338     )
339
340
341 HEIMDAL_ASN1('HEIMDAL_GSSAPI_ASN1',
342     'lib/gssapi/mech/gssapi.asn1',
343     includes='../heimdal/lib/asn1',
344     directory='lib/gssapi'
345     )
346
347
348 HEIMDAL_ASN1('HEIMDAL_KRB5_ASN1',
349     'lib/asn1/krb5.asn1',
350     option_file='lib/asn1/krb5.opt',
351     directory='lib/asn1'
352     )
353
354
355 HEIMDAL_ASN1('HEIMDAL_DIGEST_ASN1',
356     'lib/asn1/digest.asn1',
357     directory='lib/asn1'
358     )
359
360
361 HEIMDAL_ASN1('HEIMDAL_RFC2459_ASN1',
362     'lib/asn1/rfc2459.asn1',
363     options='--preserve-binary=TBSCertificate --preserve-binary=TBSCRLCertList --preserve-binary=Name --sequence=GeneralNames --sequence=Extensions --sequence=CRLDistributionPoints',
364     directory='lib/asn1'
365     )
366
367
368 HEIMDAL_ASN1('HEIMDAL_PKINIT_ASN1',
369     'lib/asn1/pkinit.asn1',
370     directory='lib/asn1'
371     )
372
373
374 HEIMDAL_ASN1('HEIMDAL_KX509_ASN1',
375     'lib/asn1/kx509.asn1',
376     directory='lib/asn1'
377     )
378
379
380 HEIMDAL_ASN1('HEIMDAL_HDB_ASN1', 'lib/hdb/hdb.asn1',
381     directory='lib/asn1',
382     includes='../heimdal/lib/asn1')
383
384 HEIMDAL_ERRTABLE('HEIMDAL_ASN1_ERR_ET', 'lib/asn1/asn1_err.et')
385
386 HEIMDAL_ERRTABLE('HEIMDAL_HDB_ERR_ET', 'lib/hdb/hdb_err.et')
387
388 HEIMDAL_ERRTABLE('HEIMDAL_HEIM_ERR_ET', 'lib/krb5/heim_err.et')
389
390 HEIMDAL_ERRTABLE('HEIMDAL_K524_ERR_ET', 'lib/krb5/k524_err.et')
391
392 HEIMDAL_ERRTABLE('HEIMDAL_KRB_ERR_ET', 'lib/krb5/krb_err.et')
393
394 HEIMDAL_ERRTABLE('HEIMDAL_KRB5_ERR_ET', 'lib/krb5/krb5_err.et')
395
396 HEIMDAL_ERRTABLE('HEIMDAL_GKRB5_ERR_ET', 'lib/gssapi/krb5/gkrb5_err.et')
397
398
399 if not bld.CONFIG_SET('USING_SYSTEM_ROKEN'):
400
401     if not bld.CONFIG_SET('HAVE_IFADDRS_H'):
402         HEIMDAL_GENERATOR(
403             name="HEIMDAL_IFADDRS_H",
404             rule="rm -f ${TGT} && ln ${SRC} ${TGT}",
405             source = 'ifaddrs.hin',
406             target = 'ifaddrs.h',
407             )
408
409     if not bld.CONFIG_SET('HAVE_ERR_H'):
410         HEIMDAL_GENERATOR(
411             group='build_compiler_source',
412             name="HEIMDAL_ERR_H",
413             rule="rm -f ${TGT} && ln ${SRC} ${TGT}",
414             source = '../heimdal/lib/roken/err.hin',
415             target = '../heimdal/lib/roken/err.h',
416             )
417
418     ROKEN_HOSTCC_SOURCE = '''
419         lib/roken/base64.c
420         lib/roken/ct.c
421         lib/roken/hex.c
422         lib/roken/bswap.c
423         lib/roken/dumpdata.c
424         lib/roken/emalloc.c
425         lib/roken/ecalloc.c
426         lib/roken/getarg.c
427         lib/roken/get_window_size.c
428         lib/roken/getdtablesize.c
429         lib/roken/h_errno.c
430         lib/roken/issuid.c
431         lib/roken/net_read.c
432         lib/roken/net_write.c
433         lib/roken/parse_time.c
434         lib/roken/parse_units.c
435         lib/roken/signal.c
436         lib/roken/vis.c
437         lib/roken/strlwr.c
438         lib/roken/strsep_copy.c
439         lib/roken/strsep.c
440         lib/roken/strupr.c
441         lib/roken/strpool.c
442         lib/roken/estrdup.c
443         lib/roken/erealloc.c
444         lib/roken/simple_exec.c
445         lib/roken/strcollect.c
446         lib/roken/rtbl.c
447         lib/roken/cloexec.c
448         lib/roken/xfree.c
449         ../heimdal_build/replace.c
450     '''
451
452     if not bld.CONFIG_SET('HAVE_GETPROGNAME'):
453         ROKEN_HOSTCC_SOURCE += '''
454             lib/roken/getprogname.c
455             lib/roken/setprogname.c
456         '''
457
458     if not bld.CONFIG_SET('HAVE_CLOSEFROM'):
459         ROKEN_HOSTCC_SOURCE += '''
460             lib/roken/closefrom.c
461         '''
462
463     ROKEN_SOURCE = ROKEN_HOSTCC_SOURCE + '''
464         lib/roken/resolve.c
465         lib/roken/socket.c
466         lib/roken/roken_gethostby.c
467     '''
468
469     HEIMDAL_LIBRARY('roken',
470         ROKEN_SOURCE,
471         includes='../heimdal/lib/roken ../heimdal/include ../../lib/socket_wrapper',
472         deps='resolv UID_WRAPPER util',
473         vnum='19.0.1',
474         )
475
476     HEIMDAL_SUBSYSTEM('ROKEN_HOSTCC',
477         ROKEN_HOSTCC_SOURCE,
478         use_hostcc=True,
479         use_global_deps=False,
480         includes='../heimdal/lib/roken',
481         cflags='-DSOCKET_WRAPPER_DISABLE=1 -DNSS_WRAPPER_DISABLE=1 -D_SAMBA_HOSTCC_',
482         group='compiler_libraries',
483         deps='LIBREPLACE_HOSTCC',
484         )
485
486     HEIMDAL_BINARY('rkpty', 'lib/roken/rkpty.c',
487             deps='roken OPENPTY',
488             cflags='-DPACKAGE="Samba"',
489             install=False
490         )
491
492 KDC_SOURCE='kdc/default_config.c kdc/kerberos5.c kdc/krb5tgs.c kdc/pkinit.c kdc/log.c kdc/misc.c kdc/kaserver.c kdc/digest.c kdc/process.c kdc/windc.c kdc/kx509.c'
493
494 HEIMDAL_LIBRARY('kdc', source=KDC_SOURCE,
495                     includes='../heimdal/kdc',
496                     deps='roken krb5 hdb asn1 HEIMDAL_DIGEST_ASN1 HEIMDAL_KX509_ASN1 heimntlm HEIMDAL_HCRYPTO com_err wind',
497                     vnum='2.0.0',
498                     )
499 HEIMDAL_AUTOPROTO('kdc/kdc-protos.h', KDC_SOURCE)
500 HEIMDAL_AUTOPROTO_PRIVATE('kdc/kdc-private.h', KDC_SOURCE)
501
502 HEIMNTLM_SOURCE = 'lib/ntlm/ntlm.c'
503 HEIMDAL_LIBRARY('heimntlm',
504                     source=HEIMNTLM_SOURCE,
505                     includes='../heimdal/lib/ntlm',
506                     deps='roken HEIMDAL_HCRYPTO krb5',
507                     vnum='1.0.1',
508     )
509 HEIMDAL_AUTOPROTO('lib/ntlm/heimntlm-protos.h', HEIMNTLM_SOURCE)
510
511
512 HEIMDAL_SUBSYSTEM('HEIMDAL_HDB_KEYS',
513     'lib/hdb/keys.c',
514     includes='../heimdal/lib/hdb',
515     deps='roken HEIMDAL_HCRYPTO krb5 HEIMDAL_HDB_ASN1'
516     )
517
518
519 HDB_SOURCE = '''lib/hdb/db.c lib/hdb/dbinfo.c lib/hdb/hdb.c
520                               lib/hdb/ext.c lib/hdb/keytab.c lib/hdb/hdb-keytab.c
521                               lib/hdb/mkey.c lib/hdb/ndbm.c lib/hdb/hdb_err.c
522                               ../heimdal_build/hdb-glue.c'''
523
524 HEIMDAL_LIBRARY('hdb',
525                     source=HDB_SOURCE,
526                     includes='../heimdal/lib/hdb',
527                     deps='HDB_LDB krb5 HEIMDAL_HDB_KEYS roken HEIMDAL_HCRYPTO com_err HEIMDAL_HDB_ASN1 wind',
528                     vnum='11.0.2',
529     )
530 HEIMDAL_AUTOPROTO('lib/hdb/hdb-protos.h', HDB_SOURCE)
531 HEIMDAL_AUTOPROTO_PRIVATE('lib/hdb/hdb-private.h', HDB_SOURCE)
532
533
534 HEIMDAL_LIBRARY('gssapi',
535                     '''
536 lib/gssapi/spnego/init_sec_context.c lib/gssapi/spnego/external.c lib/gssapi/spnego/compat.c
537 lib/gssapi/spnego/context_stubs.c lib/gssapi/spnego/cred_stubs.c lib/gssapi/spnego/accept_sec_context.c
538 lib/gssapi/krb5/copy_ccache.c lib/gssapi/krb5/delete_sec_context.c lib/gssapi/krb5/init_sec_context.c
539 lib/gssapi/krb5/context_time.c lib/gssapi/krb5/init.c lib/gssapi/krb5/address_to_krb5addr.c
540 lib/gssapi/krb5/get_mic.c lib/gssapi/krb5/inquire_context.c lib/gssapi/krb5/add_cred.c
541 lib/gssapi/krb5/inquire_cred.c lib/gssapi/krb5/inquire_cred_by_oid.c lib/gssapi/krb5/inquire_cred_by_mech.c
542 lib/gssapi/krb5/inquire_mechs_for_name.c lib/gssapi/krb5/inquire_names_for_mech.c lib/gssapi/krb5/indicate_mechs.c
543 lib/gssapi/krb5/inquire_sec_context_by_oid.c lib/gssapi/krb5/export_sec_context.c lib/gssapi/krb5/import_sec_context.c
544 lib/gssapi/krb5/duplicate_name.c lib/gssapi/krb5/import_name.c lib/gssapi/krb5/compare_name.c
545 lib/gssapi/krb5/export_name.c lib/gssapi/krb5/canonicalize_name.c lib/gssapi/krb5/unwrap.c
546 lib/gssapi/krb5/wrap.c lib/gssapi/krb5/release_name.c lib/gssapi/krb5/cfx.c
547 lib/gssapi/krb5/8003.c lib/gssapi/krb5/arcfour.c lib/gssapi/krb5/encapsulate.c
548 lib/gssapi/krb5/display_name.c lib/gssapi/krb5/sequence.c lib/gssapi/krb5/display_status.c
549 lib/gssapi/krb5/release_buffer.c lib/gssapi/krb5/external.c lib/gssapi/krb5/compat.c
550 lib/gssapi/krb5/creds.c lib/gssapi/krb5/acquire_cred.c lib/gssapi/krb5/release_cred.c
551 lib/gssapi/krb5/store_cred.c lib/gssapi/krb5/set_cred_option.c lib/gssapi/krb5/decapsulate.c
552 lib/gssapi/krb5/verify_mic.c lib/gssapi/krb5/accept_sec_context.c lib/gssapi/krb5/set_sec_context_option.c
553 lib/gssapi/krb5/process_context_token.c lib/gssapi/krb5/prf.c lib/gssapi/krb5/aeap.c
554 lib/gssapi/mech/context.c lib/gssapi/mech/gss_krb5.c lib/gssapi/mech/gss_mech_switch.c
555 lib/gssapi/mech/gss_process_context_token.c lib/gssapi/mech/gss_buffer_set.c
556 lib/gssapi/mech/gss_aeap.c lib/gssapi/mech/gss_add_cred.c lib/gssapi/mech/gss_cred.c
557 lib/gssapi/mech/gss_add_oid_set_member.c lib/gssapi/mech/gss_compare_name.c lib/gssapi/mech/gss_release_oid_set.c
558 lib/gssapi/mech/gss_create_empty_oid_set.c lib/gssapi/mech/gss_decapsulate_token.c lib/gssapi/mech/gss_inquire_cred_by_oid.c
559 lib/gssapi/mech/gss_canonicalize_name.c lib/gssapi/mech/gss_inquire_sec_context_by_oid.c lib/gssapi/mech/gss_inquire_names_for_mech.c
560 lib/gssapi/mech/gss_inquire_mechs_for_name.c lib/gssapi/mech/gss_wrap_size_limit.c lib/gssapi/mech/gss_names.c
561 lib/gssapi/mech/gss_verify.c lib/gssapi/mech/gss_display_name.c
562 lib/gssapi/mech/gss_duplicate_oid.c lib/gssapi/mech/gss_display_status.c lib/gssapi/mech/gss_release_buffer.c
563 lib/gssapi/mech/gss_release_oid.c lib/gssapi/mech/gss_test_oid_set_member.c
564 lib/gssapi/mech/gss_release_cred.c
565 lib/gssapi/mech/gss_set_sec_context_option.c lib/gssapi/mech/gss_export_name.c lib/gssapi/mech/gss_seal.c
566 lib/gssapi/mech/gss_acquire_cred.c lib/gssapi/mech/gss_unseal.c lib/gssapi/mech/gss_verify_mic.c
567 lib/gssapi/mech/gss_accept_sec_context.c lib/gssapi/mech/gss_inquire_cred_by_mech.c lib/gssapi/mech/gss_indicate_mechs.c
568 lib/gssapi/mech/gss_delete_sec_context.c lib/gssapi/mech/gss_sign.c lib/gssapi/mech/gss_utils.c
569 lib/gssapi/mech/gss_init_sec_context.c lib/gssapi/mech/gss_oid_equal.c lib/gssapi/mech/gss_oid_to_str.c
570 lib/gssapi/mech/gss_context_time.c lib/gssapi/mech/gss_encapsulate_token.c lib/gssapi/mech/gss_get_mic.c
571 lib/gssapi/mech/gss_import_sec_context.c lib/gssapi/mech/gss_inquire_cred.c lib/gssapi/mech/gss_wrap.c
572 lib/gssapi/mech/gss_import_name.c lib/gssapi/mech/gss_duplicate_name.c lib/gssapi/mech/gss_unwrap.c
573 lib/gssapi/mech/gss_export_sec_context.c lib/gssapi/mech/gss_inquire_context.c lib/gssapi/mech/gss_release_name.c
574 lib/gssapi/mech/gss_set_cred_option.c  lib/gssapi/mech/gss_pseudo_random.c ../heimdal_build/gssapi-glue.c''',
575     includes='../heimdal/lib/gssapi ../heimdal/lib/gssapi/gssapi ../heimdal/lib/gssapi/spnego ../heimdal/lib/gssapi/krb5 ../heimdal/lib/gssapi/mech',
576     deps='HEIMDAL_HCRYPTO asn1 HEIMDAL_SPNEGO_ASN1 HEIMDAL_GSSAPI_ASN1 roken krb5 com_err wind',
577     vnum='2.0.0',
578     )
579
580 # expand_path.c needs some of the install paths
581 HEIMDAL_SUBSYSTEM('HEIMDAL_CONFIG',
582                   'lib/krb5/expand_path.c lib/krb5/plugin.c',
583                   includes='../heimdal/lib/krb5 ../heimdal/lib/asn1 ../heimdal/include',
584                   cflags=bld.dynconfig_cflags('LIBDIR BINDIR LIBEXECDIR SBINDIR'),
585                   deps='HEIMDAL_HCRYPTO wind hx509 com_err'
586                   )
587
588 KRB5_SOURCE = [os.path.join('lib/krb5/', x) for x in to_list(
589                                '''acache.c add_et_list.c
590                                addr_families.c appdefault.c
591                                asn1_glue.c auth_context.c
592                                build_ap_req.c build_auth.c cache.c
593                                changepw.c codec.c config_file.c
594                                constants.c context.c convert_creds.c
595                                copy_host_realm.c crc.c creds.c
596                                crypto.c data.c eai_to_heim_errno.c
597                                error_string.c expand_hostname.c
598                                fcache.c free.c free_host_realm.c
599                                generate_seq_number.c generate_subkey.c
600                                get_addrs.c get_cred.c
601                                get_default_principal.c
602                                get_default_realm.c get_for_creds.c
603                                get_host_realm.c get_in_tkt.c
604                                get_port.c init_creds.c init_creds_pw.c
605                                kcm.c keyblock.c keytab.c keytab_any.c
606                                keytab_file.c keytab_memory.c
607                                keytab_keyfile.c krbhst.c log.c
608                                mcache.c misc.c mk_error.c mk_priv.c
609                                mk_rep.c mk_req.c mk_req_ext.c
610                                mit_glue.c n-fold.c padata.c pkinit.c
611                                principal.c prog_setup.c pac.c
612                                pcache.c prompter_posix.c rd_cred.c rd_error.c
613                                rd_priv.c rd_rep.c rd_req.c replay.c
614                                send_to_kdc.c set_default_realm.c
615                                store.c store_emem.c store_fd.c
616                                store_mem.c ticket.c time.c transited.c
617                                v4_glue.c version.c warn.c krb5_err.c
618                                heim_err.c k524_err.c krb_err.c''')]  + ["../heimdal_build/krb5-glue.c"]
619
620 HEIMDAL_LIBRARY('krb5', KRB5_SOURCE,
621                     includes='../heimdal/lib/krb5 ../heimdal/lib/asn1 ../heimdal/include',
622             deps='roken HEIMDAL_PKINIT_ASN1 wind HEIMDAL_KRB5_ASN1 hx509 HEIMDAL_HCRYPTO LIBSAMBA-HOSTCONFIG intl com_err HEIMDAL_CONFIG',
623             vnum='26.0.0',
624                     )
625 KRB5_PROTO_SOURCE = KRB5_SOURCE + ['lib/krb5/expand_path.c', 'lib/krb5/plugin.c']
626
627 HEIMDAL_AUTOPROTO_PRIVATE('lib/krb5/krb5-private.h', KRB5_PROTO_SOURCE)
628 HEIMDAL_AUTOPROTO('lib/krb5/krb5-protos.h', KRB5_PROTO_SOURCE,
629     options='-E KRB5_LIB -q -P comment -o')
630
631 if not bld.CONFIG_SET("USING_SYSTEM_ASN1"):
632     HEIMDAL_HEIM_ASN1_DER_SOURCE = '''
633         lib/asn1/der_get.c
634         lib/asn1/der_put.c
635         lib/asn1/der_free.c
636         lib/asn1/der_format.c
637         lib/asn1/der_length.c
638         lib/asn1/der_copy.c
639         lib/asn1/der_cmp.c
640     '''
641
642     HEIMDAL_AUTOPROTO('lib/asn1/der-protos.h',
643                           HEIMDAL_HEIM_ASN1_DER_SOURCE,
644                           group = 'compiler_prototypes',
645                           options="-q -P comment -o")
646
647
648     HEIMDAL_AUTOPROTO('lib/asn1/der-private.h',
649                           HEIMDAL_HEIM_ASN1_DER_SOURCE,
650                           group = 'compiler_prototypes',
651                           options="-q -P comment -p")
652
653     HEIMDAL_SUBSYSTEM('HEIMDAL_HEIM_ASN1',
654         HEIMDAL_HEIM_ASN1_DER_SOURCE + 'lib/asn1/extra.c lib/asn1/timegm.c lib/asn1/asn1_err.c',
655         includes='../heimdal/lib/asn1',
656         deps='roken com_err'
657         )
658
659     HEIMDAL_LIBRARY('asn1',
660             deps="HEIMDAL_HEIM_ASN1",
661             source='',
662             vnum='8.0.0')
663
664
665 HEIMDAL_SUBSYSTEM('HEIMDAL_HCRYPTO_IMATH',
666     'lib/hcrypto/imath/imath.c lib/hcrypto/imath/iprime.c',
667     includes='../heimdal/lib/hcrypto/imath',
668     deps='roken'
669     )
670 if not bld.CONFIG_SET("USING_SYSTEM_TOMMATH"):
671     HEIMDAL_SUBSYSTEM('tommath',
672         'lib/hcrypto/libtommath/bncore.c lib/hcrypto/libtommath/bn_mp_init.c lib/hcrypto/libtommath/bn_mp_clear.c lib/hcrypto/libtommath/bn_mp_exch.c lib/hcrypto/libtommath/bn_mp_grow.c lib/hcrypto/libtommath/bn_mp_shrink.c lib/hcrypto/libtommath/bn_mp_clamp.c lib/hcrypto/libtommath/bn_mp_zero.c lib/hcrypto/libtommath/bn_mp_zero_multi.c lib/hcrypto/libtommath/bn_mp_set.c lib/hcrypto/libtommath/bn_mp_set_int.c lib/hcrypto/libtommath/bn_mp_init_size.c lib/hcrypto/libtommath/bn_mp_copy.c lib/hcrypto/libtommath/bn_mp_init_copy.c lib/hcrypto/libtommath/bn_mp_abs.c lib/hcrypto/libtommath/bn_mp_neg.c lib/hcrypto/libtommath/bn_mp_cmp_mag.c lib/hcrypto/libtommath/bn_mp_cmp.c lib/hcrypto/libtommath/bn_mp_cmp_d.c lib/hcrypto/libtommath/bn_mp_rshd.c lib/hcrypto/libtommath/bn_mp_lshd.c lib/hcrypto/libtommath/bn_mp_mod_2d.c lib/hcrypto/libtommath/bn_mp_div_2d.c lib/hcrypto/libtommath/bn_mp_mul_2d.c lib/hcrypto/libtommath/bn_mp_div_2.c lib/hcrypto/libtommath/bn_mp_mul_2.c lib/hcrypto/libtommath/bn_s_mp_add.c lib/hcrypto/libtommath/bn_s_mp_sub.c lib/hcrypto/libtommath/bn_fast_s_mp_mul_digs.c lib/hcrypto/libtommath/bn_s_mp_mul_digs.c lib/hcrypto/libtommath/bn_fast_s_mp_mul_high_digs.c lib/hcrypto/libtommath/bn_s_mp_mul_high_digs.c lib/hcrypto/libtommath/bn_fast_s_mp_sqr.c lib/hcrypto/libtommath/bn_s_mp_sqr.c lib/hcrypto/libtommath/bn_mp_add.c lib/hcrypto/libtommath/bn_mp_sub.c lib/hcrypto/libtommath/bn_mp_karatsuba_mul.c lib/hcrypto/libtommath/bn_mp_mul.c lib/hcrypto/libtommath/bn_mp_karatsuba_sqr.c lib/hcrypto/libtommath/bn_mp_sqr.c lib/hcrypto/libtommath/bn_mp_div.c lib/hcrypto/libtommath/bn_mp_mod.c lib/hcrypto/libtommath/bn_mp_add_d.c lib/hcrypto/libtommath/bn_mp_sub_d.c lib/hcrypto/libtommath/bn_mp_mul_d.c lib/hcrypto/libtommath/bn_mp_div_d.c lib/hcrypto/libtommath/bn_mp_mod_d.c lib/hcrypto/libtommath/bn_mp_expt_d.c lib/hcrypto/libtommath/bn_mp_addmod.c lib/hcrypto/libtommath/bn_mp_submod.c lib/hcrypto/libtommath/bn_mp_mulmod.c lib/hcrypto/libtommath/bn_mp_sqrmod.c lib/hcrypto/libtommath/bn_mp_gcd.c lib/hcrypto/libtommath/bn_mp_lcm.c lib/hcrypto/libtommath/bn_fast_mp_invmod.c lib/hcrypto/libtommath/bn_mp_invmod.c lib/hcrypto/libtommath/bn_mp_reduce.c lib/hcrypto/libtommath/bn_mp_montgomery_setup.c lib/hcrypto/libtommath/bn_fast_mp_montgomery_reduce.c lib/hcrypto/libtommath/bn_mp_montgomery_reduce.c lib/hcrypto/libtommath/bn_mp_exptmod_fast.c lib/hcrypto/libtommath/bn_mp_exptmod.c lib/hcrypto/libtommath/bn_mp_2expt.c lib/hcrypto/libtommath/bn_mp_n_root.c lib/hcrypto/libtommath/bn_mp_jacobi.c lib/hcrypto/libtommath/bn_reverse.c lib/hcrypto/libtommath/bn_mp_count_bits.c lib/hcrypto/libtommath/bn_mp_read_unsigned_bin.c lib/hcrypto/libtommath/bn_mp_read_signed_bin.c lib/hcrypto/libtommath/bn_mp_to_unsigned_bin.c lib/hcrypto/libtommath/bn_mp_to_signed_bin.c lib/hcrypto/libtommath/bn_mp_unsigned_bin_size.c lib/hcrypto/libtommath/bn_mp_signed_bin_size.c lib/hcrypto/libtommath/bn_mp_xor.c lib/hcrypto/libtommath/bn_mp_and.c lib/hcrypto/libtommath/bn_mp_or.c lib/hcrypto/libtommath/bn_mp_rand.c lib/hcrypto/libtommath/bn_mp_montgomery_calc_normalization.c lib/hcrypto/libtommath/bn_mp_prime_is_divisible.c lib/hcrypto/libtommath/bn_prime_tab.c lib/hcrypto/libtommath/bn_mp_prime_fermat.c lib/hcrypto/libtommath/bn_mp_prime_miller_rabin.c lib/hcrypto/libtommath/bn_mp_prime_is_prime.c lib/hcrypto/libtommath/bn_mp_prime_next_prime.c lib/hcrypto/libtommath/bn_mp_find_prime.c lib/hcrypto/libtommath/bn_mp_isprime.c lib/hcrypto/libtommath/bn_mp_dr_reduce.c lib/hcrypto/libtommath/bn_mp_dr_is_modulus.c lib/hcrypto/libtommath/bn_mp_dr_setup.c lib/hcrypto/libtommath/bn_mp_reduce_setup.c lib/hcrypto/libtommath/bn_mp_toom_mul.c lib/hcrypto/libtommath/bn_mp_toom_sqr.c lib/hcrypto/libtommath/bn_mp_div_3.c lib/hcrypto/libtommath/bn_s_mp_exptmod.c lib/hcrypto/libtommath/bn_mp_reduce_2k.c lib/hcrypto/libtommath/bn_mp_reduce_is_2k.c lib/hcrypto/libtommath/bn_mp_reduce_2k_setup.c lib/hcrypto/libtommath/bn_mp_reduce_2k_l.c lib/hcrypto/libtommath/bn_mp_reduce_is_2k_l.c lib/hcrypto/libtommath/bn_mp_reduce_2k_setup_l.c lib/hcrypto/libtommath/bn_mp_radix_smap.c lib/hcrypto/libtommath/bn_mp_read_radix.c lib/hcrypto/libtommath/bn_mp_toradix.c lib/hcrypto/libtommath/bn_mp_radix_size.c lib/hcrypto/libtommath/bn_mp_fread.c lib/hcrypto/libtommath/bn_mp_fwrite.c lib/hcrypto/libtommath/bn_mp_cnt_lsb.c lib/hcrypto/libtommath/bn_error.c lib/hcrypto/libtommath/bn_mp_init_multi.c lib/hcrypto/libtommath/bn_mp_clear_multi.c lib/hcrypto/libtommath/bn_mp_exteuclid.c lib/hcrypto/libtommath/bn_mp_toradix_n.c lib/hcrypto/libtommath/bn_mp_prime_random_ex.c lib/hcrypto/libtommath/bn_mp_get_int.c lib/hcrypto/libtommath/bn_mp_sqrt.c lib/hcrypto/libtommath/bn_mp_is_square.c lib/hcrypto/libtommath/bn_mp_init_set.c lib/hcrypto/libtommath/bn_mp_init_set_int.c lib/hcrypto/libtommath/bn_mp_invmod_slow.c lib/hcrypto/libtommath/bn_mp_prime_rabin_miller_trials.c lib/hcrypto/libtommath/bn_mp_to_signed_bin_n.c lib/hcrypto/libtommath/bn_mp_to_unsigned_bin_n.c',
673             includes='../heimdal/lib/hcrypto/libtommath'
674         )
675
676 HEIMDAL_SUBSYSTEM('HEIMDAL_HCRYPTO',
677     'lib/hcrypto/aes.c lib/hcrypto/bn.c lib/hcrypto/dh.c lib/hcrypto/dh-ltm.c lib/hcrypto/dh-imath.c lib/hcrypto/des.c lib/hcrypto/dsa.c lib/hcrypto/engine.c lib/hcrypto/md2.c lib/hcrypto/md4.c lib/hcrypto/md5.c lib/hcrypto/rsa.c lib/hcrypto/rsa-ltm.c lib/hcrypto/rsa-imath.c lib/hcrypto/rc2.c lib/hcrypto/rc4.c lib/hcrypto/rijndael-alg-fst.c lib/hcrypto/rnd_keys.c lib/hcrypto/sha.c lib/hcrypto/sha256.c lib/hcrypto/sha512.c lib/hcrypto/ui.c lib/hcrypto/evp.c lib/hcrypto/evp-hcrypto.c lib/hcrypto/pkcs5.c lib/hcrypto/pkcs12.c lib/hcrypto/rand.c lib/hcrypto/rand-egd.c lib/hcrypto/rand-unix.c lib/hcrypto/rand-fortuna.c lib/hcrypto/rand-timer.c lib/hcrypto/hmac.c lib/hcrypto/camellia.c lib/hcrypto/camellia-ntt.c lib/hcrypto/common.c lib/hcrypto/validate.c',
678     includes='../heimdal/lib/hcrypto ../heimdal/lib ../heimdal/include',
679     deps='roken asn1 HEIMDAL_HCRYPTO_IMATH HEIMDAL_RFC2459_ASN1 tommath'
680     )
681
682
683 if not bld.CONFIG_SET("USING_SYSTEM_HX509"):
684     HEIMDAL_ASN1('HEIMDAL_OCSP_ASN1',
685         'lib/hx509/ocsp.asn1',
686         options='--preserve-binary=OCSPTBSRequest --preserve-binary=OCSPResponseData',
687         includes='../heimdal/lib/asn1',
688         directory='lib/hx509'
689         )
690
691     HEIMDAL_ASN1('HEIMDAL_PKCS8_ASN1',
692         'lib/asn1/pkcs8.asn1',
693         directory='lib/asn1'
694         )
695
696
697     HEIMDAL_ASN1('HEIMDAL_PKCS9_ASN1',
698         'lib/asn1/pkcs9.asn1',
699         directory='lib/asn1'
700         )
701
702
703     HEIMDAL_ASN1('HEIMDAL_PKCS12_ASN1',
704         'lib/asn1/pkcs12.asn1',
705         directory='lib/asn1'
706         )
707
708     HEIMDAL_ASN1('HEIMDAL_CMS_ASN1',
709         'lib/asn1/cms.asn1',
710         option_file='lib/asn1/cms.opt',
711         directory='lib/asn1'
712         )
713
714     HEIMDAL_ASN1('HEIMDAL_PKCS10_ASN1',
715         'lib/hx509/pkcs10.asn1',
716         options='--preserve-binary=CertificationRequestInfo',
717         includes='../heimdal/lib/asn1',
718         directory='lib/hx509'
719         )
720
721     HEIMDAL_ERRTABLE('HEIMDAL_HX509_ERR_ET',
722         'lib/hx509/hx509_err.et')
723
724     HEIMDAL_HX509_OBJH_SOURCE = '''
725         lib/hx509/ca.c
726         lib/hx509/cert.c
727         lib/hx509/cms.c
728         lib/hx509/collector.c
729         lib/hx509/crypto.c
730         lib/hx509/error.c
731         lib/hx509/env.c
732         lib/hx509/file.c
733         lib/hx509/keyset.c
734         lib/hx509/ks_dir.c
735         lib/hx509/ks_file.c
736         lib/hx509/ks_keychain.c
737         lib/hx509/ks_mem.c
738         lib/hx509/ks_null.c
739         lib/hx509/ks_p11.c
740         lib/hx509/ks_p12.c
741         lib/hx509/lock.c
742         lib/hx509/name.c
743         lib/hx509/peer.c
744         lib/hx509/print.c
745         lib/hx509/req.c
746         lib/hx509/revoke.c
747         lib/hx509/sel.c
748         lib/hx509/hx509_err.c
749     '''
750
751     HEIMDAL_AUTOPROTO('lib/hx509/hx509-protos.h',
752                           HEIMDAL_HX509_OBJH_SOURCE,
753                           options="-R '^(_|^C)' -E HX509_LIB -q -P comment -o")
754
755     HEIMDAL_AUTOPROTO('lib/hx509/hx509-private.h',
756                           HEIMDAL_HX509_OBJH_SOURCE,
757                           options="-q -P comment -p")
758
759     HEIMDAL_LIBRARY('hx509',
760         'lib/hx509/ca.c lib/hx509/cert.c lib/hx509/cms.c lib/hx509/collector.c lib/hx509/crypto.c lib/hx509/error.c lib/hx509/env.c lib/hx509/file.c lib/hx509/keyset.c lib/hx509/ks_dir.c lib/hx509/ks_file.c lib/hx509/ks_keychain.c lib/hx509/ks_mem.c lib/hx509/ks_null.c lib/hx509/ks_p11.c lib/hx509/ks_p12.c lib/hx509/lock.c lib/hx509/name.c lib/hx509/peer.c lib/hx509/print.c lib/hx509/req.c lib/hx509/revoke.c lib/hx509/sel.c lib/hx509/hx509_err.c lib/hx509/sel-lex.c lib/hx509/sel-gram.c',
761         includes='../heimdal/lib/hx509',
762         deps='roken com_err asn1 HEIMDAL_HCRYPTO HEIMDAL_CMS_ASN1 HEIMDAL_RFC2459_ASN1 HEIMDAL_OCSP_ASN1 HEIMDAL_PKCS8_ASN1 HEIMDAL_PKCS9_ASN1 HEIMDAL_PKCS12_ASN1 HEIMDAL_PKINIT_ASN1 HEIMDAL_PKCS10_ASN1 wind HEIMDAL_KRB5_ASN1',
763         vnum='5.0.0',
764         )
765
766 if not bld.CONFIG_SET('USING_SYSTEM_WIND'):
767     HEIMDAL_ERRTABLE('WIND_ERR_ET',
768         'lib/wind/wind_err.et')
769
770     HEIMDAL_GENERATOR(
771         name="HEIMDAL_ERRORLIST",
772         rule="${PYTHON} ${SRC[0].abspath()} ${SRC[1].abspath()} ${SRC[1].parent.abspath(env)}",
773         source = '../heimdal/lib/wind/gen-errorlist.py ../heimdal/lib/wind/rfc3454.txt ../heimdal/lib/wind/stringprep.py',
774         target = '../heimdal/lib/wind/errorlist_table.c ../heimdal/lib/wind/errorlist_table.h'
775         )
776
777
778     HEIMDAL_GENERATOR(
779         name = 'HEIMDAL_NORMALIZE_TABLE',
780         rule="${PYTHON} ${SRC[0].abspath()} ${SRC[1].abspath()} ${SRC[2].abspath()} ${SRC[1].parent.abspath(env)}",
781         source = '../heimdal/lib/wind/gen-normalize.py ../heimdal/lib/wind/UnicodeData.txt ../heimdal/lib/wind/CompositionExclusions-3.2.0.txt',
782         target = '../heimdal/lib/wind/normalize_table.h ../heimdal/lib/wind/normalize_table.c'
783     )
784
785     HEIMDAL_GENERATOR(
786         name = 'HEIMDAL_COMBINING_TABLE',
787         rule="${PYTHON} ${SRC[0].abspath()} ${SRC[1].abspath()} ${SRC[1].parent.abspath(env)}",
788         source = '../heimdal/lib/wind/gen-combining.py ../heimdal/lib/wind/UnicodeData.txt',
789         target = '../heimdal/lib/wind/combining_table.h ../heimdal/lib/wind/combining_table.c'
790     )
791
792     HEIMDAL_GENERATOR(
793         name = 'HEIMDAL_BIDI_TABLE',
794         rule="${PYTHON} ${SRC[0].abspath()} ${SRC[1].abspath()} ${SRC[1].parent.abspath(env)}",
795         source = '../heimdal/lib/wind/gen-bidi.py ../heimdal/lib/wind/rfc3454.txt',
796         target = '../heimdal/lib/wind/bidi_table.h ../heimdal/lib/wind/bidi_table.c'
797     )
798
799
800     HEIMDAL_GENERATOR(
801         name = 'HEIMDAL_MAP_TABLE',
802         rule="${PYTHON} ${SRC[0].abspath()} ${SRC[2].abspath()} ${SRC[2].parent.abspath(env)}",
803         source = '../heimdal/lib/wind/gen-map.py ../heimdal/lib/wind/stringprep.py ../heimdal/lib/wind/rfc3454.txt',
804         target = '../heimdal/lib/wind/map_table.h ../heimdal/lib/wind/map_table.c'
805     )
806
807     HEIMDAL_LIBRARY('wind',
808           'lib/wind/wind_err.c lib/wind/stringprep.c lib/wind/errorlist.c lib/wind/errorlist_table.c lib/wind/normalize.c lib/wind/normalize_table.c lib/wind/combining.c lib/wind/combining_table.c lib/wind/utf8.c lib/wind/bidi.c lib/wind/bidi_table.c lib/wind/ldap.c lib/wind/map.c lib/wind/map_table.c',
809           includes='../heimdal/lib/wind',
810           deps='roken com_err',
811           vnum='0.0.0',
812           )
813
814 if not bld.CONFIG_SET('USING_SYSTEM_COM_ERR'):
815     HEIMDAL_LIBRARY('com_err',
816         'lib/com_err/com_err.c lib/com_err/error.c',
817         includes='../heimdal/lib/com_err',
818         deps='roken',
819         vnum='0.25',
820         )
821
822 HEIMDAL_SUBSYSTEM('HEIMDAL_VERS_HOSTCC',
823        'lib/vers/print_version.c ../heimdal_build/version.c',
824         group='build_compilers',
825        deps='LIBREPLACE_HOSTCC ROKEN_HOSTCC',
826        use_global_deps=False,
827        use_hostcc=True)
828
829 HEIMDAL_SUBSYSTEM('HEIMDAL_VERS',
830        'lib/vers/print_version.c ../heimdal_build/version.c',
831         group='build_compilers',
832         deps='roken')
833
834 # here is the asn1 compiler build rule
835 HEIMDAL_BINARY('asn1_compile',
836     'lib/asn1/main.c lib/asn1/gen.c lib/asn1/gen_copy.c lib/asn1/gen_decode.c lib/asn1/gen_encode.c lib/asn1/gen_free.c lib/asn1/gen_glue.c lib/asn1/gen_length.c lib/asn1/gen_seq.c lib/asn1/gen_template.c lib/asn1/hash.c lib/asn1/symbol.c lib/asn1/asn1parse.c lib/asn1/lex.c',
837     use_hostcc=True,
838         use_global_deps=False,
839         cflags='-DSOCKET_WRAPPER_DISABLE=1 -DNSS_WRAPPER_DISABLE=1 -D_SAMBA_HOSTCC_',
840         includes='../heimdal/lib/asn1',
841         group='build_compilers',
842         deps='ROKEN_HOSTCC LIBREPLACE_HOSTCC HEIMDAL_VERS_HOSTCC',
843         install=False
844     )
845
846
847 if not bld.CONFIG_SET('USING_SYSTEM_COMPILE_ET'):
848     HEIMDAL_BINARY('compile_et',
849         'lib/com_err/parse.c lib/com_err/lex.c lib/com_err/compile_et.c',
850         use_hostcc=True,
851         use_global_deps=False,
852         includes='../heimdal/lib/com_err',
853         group='build_compilers',
854         cflags='-DSOCKET_WRAPPER_DISABLE=1 -DNSS_WRAPPER_DISABLE=1 -D_SAMBA_HOSTCC_',
855         deps='ROKEN_HOSTCC LIBREPLACE_HOSTCC HEIMDAL_VERS_HOSTCC',
856         install=False
857         )
858     bld.env['COMPILE_ET'] = os.path.join(bld.env['BUILD_DIRECTORY'], 'compile_et')
859
860 HEIMDAL_BINARY('samba4kinit',
861     'kuser/kinit.c',
862     deps='krb5 heimntlm roken HEIMDAL_VERS',
863     install=False
864     )
865
866
867 HEIMDAL_BINARY('samba4kpasswd',
868     'kpasswd/kpasswd.c',
869     deps='krb5 heimntlm roken HEIMDAL_VERS',
870     install=False
871     )
872
873
874 HEIMDAL_GSSAPI_SPNEGO_SOURCE = '''
875     lib/gssapi/spnego/init_sec_context.c
876     lib/gssapi/spnego/external.c
877     lib/gssapi/spnego/compat.c
878     lib/gssapi/spnego/context_stubs.c
879     lib/gssapi/spnego/cred_stubs.c
880     lib/gssapi/spnego/accept_sec_context.c
881 '''
882
883 HEIMDAL_AUTOPROTO_PRIVATE('lib/gssapi/spnego/spnego-private.h',
884                               HEIMDAL_GSSAPI_SPNEGO_SOURCE)
885
886
887 HEIMDAL_GSSAPI_KRB5_SOURCE = '''
888     lib/gssapi/krb5/copy_ccache.c
889     lib/gssapi/krb5/delete_sec_context.c
890     lib/gssapi/krb5/init_sec_context.c
891     lib/gssapi/krb5/context_time.c
892     lib/gssapi/krb5/init.c
893     lib/gssapi/krb5/address_to_krb5addr.c
894     lib/gssapi/krb5/get_mic.c
895     lib/gssapi/krb5/inquire_context.c
896     lib/gssapi/krb5/add_cred.c
897     lib/gssapi/krb5/inquire_cred.c
898     lib/gssapi/krb5/inquire_cred_by_oid.c
899     lib/gssapi/krb5/inquire_cred_by_mech.c
900     lib/gssapi/krb5/inquire_mechs_for_name.c
901     lib/gssapi/krb5/inquire_names_for_mech.c
902     lib/gssapi/krb5/indicate_mechs.c
903     lib/gssapi/krb5/inquire_sec_context_by_oid.c
904     lib/gssapi/krb5/export_sec_context.c
905     lib/gssapi/krb5/import_sec_context.c
906     lib/gssapi/krb5/duplicate_name.c
907     lib/gssapi/krb5/import_name.c
908     lib/gssapi/krb5/compare_name.c
909     lib/gssapi/krb5/export_name.c
910     lib/gssapi/krb5/canonicalize_name.c
911     lib/gssapi/krb5/unwrap.c
912     lib/gssapi/krb5/wrap.c
913     lib/gssapi/krb5/release_name.c
914     lib/gssapi/krb5/cfx.c
915     lib/gssapi/krb5/8003.c
916     lib/gssapi/krb5/arcfour.c
917     lib/gssapi/krb5/encapsulate.c
918     lib/gssapi/krb5/display_name.c
919     lib/gssapi/krb5/sequence.c
920     lib/gssapi/krb5/display_status.c
921     lib/gssapi/krb5/release_buffer.c
922     lib/gssapi/krb5/external.c
923     lib/gssapi/krb5/compat.c
924     lib/gssapi/krb5/creds.c
925     lib/gssapi/krb5/acquire_cred.c
926     lib/gssapi/krb5/release_cred.c
927     lib/gssapi/krb5/store_cred.c
928     lib/gssapi/krb5/set_cred_option.c
929     lib/gssapi/krb5/decapsulate.c
930     lib/gssapi/krb5/verify_mic.c
931     lib/gssapi/krb5/accept_sec_context.c
932     lib/gssapi/krb5/set_sec_context_option.c
933     lib/gssapi/krb5/process_context_token.c
934     lib/gssapi/krb5/prf.c
935     lib/gssapi/krb5/aeap.c
936 '''
937
938 HEIMDAL_AUTOPROTO_PRIVATE('lib/gssapi/krb5/gsskrb5-private.h',
939                               HEIMDAL_GSSAPI_KRB5_SOURCE)
940
941
942