From 4be0ae794e4af2354d678fddd7bf1e822ffa9148 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 23 Sep 2005 16:32:52 +0000 Subject: r10456: More SCons fixes: - Add framework for fallback generating code - Move pread / pwrite replacement functions to libreplace - Support pidl builds correctly - Support asn1 builds correctly - Move OS-specific checks to lib/replace/SConscript (This used to be commit fbbfad0a1f7dedbf48e835a864f8285f283d72f3) --- source4/build/scons/pidl.py | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) (limited to 'source4/build/scons/pidl.py') diff --git a/source4/build/scons/pidl.py b/source4/build/scons/pidl.py index b29584c756..0c5c16b0b5 100644 --- a/source4/build/scons/pidl.py +++ b/source4/build/scons/pidl.py @@ -10,7 +10,7 @@ import SCons.Scanner idl_scanner = SCons.Scanner.ClassicCPP("PIDLScan", '.idl', 'CPPPATH', r'depends\(([^,]+),+\)', SCons.Node.FS.default_fs) -def idl_emitter(target, source, env): +def ndr_emitter(target, source, env): result = [] for s in source: base, ext = SCons.Util.splitext(str(s).split('/')[-1]) @@ -19,16 +19,34 @@ def idl_emitter(target, source, env): result.append('gen_ndr/%s.h' % base) return result, source -pidl_builder = SCons.Builder.Builder(action='$PIDLCOM', - emitter = idl_emitter, +ndr_builder = SCons.Builder.Builder(action='$NDRCOM', + emitter = ndr_emitter, src_suffix = '.idl', scanner = idl_scanner) +def tdr_emitter(target, source, env): + result = [] + for s in source: + base, ext = SCons.Util.splitext(str(s).split('/')[-1]) + result.append('%s/tdr_%s.c' % (s.get_dir(), base)) + result.append('%s/tdr_%s.h' % (s.get_dir(), base)) + result.append('%s/%s.h' % (s.get_dir(), base)) + return result, source + +tdr_builder = SCons.Builder.Builder(action='$TDRCOM', + emitter = tdr_emitter, + src_suffix = '.idl', + single_source = True, + scanner = idl_scanner) + def generate(env): env['PIDL'] = env.Detect(['./pidl/pidl', 'pidl']) - env['PIDLFLAGS'] = ['--outputdir', 'librpc/gen_ndr', '--ndr-header', '--ndr-parser', '--header'] - env['PIDLCOM'] = '$PIDL $PIDLFLAGS -- $SOURCE' - env['BUILDERS']['NdrMarshaller'] = pidl_builder + env['NDRFLAGS'] = ['--outputdir', 'librpc/gen_ndr','--ndr-header', '--ndr-parser','--header'] + env['TDRFLAGS'] = ['--tdr-parser', '--tdr-header','--header'] + env['NDRCOM'] = '$PIDL $NDRFLAGS -- $SOURCES' + env['TDRCOM'] = 'cd ${SOURCE.dir} && $PIDL $TDRFLAGS -- ${SOURCE.file}' + env['BUILDERS']['NdrMarshaller'] = ndr_builder + env['BUILDERS']['TdrMarshaller'] = tdr_builder def exists(env): return env.Detect(['./pidl/pidl','pidl']) -- cgit