1 # a waf tool to add extension based build patterns for Samba
3 import os, sys, Options
4 import string, Task, Utils, optparse
5 from Configure import conf
7 from TaskGen import extension
8 from samba_utils import *
10 ################################################################################
11 # a et task which calls out to compile_et to do the work
12 Task.simple_task_type('et',
13 '../heimdal_build/et_compile_wrapper.sh . ${TGT[0].bld_dir(env)} default/source4/heimdal_build/compile_et ${SRC[0].abspath(env)} ${TGT[0].bldpath(env)}',
14 color='BLUE', ext_out='.c',
18 def process_et(self, node):
19 c_node = node.change_ext('.c')
20 h_node = node.change_ext('.h')
21 self.create_task('et', node, [c_node, h_node])
22 self.allnodes.append(c_node)
28 ################################################################################
29 # a asn1 task which calls out to asn1_compile_wrapper.sh to do the work
30 Task.simple_task_type('asn1',
32 # shell script to convert ASN1 to C. This could be separated out if we want to
34 compiler=${TGT[0].compiler}
35 destdir=${TGT[0].destdir}
36 wrapper=${TGT[0].asn1wrapper}
37 srcfile=${SRC[0].abspath(env)}
38 asn1name=${TGT[0].asn1name}
39 options="${TGT[0].asn1options}"
42 $wrapper . $destdir $compiler $srcfile $asn1name ${options} --one-code-file
44 # that generated 3 files:
50 hxfile=$destdir/$asn1name.hx
51 xfile=$destdir/asn1_$asn1name.x
52 listfilee=$destdir/"$asn1name"_files
54 cfile=${TGT[0].abspath(env)}
55 hfile=${TGT[1].abspath(env)}
58 echo '#include "config.h"' > $cfile
68 def process_asn1(self, node):
70 asn1name = string.replace(node.file(), '.', '_')
71 c_node = NEW_NODE(node, 'asn1_%s.c' % asn1name)
72 h_node = NEW_NODE(node, '%s.h' % asn1name)
74 c_node.destdir = "default/source4/heimdal/" + self.asn1directory
75 c_node.asn1options = self.asn1options
76 c_node.asn1name = asn1name
77 c_node.asn1wrapper = "../heimdal_build/asn1_compile_wrapper.sh"
78 c_node.compiler = "default/source4/heimdal_build/asn1_compile"
80 self.create_task('asn1', node, [c_node, h_node])
81 self.allnodes.append(c_node)